Skip to content

style(diff): saturated add/remove tints for chat and Monaco diffs - #34698

Closed
purian23 wants to merge 2 commits into
stablyai:mainfrom
purian23:style/sharper-diff-colors
Closed

purian23 wants to merge 2 commits into
stablyai:mainfrom
purian23:style/sharper-diff-colors

Conversation

@purian23

@purian23 purian23 commented Oct 28, 2026 •

Copy link
Copy Markdown

ELI5

Added and removed lines in diffs now use clear green and red instead of pale olive or lime, so changes are easier to spot.

What Changed

  • New --diff-added / --diff-removed hue tokens (light and dark) in main.css, with -ground, -gutter and -emphasis tints derived from them. Chat diff cards already read --diff-*-ground/-gutter; they now come from these hues instead of --git-decoration-*.
  • The Monaco diff editor's --vscode-diffEditor* line, text and gutter variables now come from the same tokens, following the existing --vscode-* override pattern. div.monaco-diff-editor outranks Monaco's injected theme rule.
  • --chat-diff-added/-removed text now mixes 60% of the diff hue (was 70% of the git-decoration hue), keeping text-on-row contrast ≥ 5.1:1 in both schemes. At 70%, light-mode added text dropped to 4.08:1.
  • --git-decoration-* is unchanged, so the file tree and source-control status colors are unaffected. docs/styleguide/color.md documents the new tokens.

Why

The muted decoration hues wash out once tinted onto a row background. A separate diff hue keeps git status colors conventional while making diff hunks readable. The CSS-variable approach covers every Monaco diff editor without registering custom Monaco themes.

Known limitation: Monaco paints the overview-ruler change markers on a canvas from its theme service, so those keep Monaco's defaults.

Linked Issue

Fixes #34696

Visual Proof

Source-control diff, dark theme. (The after shot was taken with the QML highlighting PR also applied; this PR changes only the add/remove tints.)

Before After
screenshot_2026-10-27_23-04-49 screenshot_2026-10-27_23-05-17

Testing

  • I manually tested these changes locally (Linux, dark theme): source-control diff view and chat edit cards.
  • Automated tests added/updated, or explained why not below: CSS token change only, verified visually; contrast checked numerically for both schemes.
  • pnpm check:changed passes (24 checks).

AI Disclosure

Implemented with Claude Opus 5.5 (Claude Code); reviewed and tested by me.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

🤖 Generated with Claude Code

@purian23
purian23 marked this pull request as ready for review October 28, 2026 03:20
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b7fd26c-1d4c-4def-978d-9172a19d1e63
Commits

Reviewing files that changed from the base of the PR and between be2be30 and 882f545.

Files selected for processing: 1
  • docs/styleguide/color.md
Files skipped from review as they are similar to previous changes: 1
  • docs/styleguide/color.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The light and dark themes now define dedicated added and removed diff colors with ground, gutter, and emphasis variants. Chat diffs and Monaco’s diff editor use these tokens for added and removed content. The style guide distinguishes diff colors from Git decoration colors.

Priority: Low

Merge Risk: Minimal · up to 882f5

The style guide now distinguishes chat diff text colors from diff background tints. No actionable merge risk remains from the supplied evidence.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding saturated add/remove tints for chat and Monaco diffs.
Description check Passed The description includes the required sections, linked issue, visual proof, testing details, AI disclosure, scope explanation, and completed checklist items. It clearly explains the user-facing change…
Linked Issues check Passed Issue #34696 requires sharper default add/remove colors for chat diff rows and Monaco diff line, gutter, and changed-word tints. The reviewed changes add light and dark --diff-added and `--diff-remo…
Out of Scope Changes check Passed The changes are limited to diff color variables in src/renderer/src/assets/main.css and documentation in docs/styleguide/color.md. The CSS changes implement issue #34696. The documentation explain…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Description check

Explanation

The description includes the required sections, linked issue, visual proof, testing details, AI disclosure, scope explanation, and completed checklist items. It clearly explains the user-facing change, implementation, and rationale.

Full details: Linked Issues check

Explanation

Issue #34696 requires sharper default add/remove colors for chat diff rows and Monaco diff line, gutter, and changed-word tints. The reviewed changes add light and dark --diff-added and --diff-removed tokens with -ground, -gutter, and -emphasis variants. Chat diff text and Monaco diff line, text, and gutter variables use these tokens. The changes leave --git-decoration-* colors for file-status UI. Issue #10642 is related context and adds no requirement here.

Full details: Out of Scope Changes check

Explanation

The changes are limited to diff color variables in src/renderer/src/assets/main.css and documentation in docs/styleguide/color.md. The CSS changes implement issue #34696. The documentation explains the new token separation. No unrelated feature or user-configurable color work is present in the reviewed summary.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2bd309fd-993d-4853-8b67-45953cd31ad0
Commits

Reviewing files that changed from the base of the PR and between 68f0c79 and be2be30.

Files selected for processing: 2
  • docs/styleguide/color.md
  • src/renderer/src/assets/main.css

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment thread docs/styleguide/color.md Outdated
Comment on lines +35 to +36
Diff hunks (added/removed line, word and gutter tints in chat diffs and Monaco's diff editor) use `--diff-added` / `--diff-removed` and their `-ground`, `-gutter` and `-emphasis` tints instead: the muted decoration hues wash out once tinted onto a row.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Maintainability & Code Quality · Quick win

Document the chat-specific diff text tokens.

main.css derives --chat-diff-added and --chat-diff-removed for chat text, while Monaco uses the raw diff ground, gutter, and emphasis tokens. (raw.githubusercontent.com)

Update this sentence to name --chat-diff-added and --chat-diff-removed for chat text. Keep --diff-* and its variants for Monaco backgrounds and gutters. Otherwise, a future chat style can bypass the contrast-safe mix.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge; no actionable issues were found.

Summary

This PR gives chat and Monaco diffs shared green and red colors while leaving Git status colors unchanged.

  • Added and removed lines stand out with clearer tints in chat and Monaco diffs.

Reviews (1) · Last reviewed commit: "docs(styleguide): name the chat diff tex..." · Reviewed by Greptile

nwparker added a commit that referenced this pull request Oct 31, 2026
…ws, links

Adds 29 public app theme tokens (diff, git decorations, tab bar, split
divider, current workspace row, host badge, chat bubble, text link), each
falling back to today's built-in color or CSS chain so existing themes and
built-ins render the same. Monaco's diff editor now paints from the diff
tokens, with sharper default diff tints (from #34698) and a readable dark
ignored-file color. The contrast gate learns one-sided drops, translucent
surfaces checked over their base, and main.css chains for half-set pairs.

Co-Authored-By: Claude <[email protected]>
nwparker added a commit that referenced this pull request Oct 31, 2026
…ws, links

Adds 29 public app theme tokens (diff, git decorations, tab bar, split
divider, current workspace row, host badge, chat bubble, text link), each
falling back to today's built-in color or CSS chain so existing themes and
built-ins render the same. Monaco's diff editor now paints from the diff
tokens, with sharper default diff tints (from #34698) and a readable dark
ignored-file color. The contrast gate learns one-sided drops, translucent
surfaces checked over their base, and main.css chains for half-set pairs.

Co-Authored-By: Claude <[email protected]>
nwparker added a commit that referenced this pull request Nov 1, 2026
…ws, links

Adds 29 public app theme tokens (diff, git decorations, tab bar, split
divider, current workspace row, host badge, chat bubble, text link), each
falling back to today's built-in color or CSS chain so existing themes and
built-ins render the same. Monaco's diff editor now paints from the diff
tokens, with sharper default diff tints (from #34698) and a readable dark
ignored-file color. The contrast gate learns one-sided drops, translucent
surfaces checked over their base, and main.css chains for half-set pairs.

Co-Authored-By: Claude <[email protected]>
nwparker added a commit that referenced this pull request Nov 1, 2026
…ws, links (#36578)

* feat(themes): public tokens for diffs, git status, tabs, dividers, rows, links

Adds 29 public app theme tokens (diff, git decorations, tab bar, split
divider, current workspace row, host badge, chat bubble, text link), each
falling back to today's built-in color or CSS chain so existing themes and
built-ins render the same. Monaco's diff editor now paints from the diff
tokens, with sharper default diff tints (from #34698) and a readable dark
ignored-file color. The contrast gate learns one-sided drops, translucent
surfaces checked over their base, and main.css chains for half-set pairs.

Co-Authored-By: Claude <[email protected]>

* fix(themes): check omitted diff tints, chat bubbles and dark host badges as painted

The contrast gate now derives an omitted diff tint from the theme's hue (and
drops the hue when its tint hides code), checks chat bubbles against chat's
mixed foreground on the chat canvas, and models the dark host badge at 80%
accent. The main.css fallback table moves to plugin-theme-css-fallbacks.ts.

Co-Authored-By: Claude <[email protected]>

* fix(themes): blame a diff hue only for tints it painted, and check chat diff rows

A diff tint the theme set itself no longer drops the theme's hue when it
fails, and chat diff rows (hue-mixed text on the line tint over the chat
canvas) are now checked too.

Co-Authored-By: Claude <[email protected]>

* fix(themes): new theme tokens only expose colors; unthemed surfaces paint exactly as before

Every new token now falls back to the exact value its surface used before:
- Diff hues default to the git decoration colors at the previous per-side
  percentages, and chat diff text keeps its 70% mix.
- Monaco's diff view, overview ruler and links keep Monaco's stock colors
  unless the theme painted a diff or link token. The colors go through the
  derived Monaco theme instead of a global CSS override.
- --text-link has no :root default; each link rule keeps its old literal as
  the fallback, including the markdown-light/-dark preview split and the
  always-#58a6ff Monaco doc link.
- Tab bar, tab text and indicator fall back per element (bg-card,
  text-foreground, ...) instead of through :root aliases.
- Dark --git-decoration-ignored goes back to #6e6e6e (#35910 ships separately).

The contrast gate skips checks that have no theme token to drop, so themes
that set only older tokens pay no extra probes.

* perf(themes): contrast check skips ring checks the theme didn't set and precomputes drop lists

---------

Co-authored-by: Claude <[email protected]>
@nwparker

Copy link
Copy Markdown
Contributor

Thanks for this! The change already landed on main in daa11df, so I'm closing this PR. We appreciate the contribution.

@nwparker nwparker closed this Nov 16, 2026
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.

[Feature]: Sharper default diff add/remove colors

2 participants