Skip to content

Review panel should support partial staging and diff against staged content #10482

@ifours

Description

@ifours

Summary

Add VS Code-style staging to Warp's review panel so users can stage individual lines or hunks, clearly distinguish staged versus unstaged changes, and review later agent edits against the staged baseline instead of always against HEAD.

Problem

The current review workflow does not let users approve only part of an agent's work at line or hunk granularity. That makes it hard to accept the good parts, keep the rest unstaged, and ask the agent to revise only the unapproved portions.

A related problem shows up after partial approval: if a file already has staged changes and the agent edits it again, the review panel should show only the new diff relative to what is already staged, not the full diff relative to HEAD. Without that, it is difficult to tell what changed since the user last approved part of the file.

Reproduction steps or desired workflow

  1. Ask the agent to make changes across one or more files.
  2. Open the review panel and inspect the diff.
  3. Stage only the approved lines or hunks, leaving the rest unstaged.
  4. Ask the agent to revise the remaining unstaged portions.
  5. If the agent edits a file that already has staged changes, reopen the review panel.
  6. The review panel should clearly separate staged versus unstaged content and show only the newly introduced diff against the staged state for that file.

Artifacts

None attached.

Warp version

Unknown

Operating system

macOS

Possible source references

  • app/src/code_review/mod.rs: code review panel surface that appears related to review-panel behavior.
  • app/src/code_review/diff_state/local.rs: local diff-state handling that seems relevant to HEAD/worktree/index comparisons.
  • app/src/util/git.rs: Git helper layer that may be relevant for index-aware staging and staged-vs-unstaged diff computation.
  • app/src/workspace/view/right_panel.rs: right-panel integration point that may be involved in presenting review state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:code-reviewGit diff views, review UI, review comments, and PR-focused agent flows.duplicateThis issue or pull request already exists.enhancementNew feature or request.os:macmacOS-specific behavior, regressions, or requests.repro:highThe report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions