Skip to content

refactor(pickers)!: the panel owns its tokens, and drops the -dropdown name - #699

Merged
mrholek merged 1 commit into
v6-devfrom
refactor/picker-panel-self-contained-v6
Aug 4, 2026
Merged

refactor(pickers)!: the panel owns its tokens, and drops the -dropdown name#699
mrholek merged 1 commit into
v6-devfrom
refactor/picker-panel-self-contained-v6

Conversation

@mrholek

@mrholek mrholek commented Aug 4, 2026

Copy link
Copy Markdown
Member

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

.date-picker,
*:not(.date-picker) > .date-picker-dropdown {
  @include tokens($date-picker-tokens);
}

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 container option today, and a framework port may render it into document.body through 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:

w polu:        parent=div   --cui-date-picker-footer-padding = 0.5rem
teleportowany: parent=body  --cui-date-picker-footer-padding = 0.5rem

Same value, no patch, one selector instead of two.

-dropdown was the last of the old vocabulary

Every other family lost it when the options menu became .combobox-popup.autocomplete-dropdown and .form-multi-select-dropdown went with it. The pickers kept theirs.

v5 v6
.date-picker-dropdown .date-picker-popup
.time-picker-dropdown .time-picker-popup

Every 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-content was doing nothing

Measured rather than assumed — an absolutely positioned panel already shrinks to its content:

z width:min-content   date=326x388  time=197x258
bez width:min-content date=326x388  time=197x258

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.

…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.
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 30959216891

Coverage remained the same at 92.97%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 4 of 4 lines across 4 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 8667
Covered Lines: 8272
Line Coverage: 95.44%
Relevant Branches: 4819
Covered Branches: 4266
Branch Coverage: 88.52%
Branches in Coverage %: Yes
Coverage Strength: 362.7 hits per line

💛 - Coveralls

@mrholek
mrholek merged commit 080d53a into v6-dev Aug 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants