fix(ui): improve selected and hover contrast across the app - #140
fix(ui): improve selected and hover contrast across the app#140cashcon57 wants to merge 8 commits into
Conversation
ff3c603 to
9509040
Compare
8e3ae69 to
f3777d8
Compare
|
Rebased onto current main to keep this easy to merge and resolve conflicts. Typecheck passing. |
|
Thanks for this, @cashcon57, and apologies for how long it's been sitting. The direction is right, and I want to say why before getting to the changes, because the core insight is good. Replacing Three things before I can merge. 1. The screenshots are in the commitBoth at the repository root. That's 840 KB in git history forever, for two files nothing references — every future clone pays for them. Please drop them from the branch and attach them to the PR description instead, where they're much more useful anyway. I'd genuinely like to see them; a before/after is the only real way to review a contrast change. 2. It no longer mergesTwo conflicts against current
3. The sweep is now partialThis is the one worth a conversation. Merged as-is, the app ends up with both treatments side by side — the sidebar and dropdowns on the new one, the agent surfaces on the old. That's arguably worse than the inconsistency you set out to fix, because it's inconsistency between adjacent panels rather than between the app and itself. Two ways forward, your call:
I'd take either. The One thing I couldn't check: I can't render the app from here, so I'm taking the contrast improvement on your testing rather than measuring it. If you have before/after numbers against WCAG for the selected state, put them in the description — that would settle it for good. Sorry again for the delay. Rebase, drop the PNGs, and tell me which scope you want, and I'll get this in 🎨 Generated by Claude Code |
They were variant="secondary" on a bg-secondary row, so the button was the same shade as its surface and the hover (secondary/80) faded it further. Switch to the ghost variant so they pick up the shared hover:bg-foreground/10 overlay and read on the row.
…and dialogs Extend the foreground/10 hover and foreground/20 selected treatment to the sites added since this branch opened (agent workspace controls, skill slash menu, task suggestions, skills route, hub model rows and filters, download options, thread list, dialog close, drawer handle, model combobox, MCP server toggle, cloud provider picker) so the app lands on one system. Static container fills, status badges, the outline and secondary button variants, and destructive dropdown states keep their own treatments.
f3777d8 to
bc8f17a
Compare
|
Thanks for taking the wider option, @cashcon57 — all three items from last round are closed, and I appreciate you choosing to finish the sweep rather than narrow the scope. Verified on your branch (based on
Two things before merge. The first is a genuine regression, and it's my fault for not warning you about it. 1. Two tests failFull These landed on 2. Hover overrides selected on ~12 sitesThis is the interesting one, and it's the same class of bug the PR exists to fix. I built the branch and read the compiled CSS rather than guessing at precedence: .bg-foreground\/20{background-color:color-mix(in oklab,var(--foreground)20%,transparent)}
.hover\:bg-foreground\/10:hover{background-color:color-mix(in oklab,var(--foreground)10%,transparent)}
You clearly know this, because you guard it in nine places with Plus the
value === model && 'bg-foreground/20 shadow-sm',
highlightedIndex === index && ' bg-foreground/10'Both are unprefixed utilities, so
Worth closing all of them: "hover reads as strong as the selection" is the exact complaint in your own description. Nits
Fix the two tests and the selected/hover collision and I'll merge this. Seven weeks is far too long for a PR this well-argued to have sat 🎨 Generated by Claude Code |
Describe Your Changes
A pass over the app's low-contrast selected/hover states. Several used an absolute
bg-secondary/bg-accentoverlay, which collapses against light backgrounds(both ≈
0.97in light, nearly identical to the surfaces they sit on) — so thestate was hard to see, especially in light mode, and in places hover read as strong
as (or stronger than) the selection.
Everything moves to a background-relative
foregroundoverlay so it stayslegible on any surface in both themes, with hover (
/10) a clear step belowselected (
/20).Design decisions
bg-secondary/bg-accentare ≈0.97in light — the same lightness as the surfaces behind them, so they vanish. A
foregroundoverlay is a fixed delta from whatever is behind it, so it holds upon any surface and flips correctly between themes.
/10hover,/20selected. Two fixed steps keep hover clearly below selected;before, several menus had them equal (or hover stronger).
ghostbutton variant and thebase dropdown-menu item states are each changed once, so every ghost button (~80)
and every dropdown inherits it rather than being patched per call site.
outlinevariant left alone — it has a border, so its hover already reads fine.Selected states →
bg-foreground/20DropdownModelProvider), search dialog (SearchDialog), HermesAgent / Claude Code model rows, dropdown control (
DropdownControl), assistantswitcher (
SamplerPopover). The search dialog's selected row was previouslylighter than its hover — now clearly stronger.
hub/index) and default-assistant picker (settings/assistant)— the selected item used
bg-secondary(0.97), the exact same lightness as themenu hover, so selected and hovered items were indistinguishable.
Hover states →
bg-foreground/10ghostbutton variant (components/ui/button.tsx) —hover:bg-accentwas thefaint hover on every ghost button (message copy/edit/delete/regenerate, header
icons, menus, …). Shared design-system change — affects all
variant="ghost"buttons app-wide (~80 usages).
outlineis left as-is (it has a border).components/ui/dropdown-menu.tsx) — the basefocus:bg-accent/data-[state=open]:bg-accentstates. Also a shareddesign-system change — affects every dropdown menu app-wide, and makes menu
items hover consistently with ghost buttons.
SettingsMenu) — category links usedhover:bg-secondarywhileprovider rows used
hover:bg-secondary/60(mismatched and faint in light); unified.EditModel,DeleteModel) — these had nohover feedback at all; added.
DownloadManegement) — these werevariant="secondary"on abg-secondaryrow, so the button was the same shade asits surface and
hover:bg-secondary/80only faded it further. Switched toghostso they share the hover overlay and read on the row.
hover:bg-{muted,secondary}at assorted opacities): hub model variant rows (
HubModelCard), project file rows(
ProjectFiles), security config rows (SecurityConfigDialog), assistant cards,and the small utility icon buttons in
AddEditMCPServer,AddEditCustomCliDialog,AudioPlayer,Capabilities,ApiKeyInput,AttachmentChip,hermes-agent.These had drifted across several ad-hoc values; they now share the one hover overlay.
Companion to #106 (sidebar/nav/settings selected states, already merged).
Styling-only — no logic, no new dependencies — verified in a local dev build.
Before / After
Light mode (where the change is most visible) — stock
v1.1.119vs. this branch:Model selector — row hover
Hub sort dropdown — selected vs. hover (were the same shade before)
Model edit button — hover (no hover before)
Search (⌘K) — highlighted result
Settings menu — hover vs. selected
Fixes Issues
Self Checklist