From 22e0d286c05f657b1716c52150e341135dd30020 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sat, 8 Aug 2026 01:16:21 +0200 Subject: [PATCH] fix(popover): stronger, centralized active-row highlight (UAT finding) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The roving-focus row in every popover menu was barely distinguishable from the menu surface — an accent fill at only 24%, and the recipe was copy-pasted across 5 consumers. Centralize it in PopoverItem (ACTIVE_HIGHLIGHT, applied to every item) and strengthen it: accent/35 fill + a 1px inset accent ring for a defined edge that reads across all 6 schemes in both themes. Consumers no longer carry the recipe. Uses the now-working `bg-accent/NN` / `ring-accent/NN` utilities (v4 does the opacity modifier via color-mix) instead of the old hand-written color-mix arbitrary value the v3 no-op forced. Verified in-browser: fill + inset ring render on the active item, dark and light. --- frontend/src/components/AddToPlaylist.tsx | 2 +- frontend/src/components/AnchoredPopover.tsx | 17 +++++++++++------ frontend/src/components/ChannelTags.tsx | 2 +- frontend/src/components/LanguageSwitcher.tsx | 2 +- frontend/src/components/ViewSwitcher.tsx | 2 +- frontend/src/components/tableHeader.tsx | 2 +- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/AddToPlaylist.tsx b/frontend/src/components/AddToPlaylist.tsx index db0f5137..d3335ab6 100644 --- a/frontend/src/components/AddToPlaylist.tsx +++ b/frontend/src/components/AddToPlaylist.tsx @@ -124,7 +124,7 @@ export default function AddToPlaylist({ // the floating element only). `toggle()` already no-ops while busy, so re-entrancy is // guarded without touching focus; `aria-busy` on the list conveys the pending state. label={playlistName(pl, t)} - className="w-full flex items-center gap-2 text-sm px-1.5 py-1.5 rounded-lg text-fg outline-hidden transition hover:bg-card/60 data-active:bg-[color-mix(in_srgb,var(--accent)_24%,transparent)]" + className="w-full flex items-center gap-2 text-sm px-1.5 py-1.5 rounded-lg text-fg outline-hidden transition hover:bg-card/60" > {children} diff --git a/frontend/src/components/ChannelTags.tsx b/frontend/src/components/ChannelTags.tsx index 17b102ed..36f8875b 100644 --- a/frontend/src/components/ChannelTags.tsx +++ b/frontend/src/components/ChannelTags.tsx @@ -75,7 +75,7 @@ function TagEditorMenu({ checked={on} onSelect={() => onToggle(tg.id)} label={tg.name} - className={`w-full flex items-center gap-2 text-left text-xs px-2 py-1.5 rounded-md outline-hidden transition hover:bg-card data-active:bg-[color-mix(in_srgb,var(--accent)_24%,transparent)] data-active:text-fg ${ + className={`w-full flex items-center gap-2 text-left text-xs px-2 py-1.5 rounded-md outline-hidden transition hover:bg-card ${ on ? "text-fg" : "text-muted" }`} > diff --git a/frontend/src/components/LanguageSwitcher.tsx b/frontend/src/components/LanguageSwitcher.tsx index 7d861319..62b9f214 100644 --- a/frontend/src/components/LanguageSwitcher.tsx +++ b/frontend/src/components/LanguageSwitcher.tsx @@ -78,7 +78,7 @@ export default function LanguageSwitcher({ setOpen(false); }} label={l.label} - className="w-full flex items-center justify-between gap-2 text-sm px-2 py-2 rounded-lg text-muted outline-hidden transition hover:text-fg hover:bg-card data-active:bg-[color-mix(in_srgb,var(--accent)_24%,transparent)] data-active:text-fg" + className="w-full flex items-center justify-between gap-2 text-sm px-2 py-2 rounded-lg text-muted outline-hidden transition hover:text-fg hover:bg-card" > {l.label} {l.code === value && } diff --git a/frontend/src/components/ViewSwitcher.tsx b/frontend/src/components/ViewSwitcher.tsx index 14c14ac5..bb721f54 100644 --- a/frontend/src/components/ViewSwitcher.tsx +++ b/frontend/src/components/ViewSwitcher.tsx @@ -94,7 +94,7 @@ export default function ViewSwitcher({ setOpen(false); }} label={o.label} - className={`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-sm text-left outline-hidden transition data-active:bg-[color-mix(in_srgb,var(--accent)_24%,transparent)] ${ + className={`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-sm text-left outline-hidden transition ${ on ? "text-accent" : "text-fg hover:bg-card" }`} > diff --git a/frontend/src/components/tableHeader.tsx b/frontend/src/components/tableHeader.tsx index a3744953..9db87ad5 100644 --- a/frontend/src/components/tableHeader.tsx +++ b/frontend/src/components/tableHeader.tsx @@ -197,7 +197,7 @@ function FilterFunnel({ onApply(col.key, on ? arr.filter((x) => x !== o.value) : [...arr, o.value]) } label={o.label} - className={`flex w-full items-center gap-2 text-left text-xs px-2 py-1.5 rounded-md outline-hidden transition data-active:bg-[color-mix(in_srgb,var(--accent)_24%,transparent)] ${ + className={`flex w-full items-center gap-2 text-left text-xs px-2 py-1.5 rounded-md outline-hidden transition ${ on ? "text-fg" : "text-muted hover:bg-card" }`} >