Repository navigation
fix(accent): make the selected-row fill and sidebar grabber follow the accent - #185
Conversation
…e accent
The Settings sidebar drew its selected row with `Theme.accent` for the
border but `Theme.selection` for the fill, and `Theme.selection` was
declared with the teal hexes inlined:
static let selection = dyn(hex(0x087370)..., hex(0x4FD1C5)...)
Those are literally `AccentChoice.teal`'s own values, so the fill never
moved off teal. Pick Violet or Orange and you got a violet border around
a teal wash. It was the last token in `Theme` still pinned to teal —
`accentColor`, `barRemaining` and the rest all read
`AccentChoice.current`. The same fill backs the Glance header's From Mac
/ From Fleet toggle, whose selected segment was labelling itself in the
accent while filling teal.
`selection` is now a computed `static var` derived from the current
accent, keeping the same 0.12 light / 0.18 dark alphas so the fill holds
its contrast against the surface.
Also fixed the same class of bug next door: the sidebar resize grabber
hovered in `Color.accentColor`, which is the macOS *system* accent rather
than the one the owner picked, so it glowed system blue regardless. It
now uses `Theme.accent` like everything around it.
Verified: 366 tests pass, 3 skipped, 0 failures. The new
`testSelectionFollowsTheChosenAccentInBothAppearances` was checked
against the old hardcoded token and fails on every non-teal accent
(teal 0.031/0.451/0.439 where blue 0.122/0.373/0.749 was expected), so it
genuinely pins the behaviour rather than passing by construction.
Touches two files only, and deliberately not GlanceViews.swift — which
is contended by open PRs #163 and #175 — because fixing the one token
corrects both of its call sites.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
The PR body is an agent-written paragraph and the rule explicitly names PR titles/bodies as in scope; GitHub-flavored markdown collapses two literal spaces, so in a chat-rendered PR description the period+ Kody rule violation: Use two spaces between sentences in every human-facing string and agent-written paragraph |
What was wrong
The Settings/Console sidebar drew a selected row with the accent for its border but a different token for its fill — and that token was hardcoded to teal:
Those are literally
AccentChoice.teal's own values. It was the last token inThemestill pinned to teal —accentColor,barRemaining,warningand the rest all readAccentChoice.current. So the moment you picked Violet or Orange you got a violet border sitting on a teal wash.The same fill backs the Glance header's From Mac / From Fleet toggle, which was labelling its selected segment in the accent colour while filling it teal.
Found alongside it: the sidebar resize grabber hovered in
Color.accentColor— the macOS system accent, not the one you picked — so it glowed system blue no matter what you chose.The fix
selectionis now a computedstatic varderived from the current accent, exactly the wayTheme.accentandTheme.barRemainingalready work. Same 0.12 light / 0.18 dark alphas, so the fill keeps the contrast it had against the surface. The grabber usesTheme.accent.Why only two files
Deliberately not
GlanceViews.swift— it's contended by open PRs #163 and #175. Fixing the one token corrects both of its call sites without editing a contested file.ConsoleViews.swiftis not touched by either open PR.Verification
testSelectionFollowsTheChosenAccentInBothAppearanceswas checked against the old hardcoded token and fails on every non-teal accent — it read teal0.031/0.451/0.439where blue0.122/0.373/0.749was expected. So it genuinely pins the behaviour rather than passing by construction.Note
This does not add new accent colours — the picker still offers the existing seven. Worth flagging separately: the palette is semantically crowded already (red is
danger, amber iswarning, teal/green backbarRemaining), so adding hues blindly risks collisions between "this is a warning" and "this is a preference". I'd rather extend the palette deliberately than pad it with swatches that blur those meanings.