Add PR diff panel and side-by-side diff viewer#11
Merged
bluestreak01 merged 1 commit intomasterfrom Apr 4, 2026
Merged
Conversation
Adds two major features for PR code review: **PR Diff Panel (Ctrl+D)** - Tree view of files changed in the current PR - Grouped by directory with expand/collapse - File status indicators (Added/Modified/Deleted/Renamed) - Quick search: type to filter, Up/Down to cycle matches - Persisted across sessions **Side-by-Side Diff Viewer** - Full-file diff with base branch (via git merge-base) - Syntax highlighting on both panels - Text selection (Shift+arrows) and clipboard copy (Ctrl+C) - Search with match highlighting (Ctrl+F, n/N) - Hunk navigation (Alt+Up/Down) skips to next/prev diff hunk - Terminal caret on either panel, Tab to switch sides - F4 toggles to editor at current line (Esc returns) - Viewport position preserved across editor/viewer transitions **Architecture improvements** - Replaced 5 separate focus fields with single PanelFocus enum - Extracted focused_side() helper for bottom panel resize logic - Bottom panel key/action intercepts guarded by mode check - 346 tests (33 new covering tree building, diff parsing, navigation, selection, search, and rendering helpers) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
*_focusedfields with a single enum, eliminating a class of focus-state bugsNew files
src/pr_diff.rs— PR diff panel state, git integration, tree buildingsrc/diff_viewer.rs— Side-by-side diff viewer state, unified diff parsing, selection, searchsrc/ui/diff_view.rs— PR diff panel renderer (tree with status icons)src/ui/diff_viewer_view.rs— Side-by-side diff renderer (syntax colors, selection highlight, search matches, caret)Diff viewer
PR Changelist
Test plan
cargo clippy -- -D warningspassescargo fmt -- --checkpassescargo test— 346 tests pass (33 new tests covering tree building, diff parsing, navigation, selection, search, and rendering helpers)🤖 Generated with Claude Code