Repository navigation
feat(native-chat): let users pick chat text and message bubble colors per theme - #25921
pawel-kotowski wants to merge 3 commits into
Conversation
Adds Text color (light theme) and Text color (dark theme) to the Chat settings page. Each overrides the chat's body and strong text (messages, headings, links and the message box) in that theme only; empty keeps the theme color. Faint text, code and tool output keep their theme colors. The colors are stored as typed so a half-entered hex survives, and only a valid hex is applied. The chat root publishes --chat-text-color-light/-dark; its children pick the one for the current theme and fall back to the theme value the root captures, so no theme default is duplicated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change adds per-theme chat text and bubble colors. A user who deliberately picks identical colors can make their own messages unreadable, but they can fix it by editing the field or resetting. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1
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 |
…quotes Inline code and plain code blocks read --chat-code-foreground and quotes use the shared renderer's muted color, so they kept the theme color after a custom text color was set. Code now takes the custom color and quotes a 70% version of it; without a custom color both keep their theme colors. Syntax-highlighted code keeps its highlighter theme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds Your message bubble (light theme) and (dark theme) to the Chat settings page, applied through --chat-user-surface with the same per-theme fallback as the text color. The four chat color settings now share one key list for normalizing, resolving, resetting and rendering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0328196 to
767b236
Compare
ELI5
Chat text and your message bubbles have fixed colors. This adds color pickers to the Chat settings page, for the light and the dark theme, so you can choose the color your chat messages are written in and the background of your own messages.
What Changed
nativeChatAppearanceastextColorLight/textColorDark/userBubbleColorLight/userBubbleColorDark, one shared key list for normalizing, resolving, resetting and rendering. The chat root publishes them as--chat-text-color-*/--chat-user-bubble-*. Innative-chat-appearance.css, the root also captures the theme's own--chat-foreground,--chat-foreground-strong,--chat-code-foregroundand--chat-user-surface, and its children set those tokens to the custom color for the current theme (.darkor not), or fall back to the captured theme value. Markdown quotes get their color from--chat-quote-foreground, which is only valid when a custom color is set; otherwiserevert-layerkeeps the shared renderer's muted quote color.#abcor#aabbcc,#optional, the same rule as terminal colors) is applied.nativeChatAppearanceStyle, so no component changed. The settings search finds both fields (also under "font color").Why
People who read long agent sessions in chat asked for appearance control over it (#20392). Text color is the smallest piece of that, and a single color can't suit both themes, so there is one per theme.
Overriding the tokens on the root's children rather than the root itself avoids repeating the theme defaults: a custom property can't fall back to its own inherited value, but a child can fall back to a value the root captured. It also composes with the contrast work in #25659, which adjusts the same tokens: a custom color wins, and the theme value (with any contrast applied) is the fallback.
Linked Issue
Part of #20392 (Chat UI appearance settings)
Visual Proof
Before: the Chat page has text size, code size and width only. After: text color and message bubble fields per theme (dark text
#e8c48aand dark bubble#2a3442set; light fields empty, showing their theme colors as placeholders).A screenshot of a live chat with a custom color will follow.
Testing
native-chat-appearance-settings.test.ts: typed colors are kept, empty ones dropped, only valid hex resolves, and Reset clears the colors but keeps fields from newer versions.native-chat-appearance-style.test.ts: a color is published only for the theme that has a valid one.In Electron (Playwright, headless, macOS), on chat markdown laid out like the renderer's output: with a custom color, paragraphs, bold, links, inline code and code blocks compute to it in each theme and quotes to 70% of it. With no color, or only the other theme's color, every element computes exactly to its previous theme color (quotes stay
#a1a1a1dark /#737373light). The bubble background takes the custom color per theme and otherwise stays at the theme default.pnpm tc, the changed-code quality gate, the localization catalog checks, and the native-chat and settings suites pass.I manually tested these changes locally
Automated tests added/updated
AI Disclosure
Implemented with Claude Code (Claude Opus 5.5), reviewed by the author.
Review
Agent skill upstream boundary
Notes
nativeChatAppearance, absent by default; unknown fields from newer versions are still preserved.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (typecheck, changed-file lint and affected suites pass locally; the rest is left to CI)🤖 Generated with Claude Code