Repository navigation
Replace hardcoded shadows and phantom color vars with design tokens (closes #2591) - #2670
Conversation
…loses #2591) DESIGN.md restricts box-shadow to floating surfaces (popovers, dropdowns) and states modals get no drop shadow -- the backdrop provides separation. Eight components carried hand-picked shadows in violation of that rule. Removes the shadow from all of them. The Toast section specifies z-index only and the "Don't" list scopes shadows to popovers/dropdowns, so conflict-toast and update-banner fall under the same rule as the modal panels rather than getting a sanctioned toast shadow. Underneath the shadows sat a larger defect. Four of these components referenced a --color-* vocabulary (--color-surface, --color-text-primary, --color-border, --color-accent, ...) that app.css defines nowhere, so every reference silently resolved to its hardcoded fallback. Those fallbacks are dark-only values (#1e1e1e surface, #e0e0e0 text), meaning these components rendered dark chrome in light mode regardless of theme -- a real theming bug masked by token-shaped syntax that did nothing. Each literal is mapped by semantic intent rather than nearest hex match: the delete button's #c0392b becomes --destructive, update-banner's and pro-relogin's action blues become --primary (DESIGN.md: primary for all interactive affordances), conflict-toast's amber becomes --warning. Backdrop overlays keep rgba(0, 0, 0, 0.5): that is the consistent app-wide convention across every modal, and the issue scopes backdrop opacity out. conflict-toast's animation violations are pre-existing and unrelated. The design-token baseline ratchets 251 -> 201 accordingly. version-conflict-modal.svelte, named in the issue as the holder of a hardcoded Material palette, was deleted as an orphaned component in #2602; its two acceptance criteria are moot. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Pragmatic Code Review — PR #2670Review Type: Initial Review (0 prior reviews, 0 prior comments) Requirements CheckAcceptance criteria from issue #2591:
Scope expansion (agreed with maintainer, documented on the issue): 4 components referenced a Verification performedToken existence (all confirmed in BOTH
No phantom tokens introduced. ✅
Baseline re-record integrity — this is the finding I most wanted to confirm, and it is clean. Parsed both JSON files and did a multiset diff (
Remaining phantom Code Review Findings🟡 Improvements🟡-1 — Alpha-based hover contradicts DESIGN.md's explicit hover rule, and adds a third competing idiom 📁 DESIGN.md is unusually direct here:
There's a concrete rendering consequence too, not just a doctrinal one. This also leaves three different filled-button hover idioms across sibling files reviewed in the same pass:
Principle — DRY / single source of truth: a design system earns its keep by having exactly one answer to "how does a filled button hover?". Three answers in four adjacent files means the next component author picks by coin flip. To be fair on the alternatives: a literal reading of "use Recommendation: this is worth a follow-up issue rather than a blocker — it's pre-existing inconsistency this PR inherited and narrowed rather than created, and the change is still a clear net improvement over two hardcoded hexes. But please don't let it land silently: file the follow-up to add 🟡-2 — 📁 Both add I don't think this rises to "delete the dead code." It's a defensive default for future unstyled children, it matches the Worth noting explicitly because the greenfield "no dead code" rule in CLAUDE.md could be read as demanding its removal — I'd argue it shouldn't be, since a background without its paired foreground is the more dangerous state. No change requested; flagged so the judgment is on record rather than rediscovered later. 🟢 Nitpicks / Observations🟢-1 — Criterion 4 ("visual behavior otherwise unchanged") is technically not met, and that's correct The 🟢-2 — Deliberate exclusions are defensible Both hold up under scrutiny:
Both remain tracked in the baseline (verified: the 3 🟢-3 — 📁
🟢-4 — 📁
Standards Compliance
AssessmentThis is a well-executed change that is clearly net positive on code health. What stands out: the author didn't stop at the literal ask. The issue said "remove shadows and fix one file's hex literals"; the author found that the shadow removal was sitting on top of a real theming bug — four components silently rendering dark-only chrome in light mode because they referenced a CSS variable namespace that never existed. Token-shaped syntax that does nothing is worse than an honest hex literal, because it looks compliant to both reviewers and linters. Finding and fixing that is the highest-value part of this PR, and it was properly surfaced on the issue and in the commit body rather than smuggled in. The discipline around scope is equally good: the moot acceptance criteria were verified against git history rather than hand-waved, the exclusions were reasoned from DESIGN.md rather than convenience, and the baseline re-record is surgically exact — I diffed it as a multiset and every one of the 50 removed entries traces to a touched file, with nothing added. That last point matters most, because a sloppy re-record is how a regression guard quietly develops a hole, and this one didn't. On testing: no test is warranted. These are pure CSS declarations with no logic, no branching, and no runtime behavior. The Stylelint gate ( The only substantive finding is 🟡-1 (alpha-based hover). It contradicts an explicit DESIGN.md directive and introduces a subtle theme-dependent inversion — but it's a narrowing of pre-existing inconsistency, not a new mess, and the "correct" fix requires tokens that don't exist yet. That's a follow-up, not a gate. Recommendation: ✅ APPROVEMerge as-is. Please file one follow-up issue before/alongside merge:
Optional second follow-up: add an |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
/address-review summaryReview verdict was APPROVE with no 🔴 Critical findings. Ran Code changes made: none. No commit was needed — every finding was either explicitly not-a-change-request or correctly belongs in a follow-up. Triage
Verified rather than assumedI independently checked 🟡-1's behavioral claim before deferring it, since "hover direction inverts between themes" is a factual assertion, not a style opinion. Computing relative luminance of the composited result:
The reviewer was right. The previous hardcoded pair ( Worth stating plainly: this is not a regression introduced by this PR. The hovers here were already hardcoded hex; converting them to token-relative values was strictly an improvement. The PR surfaced a pre-existing gap in the token system. Follow-up filed#2673 — Add I did not file the optional Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: Zero code changes were made since the review — PR is ready for merge, pending the maintainer's decision. Per CLAUDE.md, merging is not automatic. |
Closes #2591.
DESIGN.mdrestrictsbox-shadowto floating surfaces (popovers, dropdowns) and states modals get no drop shadow — the backdrop provides the separation. Eight components carried hand-picked shadows in violation of that rule.What changed
Shadows removed from all 7 surviving components. No replacement shadow is added — per DESIGN.md the backdrop alone separates the panel.
Which rule applies to the toast and banner (the issue left this open): DESIGN.md's Toast section specifies z-index only, and the Do's/Don'ts say "Don't use box shadows outside of floating surfaces (popovers, dropdowns)." Toasts and banners are neither, so
conflict-toastandupdate-bannerget the same no-shadow treatment as the modal panels rather than a sanctioned toast shadow.Phantom CSS variables fixed. Underneath the shadows sat a larger defect: four of these components referenced a
--color-*vocabulary (--color-surface,--color-text-primary,--color-border,--color-accent, …) thatapp.cssdefines nowhere. Every reference silently resolved to its hardcoded fallback, and those fallbacks are dark-only values (#1e1e1esurface,#e0e0e0text) — so these components rendered dark chrome in light mode regardless of theme. A genuine theming bug masked by token-shaped syntax that did nothing.Each literal is mapped by semantic intent, not nearest hex match:
#c0392bdelete buttonhsl(var(--destructive))#2563eb/--color-accentaction buttonshsl(var(--primary))--color-warningtoast border/iconhsl(var(--warning))--color-surface/-raised/-2panelshsl(var(--popover))--color-text-secondary/-mutedhsl(var(--muted-foreground))border-radius: 8pxvar(--radius)--radiusis0.5rem= 8px — visually identicalEvery token used is verified defined in both
:rootand.dark.Deliberately out of scope
These remain in the design-token baseline:
rgba(0, 0, 0, 0.5)on 4 modals — the consistent app-wide convention across every modal in the app, and the issue explicitly scopes backdrop opacity out of this change.conflict-toast's@keyframes/ animation — a pre-existing DESIGN.md motion violation, unrelated to shadows or colors.Stale acceptance criteria
version-conflict-modal.svelte— named in the issue as the holder of the hardcoded Material palette (#d32f2f,#4caf50,#1976d2) — was deleted in #2602 as an orphaned component. None of those hex literals exist anywhere in the codebase today, so its two acceptance criteria are moot.Relationship to #2592
#2592 describes this same phantom-variable defect, but for
diagnostic-panel.svelteandinvitations-inbox.svelte. The file sets are disjoint — no overlap, no merge conflict.Verification
bun run test— 246 files / 5078 tests passing, identical to the pre-change baselinebun run quality:fix— cleangrepconfirms zerobox-shadow, zero--color-*, and zero hex literals remain across all 7 files🤖 Generated with Claude Code