Skip to content

fix(command-palette): give the keyboard-selected row a visible fill#763

Merged
mremond merged 1 commit into
mainfrom
fix/cmdk-selected-row-highlight
Jun 30, 2026
Merged

fix(command-palette): give the keyboard-selected row a visible fill#763
mremond merged 1 commit into
mainfrom
fix/cmdk-selected-row-highlight

Conversation

@mremond

@mremond mremond commented Jun 29, 2026

Copy link
Copy Markdown
Member

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-brand resolves to a complete hsl(...) string. Tailwind's /opacity modifier cannot inject an alpha value into such a token, so the whole background-color declaration was silently dropped — the computed background was rgba(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 the data-selected attribute and toHaveClass (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 the hsla(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.

@mremond mremond added this to the 0.17.0 milestone Jun 29, 2026
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.
@mremond mremond force-pushed the fix/cmdk-selected-row-highlight branch from 6d21b74 to cc6083d Compare June 30, 2026 05:32
@mremond mremond merged commit 13e1ea8 into main Jun 30, 2026
3 checks passed
@mremond mremond deleted the fix/cmdk-selected-row-highlight branch June 30, 2026 05:39
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.

1 participant