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 6 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)
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 |
|
Nice one! |
|
bump |
3cf4a31 to
25d9f15
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
noice |

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 toggle to the diff panel
diff-file-collapsedCSS class.Setof file keys via helpers in diffPanelCollapse.ts; selecting a file auto-expands it if collapsed and defers scroll until after expansion.data-diff-collapse-toggle).Macroscope summarized 6c91a7f.
Note
Low Risk
Primarily UI-state and styling changes localized to diff rendering; risk is limited to potential regressions in scrolling or header click handling.
Overview
Adds a per-file collapse/expand toggle in
DiffPanel, hiding a file’s diff body via a newdiff-file-collapsedCSS rule while keeping the header visible.Introduces
diffPanelCollapse.tshelpers to key files, toggle/reset collapse state, and auto-expand a deep-linkeddiffFilePath; selection scrolling is deferred until after any required expansion, and header click-to-open now ignores clicks on the collapse control. Includes unit tests for the collapse helpers.Written by Cursor Bugbot for commit 6c91a7f. This will update automatically on new commits. Configure here.