Summary
The Git Changes right-panel Monaco diff viewer should keep Monaco for performance, while supporting intentional gutter behavior in both unified and split view.
In unified view, the viewer should support two intentional gutter presentations:
compact: a tighter unified gutter with a single-column feel
classic: a wider unified gutter with Monaco's two visible number columns
Across unified and split view, gutter sizing should respond dynamically to the actual digit count of the line numbers shown, so the gutter does not waste space on small files and does not break when the line numbers grow to three or four digits.
Problem
The previous Git Changes implementations exposed two competing problems:
- The shared unified diff renderer looked closer to the desired compact gutter model, but it was too slow for large Git diffs.
- Monaco handled large diffs well, but its default unified gutter presentation was too rigid and visually awkward for the desired product behavior.
Specific issues observed during iteration:
- compact mode needed a tighter left inset for line numbers
- classic mode wasted space on the left side of the first visible number column
- static gutter widths did not adapt well to 3-digit and 4-digit line numbers
- classic mode initially forced both numeric columns to the same width even when only one side needed more room
- split view originally inherited static gutter assumptions and had the same overlap problem on the modified pane when digit counts grew
- split view original pane reserved an empty left glyph-margin lane that made the first visible number column float inward
- the compact/classic toggle initially used local state and reset to compact after reload
- the new toggle labels were initially hardcoded and not localized
Desired behavior
Compact mode
- Monaco unified diff stays on the compact inline-style presentation
- the gutter should feel like a single-column gutter
- line numbers should sit close to the left edge with a small, intentional inset
- the gutter width should still expand dynamically when larger digit counts require more space
Classic mode
- Monaco unified diff stays visibly wider than compact mode
- classic mode should preserve Monaco's wider unified presentation with two visible number columns
- the first and second visible number columns should size independently based on the maximum digit count needed on each side
- the operator lane should keep enough width and spacing so
+/- markers remain readable when digit counts increase
Shared requirements
- Monaco remains the active Git Changes viewer for performance
- gutter sizing must be dynamic rather than fixed
- split mode should follow the same no-wasted-space design philosophy as unified mode
- the selected compact/classic mode should persist across reloads
- user-visible labels for the toggle must be localized
Scope of the implemented redesign
The redesign branch implements the following:
- a Monaco-only compact mode for Git Changes unified diffs
- a Monaco classic mode that is wider than compact mode
- 4px left inset tuning for compact and classic number columns
- dynamic gutter sizing based on before/after line counts
- independent original/modified number-column sizing for classic mode
- dynamic split-view gutter sizing based on before/after line counts
- independently sized original/modified split-view number columns
- split-view original-pane inset cleanup by collapsing the empty original-side glyph-margin lane
- persistence of the compact/classic mode through the preferences store
- i18n-backed compact/classic labels and toggle titles
Why this matters
- keeps the fast Monaco path for large Git diffs
- gives Git Changes a tighter, more intentional Monaco gutter presentation in both unified and split view
- avoids broad DOM mutation hacks or slow renderer fallbacks
- preserves room for later productization of the compact/classic toggle if desired
Follow-up work
- evaluate whether the compact/classic toggle should move into a broader settings surface or remain local to Git Changes
- consider whether the same dynamic gutter sizing model should be shared more broadly with other diff surfaces
- continue validating edge cases with very large line numbers and long diffs in both unified and split mode
Summary
The Git Changes right-panel Monaco diff viewer should keep Monaco for performance, while supporting intentional gutter behavior in both unified and split view.
In unified view, the viewer should support two intentional gutter presentations:
compact: a tighter unified gutter with a single-column feelclassic: a wider unified gutter with Monaco's two visible number columnsAcross unified and split view, gutter sizing should respond dynamically to the actual digit count of the line numbers shown, so the gutter does not waste space on small files and does not break when the line numbers grow to three or four digits.
Problem
The previous Git Changes implementations exposed two competing problems:
Specific issues observed during iteration:
Desired behavior
Compact mode
Classic mode
+/-markers remain readable when digit counts increaseShared requirements
Scope of the implemented redesign
The redesign branch implements the following:
Why this matters
Follow-up work