feat(diff-panel): add per-file collapse toggle in diff panel#1125
feat(diff-panel): add per-file collapse toggle in diff panel#1125huxcrux wants to merge 3 commits intopingdotgg:mainfrom
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 Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip You can enable review details to help with troubleshooting, context usage and more.Enable the |
|
Nice one! |
What Changed
Adds a per-file collapse toggle in the diff panel. Each file still starts expanded by default, but users can now collapse an individual file body from the existing diff header and expand it again inline.
The change keeps the current diff rendering flow intact, preserves click-to-open behavior for file headers, and auto-expands a targeted file when the UI deep-links to a specific diff file in the diff panel.
Fixes: #1122
Why
Large diffs in the diff panel are harder to scan when every file stays open at once. This adds a minimal control to reduce visual noise without introducing a broader diff panel redesign or changing the existing diff data flow.
UI Changes
Before:

After:


Checklist
Note
Add per-file collapse/expand toggle to the diff panel
Setof file keys.diff-file-collapsedCSS rule (display: none on<pre>and virtualizer buffer).toggleCollapsedDiffFile,resetCollapsedDiffFiles,expandCollapsedDiffFileForPath,buildFileDiffRenderKey,resolveFileDiffPath) into diffPanelCollapse.ts with full Vitest coverage.Macroscope summarized 523a0b1.