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 5 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.

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 4948c41.
Note
Low Risk
Low risk UI-only change that adds per-file collapsed state and some scroll/selection side effects; potential issues are limited to diff panel interaction quirks (collapse/expand, auto-scroll) rather than data or security.
Overview
Adds a per-file collapse/expand control to the diff panel by injecting a chevron button into each
FileDiffheader and hiding the file body when collapsed via a newdiff-file-collapsedCSS rule.Introduces
diffPanelCollapsehelpers (with tests) to compute stable file keys, toggle/reset collapsed state, and auto-expand a deep-linkeddiffFilePath; the panel resets collapse state when the selected patch changes and avoids opening files-in-editor when the collapse button is clicked.Written by Cursor Bugbot for commit 4948c41. This will update automatically on new commits. Configure here.