Skip to content

fix: raise Agent mark contrast on the environment overview - #42

Merged
yujiezhang-ops merged 1 commit into
mainfrom
fix/overview-agent-mark-contrast
Aug 5, 2026
Merged

fix: raise Agent mark contrast on the environment overview#42
yujiezhang-ops merged 1 commit into
mainfrom
fix/overview-agent-mark-contrast

Conversation

@yujiezhang-ops

Copy link
Copy Markdown
Collaborator

Summary

The environment overview drew each Agent mark as a blue glyph on a blue tinted chip. --agent-accent is a single var(--blue) for every row (app.css:1057) rather than a per-Agent brand colour, so the tint carried no information and put the glyph at 3.75:1 on light and 3.82:1 on dark — above the 3:1 graphics threshold, with no margin.

The mark now sits on a transparent box and carries the contrast itself: full black on light, full white on dark, 19.63:1 and 13.94:1 against the card.

--icon-fg would not have worked here. Its #3a3a3c / #d1d1d6 were mixed to sit inside a tinted chip; with nothing behind the glyph the mark needs the full range, so this adds --agent-mark-fg.

Scope is the two overview rules only. The shared .agent-icon base rule keeps its chip, which is what the onboarding Agent list uses.

Notes for the reviewer

The borders are set to transparent, not removed. .agent-icon sizes its 34px box as border-box, so dropping the border hands those 2px to the glyph and silently enlarges the mark.

--agent-mark-fg is added in three places. tokens.css declares the dark palette twice — once for @media (prefers-color-scheme: dark), once for .theme-dark — and a token missing from one copy falls back to the light value when a theme is forced.

No compliance question. All five licensed assets are single-colour glyphs painted with fill="currentColor" and carry no brand colour, so inheriting the page colour is their published behaviour rather than a restyling of vendor artwork. The viewBox assertion in icons/agents.test.tsx still guards the published geometry.

Tests

frontend/src/styles/agent-mark.test.ts locks the three load-bearing facts, none of which had a gate:

  1. both card types keep a transparent box at 34px
  2. the token resolves black on light and white on dark, in both dark declarations
  3. the shared .agent-icon base rule keeps its chip

The assertions read the stylesheets as text: jsdom does not resolve var(), so getComputedStyle cannot see any of this. Each was mutation-tested by reinjecting the prior state — reverting .desktop-app-icon to the tinted chip, deleting the .theme-dark copy of the token, and flattening the base rule instead — and each fails on the matching regression.

Verification

  • go vet ./... clean
  • 24 frontend test files / 162 tests pass
  • tsc --noEmit clean
  • vite build clean, one asset pair
  • Measured in the browser against the real stylesheets in both themes: box background and border resolve to rgba(0, 0, 0, 0), glyph to rgb(0, 0, 0) / rgb(255, 255, 255), box stays 34×34. The onboarding .agent-icon still measures 38×38 with its border and --icon-fg.

🤖 Generated with Claude Code

The overview drew each Agent mark as a blue glyph on a blue tinted chip,
because --agent-accent is a single var(--blue) for every row rather than a
per-Agent brand colour. That left the marks at 3.75:1 on light and 3.82:1 on
dark -- above the 3:1 graphics threshold, with no margin.

Drop the chip: the box is transparent and the glyph carries the contrast on its
own, in full black on light and full white on dark. --icon-fg would not do, as
its #3a3a3c / #d1d1d6 were mixed to sit inside a tinted chip; the new
--agent-mark-fg is 19.63:1 and 13.94:1 against the card.

The borders are set to transparent rather than removed. .agent-icon sizes its
34px box as border-box, so dropping the border would hand those 2px to the glyph
and enlarge the mark.

No compliance question here: all five licensed assets are single-colour glyphs
painted with fill="currentColor" and carry no brand colour, so inheriting the
page colour is their published behaviour, not a restyling of vendor artwork.

styles/agent-mark.test.ts locks the three things that are load-bearing and
otherwise unguarded: both card types keep a transparent box at 34px, the token
is overridden in *both* dark declarations (tokens.css declares the dark palette
twice, and missing one would fall back to black when a theme is forced), and the
shared .agent-icon base rule keeps its chip for the onboarding list. The
assertions read the stylesheets as text because jsdom does not resolve var().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yujiezhang-ops
yujiezhang-ops merged commit 86e6fdc into main Aug 5, 2026
4 checks passed
@yujiezhang-ops
yujiezhang-ops deleted the fix/overview-agent-mark-contrast branch August 7, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant