warp icon indicating copy to clipboard operation
warp copied to clipboard

Code Review: Add Collapse All / Expand All for file diffs

Open lucachitayat opened this issue 7 months ago • 3 comments

Pre-submit Checks

Describe the solution you'd like?

Add Collapse All and Expand All buttons (or a toggle) to the Code Review diff panel. These would collapse or expand every file diff in the current view with a single click.

Ideally placed near the top of the diff panel alongside the existing file list controls — similar to how VS Code's Source Control and GitHub's PR diff view provide collapse/expand all affordances.

Is your feature request related to a problem? Please describe.

When reviewing branches with many changed files — especially when using worktrees — navigating to a specific file's diff requires manually scrolling past or clicking through every expanded file. Even with just 7–10 changed files and 500–1,000 lines of changes, the diff panel becomes difficult to navigate. There is no way to collapse all diffs at once, get a quick overview of what changed, and then selectively expand only the files you care about.

The problem compounds when switching between worktrees frequently, since you're re-orienting yourself across multiple branches throughout the day.

Additional context

  • This would pair well with the existing filename filter (#8632) and the requested tree view (#8821).
  • Common in other tools: VS Code, GitHub PR view, JetBrains — all offer collapse/expand all for file diffs.
  • Keyboard shortcut support (e.g. Cmd+Shift+[ / Cmd+Shift+]) would be a nice bonus.

Operating system (OS)

macOS

How important is this feature to you?

4 (Important)

lucachitayat avatar Apr 20 '26 06:04 lucachitayat

Picking it up — implementing Collapse All / Expand All in the existing header overflow menu. Will open a PR shortly.

aqeelat avatar Jun 07 '26 09:06 aqeelat

Hi @harryalbert can you please review this? I worked on the fix without knowing I had to wait for the ready to implement label.

aqeelat avatar Jun 07 '26 10:06 aqeelat

@aqeelat Because this issue is marked as needing mocs, I'm going to hold off on reviewing any code. I'll flag to the team that there's interest in this issue so that a designer can TAL

harryalbert avatar Jun 08 '26 17:06 harryalbert