You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Diff panel: per-thread state, full-width toggle, and per-file collapse
Move diff-panel UI state from URL search params and component-local
useState into the Zustand UI store. State that is meaningful per
thread is keyed by scopedThreadKey so two threads can have different
diff panels open / expanded / collapsed independently. Wider state
(render mode, line wrap) lives in the store globally so it survives
the remount that expand/collapse causes.
Per-thread (persisted to localStorage):
- diff panel open/closed (replaces ?diff=1 in URL)
- full-width vs split-pane (new toolbar toggle)
- per-file collapse (new chevron on each file header)
Global session (in store, not persisted to disk):
- render mode (split/stacked)
- line wrap, hydrated once from settings.diffWordWrap
The per-file collapse swaps the FileDiff out for a small
CollapsedFileHeader rather than hiding content via CSS — the
library's Virtualizer reserves vertical space from hunk metadata, so
a CSS hide leaves a tall empty box and triggers ResizeObserver
thrashing during scroll. The collapsed header inlines the same
change-type SVG paths the library renders inside its shadow DOM so
the new/modified/deleted/renamed icon is identical between collapsed
and expanded views.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments