Skip to content

feat(web): customize diff colors and markers - #7347

Open
SunkenInTime wants to merge 13 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-diff-appearance-settings
Open

feat(web): customize diff colors and markers#7347
SunkenInTime wants to merge 13 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-diff-appearance-settings

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

<!--
Thank you for contributing to T3 Code! Please note that only maintainers have merge access. Your PR will be reviewed by the team.

Important: We generally do not accept PRs that add new features, new providers, or introduce significant architectural changes without prior discussion.
For those ideas, please open an issue or proposal first so we can align on scope and approach.
-->

What Changed

  • Added Typography settings for red/green or orange/blue diff colors and bar or classic +/- line indicators.
  • Applied the selected appearance to the main diff panel, pull request review diffs, and inline review comment diffs.
  • Persisted both choices in unified settings with backward-compatible defaults, reset behavior, settings search, and concise user documentation.

Why

Diff colors and line indicators were fixed in the renderer, so users could not choose a more distinguishable palette or familiar patch markers. These settings keep the existing red/green bars as the default while offering accessible orange/blue colors and classic markers everywhere web/desktop diffs render.

UI Changes

Before

Appearance settings before diff controls

After

Typography settings with diff color and marker controls

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes (not applicable; no motion or timing changes)

Verification:

  • vp run --filter @t3tools/web typecheck
  • git diff --check
  • Live web pass for both selectors and the shared diff preview

Generated with GPT-5.6-sol in the Codex harness.

Note

Add user-configurable diff color scheme and marker style to appearance settings

  • Adds two new ClientSettings fields: diffColorScheme ("red-green" | "orange-blue", default "red-green") and diffIndicatorStyle ("bars" | "classic", default "bars").
  • Adds a DiffAppearanceRows settings UI section with live preview in both advanced and simplified font settings panels.
  • Applies the selected color scheme globally via DiffAppearanceSync on document.documentElement using CSS custom properties --t3-diff-addition-color and --t3-diff-deletion-color.
  • Updates DIFF_SURFACE_THEME_UNSAFE_CSS and diff stat components (DiffStatLabel, PullRequestDiffStat) to derive colors from these custom properties.
  • Adds "Diff colors" and "Diff markers" entries to the settings search index.

Macroscope summarized b0c6753.


Note

Low Risk
Display-only client settings with backward-compatible defaults; no auth, data, or API contract changes beyond optional settings fields.

Overview
Users can pick diff colors (red/green vs orange/blue) and diff markers (bars vs classic +/) from Settings → Appearance. Both values live on ClientSettings with defaults red-green and bars, plus reset, search entries, and short user docs.

Rendering: getDiffColorSchemeClassName sets --t3-diff-addition-color / --t3-diff-deletion-color; DIFF_SURFACE_THEME_UNSAFE_CSS maps those into Pierre’s addition/deletion tints. StyledDiffCodeView and new StyledFileDiff read useClientSettings() for scheme class names and diffIndicators. DiffAppearanceSync applies the scheme classes on document.documentElement so stats outside shadow roots match. DiffStatLabel, PR diff stats, and timeline review diffs (now StyledFileDiff) use the same tokens.

Settings UX: DiffAppearanceRows hosts the two selects with DiffPreview (renamed from CodeFontPreview) that SSR-preloads a patch keyed by theme + indicator style; diff preview moved out of the monospace font row into dedicated diff appearance rows.

Reviewed by Cursor Bugbot for commit b0c6753. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e99f5cce-02a2-4c5d-9032-2b689592b24a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 17, 2026

@macroscopeapp macroscopeapp 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.

Two consistency findings on the new diff appearance settings. Everything else (palette class plumbing, StyledFileDiff extraction, settings routing/search wiring) looks consistent with the existing patterns.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/lib/diffRendering.ts
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated

@macroscopeapp macroscopeapp 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.

Two consistency findings in the new Appearance diff settings UI (apps/web/src/components/settings/SettingsPanels.tsx). Everything on the diff-rendering side (StyledDiffCodeView.tsx, diffRendering.ts) reads consistently: the palette is routed through --t3-diff-* with --success/--destructive fallbacks, so FilePreviewPanel's reuse of DIFF_SURFACE_THEME_UNSAFE_CSS is unaffected, and diffIndicators: "bars" keeps the existing [data-indicators="bars"] selected-line rules matching.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated

@macroscopeapp macroscopeapp 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.

Reviewed the diff-appearance settings UI and the shared diff surface wrapper. The palette plumbing (getDiffColorSchemeClassName--t3-diff-*--diffs-*-base/tint overrides) is now owned in one place and StyledFileDiff reuses it, which resolves the earlier duplication and base-color concerns. Two findings remain on the new Appearance tiles' Toggle class string.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 18, 2026 02:19
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 18, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces new user-facing settings for diff color schemes and indicator styles, constituting new capability rather than a minor adjustment. The review comments about UI consistency appear addressed in the final commit.

You can add or adjust custom eligibility rules. Learn more.

@macroscopeapp
macroscopeapp Bot dismissed their stale review August 18, 2026 04:07

Dismissing prior approval to re-evaluate af66c02

@macroscopeapp macroscopeapp 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.

Two new Appearance selects and the standalone diff preview don't follow the settings row conventions in this file. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 18, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 18, 2026 18:01

Dismissing prior approval to re-evaluate 13f3b9f

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated

@macroscopeapp macroscopeapp 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.

UI consistency review of the diff appearance settings. Three findings: a preview that no longer sits with the setting it demonstrates, diff-panel chrome that stays red/green when the orange/blue palette is selected, and the new StyledFileDiff wrapper landing without a focused test for its forwarding contract. The Select controls now match the shared settings-row pattern (w-full sm:w-40, SettingsRow children slot), so earlier findings on those look resolved.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/diffs/StyledDiffCodeView.test.tsx Outdated
Comment thread apps/web/src/lib/diffRendering.ts
Comment thread apps/web/src/components/settings/SettingsPanels.tsx

@macroscopeapp macroscopeapp 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.

One finding: the new diff palette stops at the diff surface, so the app-side +/- counts rendered directly above it keep the red/green colors. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/lib/diffRendering.ts

@macroscopeapp macroscopeapp 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.

One consistency gap in the new diff-palette contract, plus a small dead prop. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/pullRequest/pullRequestPresentation.tsx

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0c1e164. Configure here.

Comment thread apps/web/src/components/pullRequest/pullRequestPresentation.tsx
@SunkenInTime

Copy link
Copy Markdown
Contributor Author

@macroscope-app review

@macroscopeapp

macroscopeapp Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant