fix(gui): keep brand colors on usage source icons in dark mode - #1253
Conversation
|
✅ Deterministic PR hygiene checks passed. |
📝 WalkthroughWalkthroughThe Usage page applies monochrome styling to the Grok icon. Dark-theme inversion now targets only monochrome marks. Tests validate provider assets, classes, and inversion behavior for explicit and system dark themes. ChangesUsage provider mark styling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gui/tests/usage-layout.test.ts`:
- Around line 158-160: Add assertions in the usage-source-mark CSS test to cover
the dark-mode `@media (prefers-color-scheme: dark)` path, verifying
`:root:not([data-theme="light"]) .usage-source-mark--mono` receives inversion
while the broader `.usage-source-mark` selector does not. Preserve the existing
explicit dark-theme assertions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f2cc0385-40e9-4bae-89a6-f8bc3360f6bc
📒 Files selected for processing (3)
gui/src/pages/Usage.tsxgui/src/styles.cssgui/tests/usage-layout.test.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b17fa1d415
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| > | ||
| {choice === "codex" && ( | ||
| <img className="usage-source-mark" src="/provider-icons/openai.svg" alt="" aria-hidden="true" /> | ||
| <img className="usage-source-mark usage-source-mark--mono" src="/provider-icons/openai.svg" alt="" aria-hidden="true" /> |
There was a problem hiding this comment.
Keep the colored OpenAI mark out of mono inversion
In dark mode, this modifier still applies filter: invert(1) to openai.svg, but that asset is not monochrome: gui/public/provider-icons/openai.svg explicitly uses the brand-green fill #10A37F (and was introduced specifically as the official green mark). The filter turns it into a pink inverse, so the change preserves the same brand-color corruption for the Codex filter that it fixes for Claude, while the new test incorrectly codifies the asset as monochrome. Remove the mono modifier from the OpenAI image and update the assertion, leaving it only on the actually black Grok mark.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
[GD] Addressed on head 17615935b.
Verified against the assets: gui/public/provider-icons/openai.svg uses brand-green #10A37F and claude-color.svg is brand-colored; only grok.svg is black/monochrome. Removed the usage-source-mark--mono modifier from the Codex/OpenAI mark in gui/src/pages/Usage.tsx so it keeps its brand green in dark mode, and updated the regression test to assert the OpenAI mark is not mono-inverted. The invert now applies only to the Grok mark.
The usage filter marks were all run through a dark-theme invert filter, which shifted the brand hue of the Claude and Codex/OpenAI marks. Scope the invert to the monochrome Grok mark only, and add a regression test covering both explicit dark-theme and OS prefers-color-scheme paths.
b17fa1d to
1761593
Compare
Summary
filter: invert(1)applied to every.usage-source-mark, which inverted the brand-colored Claude and Codex/OpenAI SVGs and shifted their brand hues (Claude orange → cyan, OpenAI green → pink).Validation
bun test tests/usage-layout.test.ts tests/usage-grok-filter.test.ts(gui) — 8 pass, 0 failbun run test(gui) — 677 pass, 0 failbun run typecheck— passbun run lint(gui) — passReview notes
usage-source-mark--monomodifier on the Grok mark only; Claude shipsclaude-color.svgand Codex/OpenAI ships the brand-greenopenai.svg, neither of which should be inverted.Fixes #1252
Summary by CodeRabbit
Bug Fixes
Tests