Paint menu, select and combobox surfaces on the page's own palette - #2
Merged
Merged
Conversation
`menuColor: inverted` gave every floating surface the literal `dark` class, so a menu was the dark theme's `popover` whatever the page was doing. In a light application the panel arrives as a black rectangle that reads as a different product, and the first consumer to open a dropdown on a light page sees the design system disagree with itself. The preset flag moves to `default` and the three affected primitives are regenerated from the registry, so they stay shadcn-canonical and the additive gate keeps comparing like for like. The tooltip is untouched: Nova paints it `bg-foreground text-background`, which flips by construction. DESIGN.md records the new rule in place of the old one, and the config gate moves with it.
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.
What changed
menuColormoves frominvertedtodefault, anddropdown-menu,selectandcomboboxare regenerated from the registry so they stay shadcn-canonical.Under
inverted,DropdownMenuContent,DropdownMenuSubContent,SelectContentandComboboxContenteach carried the literaldarkclass. A floating surface was therefore the dark theme'spopoverregardless of the page beneath it. That was deliberate and documented — "contrast on purpose" — but the first light application to open a dropdown gets a black panel that reads as a different product, and the design system ends up disagreeing with itself on the same screen.The surfaces now follow whatever palette the page is in, light or dark.
The tooltip is untouched. Nova paints it
bg-foreground text-background, which flips by construction: one line of text has no palette of its own to keep in step.Why regenerate rather than edit
darklives in the committed canonical snapshots, andgates/canonical.test.mjspermits added lines only — a hand-edit fails it.menuColoris a first-class preset field, so flipping it and re-runningpnpm shadcn:add dropdown-menu select comboboxupdates both the snapshot and the primitive together, and the gate keeps comparing like for like. The only delta the script re-applies on top is the import relativisation.shadcn/select.tsxalso picks up a"use client"directive the CLI now emits. It is inert in this build and lands in both snapshot and primitive, so it does not open a gap in the gate.Design record
DESIGN.md§"Menus and the inverted subtree" becomes §"Menus and the page's palette" and states the new rule; the preset table row and themenuColorassertion ingates/tokens.test.mjsmove with it. The rule and its gate move together or not at all, per the file's own convention.Consequences
Every menu, select and combobox in every consuming application changes appearance, VisionSet included. This is a visual change, not a behavioural one: no props, exports or class-name contracts move.
Released as
0.1.1; publishing needs thev0.1.1tag after merge.Found, not fixed
Nothing.
Test plan
pnpm test:gates— 51 pass, 0 fail, including the three canonical-snapshot gates and the config gatepnpm test— 7 files, 61 tests passpnpm lint— clean (eslint +tsc --noEmit)pnpm build— clean