Repository navigation
Description
Overview
Eight filled hsl(var(--primary)) buttons express hover as opacity: 0.9 — a fourth hover idiom that the audit in #2673 did not catalogue (it found three: two alpha forms and two filter: brightness()).
| File | Line |
|---|---|
settings/model-manager.svelte |
747 |
chat/chat-input.svelte |
132 |
viewers/collection-node-viewer.svelte |
594 |
viewers/query-node-viewer.svelte |
816 |
viewers/query-node-viewer.svelte |
855 |
viewers/ai-chat-pty-session.svelte |
693 |
query/query-editor.svelte |
409 |
onboarding/onboarding-wizard.svelte |
832 |
Why it is milder than the idioms #2673 removed — but still wrong
opacity fades the label along with the fill, so the contrast ratio roughly holds rather than collapsing. That makes this less harmful than hsl(var(--x) / 0.85), which fades only the background and degrades contrast.
It is still theme-blind in the same way, and DESIGN.md now states the rule it violates:
- The button becomes translucent, so whatever sits behind it shows through — the same latent bug Add --destructive-hover / --primary-hover tokens and unify filled-button hover states #2673 fixed for the four modal buttons.
- The direction is not a decision. Fading toward the surface lightens on a white background and darkens on a dark one, so hover moves opposite ways between themes as an emergent side effect.
- It bypasses
--primary-hover, so these buttons will not follow the documented law if the token is ever retuned.
Expected shape of the fix
Mostly mechanical — replace opacity: 0.9 with background: hsl(var(--primary-hover)) — but each site needs individual checking, which is why this is filed rather than folded into #2685:
- The base rule's property must match (
backgroundvsbackground-color) or the hover will not override. - Some sites carry
transition: opacity 0.15s ease(e.g.query-editor.svelte:405) that becomes dead once opacity stops changing. That transition is also already a design-token baseline violation in several files, so removing it should shrink the baseline rather than grow it — verify withbun run quality:design-tokens. chat-input.sveltepairs its hover with:disabled { opacity: 0.4 }; the disabled state legitimately keeps using opacity and should be left alone.
Estimated small-to-medium: eight files, no design decision required, but eight separate verifications.
Acceptance Criteria
- All eight sites use
hsl(var(--primary-hover))instead ofopacity: 0.9 - Each hover declaration matches its base rule's background property
- Orphaned
transition: opacityremoved where opacity no longer changes; design-token baseline does not grow -
:disabled { opacity }states left intact — they are a different affordance - Buttons are fully opaque at rest and on hover
Related
- Add --destructive-hover / --primary-hover tokens and unify filled-button hover states #2673 / Add --primary-hover / --destructive-hover and unify filled-button hovers (closes #2673) #2685 — added
--primary-hover/--destructive-hoverand the DESIGN.md rule; this idiom was found during that review - Shared shadcn Button variants use alpha hovers and lose contrast on hover in every variant #2689 — the shared shadcn
Buttonvariants, the other outstanding violator
Activity
Address review: guard the hover rule with an executable test
Add --primary-hover / --destructive-hover and unify filled-button hov…
mstomar125 commentedon Sep 21, 2026
Frontend baseline: 256 test files / 5226 tests passed. Design-token baseline: 50 known violations.
Replace opacity: 0.9 hover with --primary-hover on 8 buttons (#2764)