Skip to content

fix(desktop): collapse full-context git diffs#29928

Open
dayhaysoos wants to merge 9 commits into
anomalyco:devfrom
dayhaysoos:fix/reduce-git-diff-lines
Open

fix(desktop): collapse full-context git diffs#29928
dayhaysoos wants to merge 9 commits into
anomalyco:devfrom
dayhaysoos:fix/reduce-git-diff-lines

Conversation

@dayhaysoos
Copy link
Copy Markdown

Issue for this PR

Fixes #29768 #21068

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Desktop Git Changes receives generated patches with full-file context, so the diff view was rendering entire files instead of only changed regions.

This detects full-context generated patches, reconstructs the before/after file contents from the patch, and passes those contents through the existing diff renderer. That lets unchanged regions collapse again. Partial patches still use the existing patch parsing path so normal hunk boundaries are preserved.

Partial patches still use the existing patch parsing path.

How did you verify your code works?

  • Added regression tests for full-context generated patches.
  • Added coverage for changes near both file edges.
  • Verified standard partial patches still stay partial.
  • bun --cwd packages/ui test src/components/session-diff.test.ts
  • bun --cwd packages/ui typecheck
  • bun typecheck
  • git diff --check
  • Manually verified in Desktop Git Changes that unchanged file regions collapse instead of showing the whole file.

Screenshots / recordings

Recording:

open-code-pr-1.mp4

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(app): desktop Git Changes sidebar shows entire file instead of changed lines

1 participant