feat(web): customize diff colors and markers - #7347
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
ApprovabilityVerdict: Approved ecd0ba5 This PR adds two cosmetic settings for customizing diff appearance (color scheme and marker style). Changes are purely visual, self-contained to client-side settings with no impact on core functionality, security, or data schemas. Tests and documentation included. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate af66c02
There was a problem hiding this comment.
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
What Changed
+/-line indicators.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
After
Checklist
Verification:
vp run --filter @t3tools/web typecheckgit diff --checkGenerated with GPT-5.6-sol in the Codex harness.
Note
Add diff color scheme and marker style settings to the Appearance panel
diffColorScheme(red-green|orange-blue) anddiffIndicatorStyle(bars|classic) toClientSettingsSchemawith defaults, and exposes controls for both in the Appearance settings panel.getDiffColorSchemeClassNameindiffRendering.tsto map a scheme to CSS variable classes (--t3-diff-addition-color,--t3-diff-deletion-color);DIFF_SURFACE_THEME_UNSAFE_CSSwires these into the diff renderer's themed color variables.StyledFileDiffwrapper alongside the existingStyledDiffCodeViewso both code and file diff surfaces respect user-configured color scheme and indicator style.Macroscope summarized ecd0ba5.
Note
Low Risk
Display-only preferences with schema defaults and no auth or data-path changes; risk is limited to inconsistent diff styling if the CSS bridge is wrong.
Overview
Adds Appearance controls for diff colors (red/green vs orange/blue) and diff markers (bars vs classic
+/−), persisted in unified client settings with defaultsred-greenandbars.StyledDiffCodeViewand a newStyledFileDiffwrapper read those settings and apply a color-scheme class plus Pierre’sdiffIndicatorsoption, so the main diff panel, PR review views, and inline timeline diffs stay in sync. Diff surface CSS now routes addition/deletion tints through--t3-diff-*overrides instead of hard-coded success/destructive tokens.Settings search, restore-defaults, and a live
DiffPreviewunder the marker row reflect the active choices; user docs cover the feature.Reviewed by Cursor Bugbot for commit ecd0ba5. Bugbot is set up for automated code reviews on this repo. Configure here.