refactor(pickers)!: the panel owns its tokens, and drops the -dropdown name - #699
Merged
Merged
Conversation
…n name Two things the pickers were the last to carry. The panel inherited its tokens from the field's root, with a `*:not(.date-picker) > .date-picker-dropdown` selector patching the case where it had been teleported away. That patch is why nothing had broken, not a reason the arrangement was sound: a panel can leave the field through the container option, and a framework port may render it into document.body through a portal, so nothing inside it may depend on having a particular ancestor. It declares its own tokens now — verified by reading the computed token off a panel teleported to body, where it resolves the same as one left in place. And `-dropdown` was the vocabulary of the per-family panels, retired everywhere else when the options menu became .combobox-popup. The pickers kept it. They are .date-picker-popup and .time-picker-popup now, so every panel in the library reads `.popup <surface>-popup`. width: min-content went too: an absolutely positioned panel already shrinks to its content, and both pickers measure identically without it — 326x388 and 197x258 either way.
Coverage Report for CI Build 30959216891Coverage remained the same at 92.97%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two things the pickers were the last in the library to carry, and the React port is what surfaces both.
The panel depended on its ancestor
The tokens lived on the field's root, with a negation selector patching the case where the panel had been teleported out. That patch is why nothing had broken — not a reason the arrangement was sound. A panel leaves the field through the
containeroption today, and a framework port may render it intodocument.bodythrough a portal tomorrow, so nothing inside a panel may depend on having a particular ancestor.It declares its own tokens now. Verified by reading the computed token off two panels in the same document:
Same value, no patch, one selector instead of two.
-dropdownwas the last of the old vocabularyEvery other family lost it when the options menu became
.combobox-popup—.autocomplete-dropdownand.form-multi-select-dropdownwent with it. The pickers kept theirs..date-picker-dropdown.date-picker-popup.time-picker-dropdown.time-picker-popupEvery panel in the library now reads
.popup <surface>-popup. Note the class is shared, not per-family: date picker, date range picker and date time picker all use.date-picker-popup, the same way autocomplete and multi select share.combobox-popup.width: min-contentwas doing nothingMeasured rather than assumed — an absolutely positioned panel already shrinks to its content:
Deleted.
Verification
The teleport probe above, plus 2975 unit tests (the date picker spec's selectors renamed), 33 visual baselines unchanged, stylelint, fusv, the class API guard with both renames registered, and a full docs build. Migration guide carries the mapping and the reason.