fix(command-palette): give the keyboard-selected row a visible fill#763
Merged
Conversation
The Cmd-K selected row had no background fill: only a 2px accent left border and medium weight marked it, so a hovered row (hover:bg-fluux-hover) read as more highlighted than the keyboard-selected one. The previous `bg-fluux-brand/50` utility was already dropped from the row in #765, but no replacement fill was added. Tailwind's /opacity modifier no-ops on our hsl()-string accent token anyway. Add a deterministic CSS rule keyed on `data-selected`, using the same hsla(var(--fluux-accent-h)...) accent-alpha pattern as the focus-zone ring, so the soft tint renders across all themes.
6d21b74 to
cc6083d
Compare
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.
Summary
The Cmd-K command palette's keyboard-selected row had no visible background fill — only a thin left accent border and slightly bolder text marked the selection. A hovered row (
hover:bg-fluux-hover) actually read as more highlighted than the keyboard-selected one.Root cause
The selected row used
bg-fluux-brand/50, but--fluux-brandresolves to a completehsl(...)string. Tailwind's/opacitymodifier cannot inject an alpha value into such a token, so the wholebackground-colordeclaration was silently dropped — the computed background wasrgba(0, 0, 0, 0)(fully transparent). This is the same no-op gotcha already documented around the search-field styling in this component. It went unnoticed because the surrounding tests only assert on thedata-selectedattribute andtoHaveClass(the class string is present regardless of whether it renders).Fix
Replace the broken utility with a deterministic CSS rule keyed on
data-selected, using thehsla(var(--fluux-accent-h)...)accent-alpha pattern already used for the focus-zone ring. This renders a soft accent tint correctly across all themes (light/dark), kept a touch stronger than the hover fill so the keyboard selection stays the most prominent state. The 2px accent left border and medium weight carry the rest of the emphasis.