fix(app): load capped review patches#35633
Open
Hona wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the session review panel’s handling of large/capped VCS diffs by detecting selected files whose per-file patch content was omitted (due to the aggregate diff cap) and lazily reloading a complete patch via the existing directory-scoped VCS diff API, without requiring core/SDK changes.
Changes:
- Add a “needs load” heuristic for review diffs and directory scoping helpers for targeted VCS diff reloads.
- Introduce lazy detail-diff loading in the review panel keyed by a diff “version” to safely refresh/validate patches.
- Extend unit/E2E coverage to exercise capped/omitted patch reload and refresh behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/app/src/pages/session/v2/review-panel-v2.tsx | Adds lazy loading for the active diff when its patch is missing/omitted, with version-aware caching. |
| packages/app/src/pages/session/v2/review-diff-kinds.ts | Adds helpers to detect omitted patches and compute directory scopes for diff reload requests. |
| packages/app/src/pages/session/v2/review-diff-kinds.test.ts | Adds unit tests for omitted-patch detection and directory scoping behavior. |
| packages/app/src/pages/session.tsx | Implements loadReviewDiff that fetches directory-scoped diffs and validates them against the selected file’s stats/version. |
| packages/app/e2e/regression/review-terminal-stacked.spec.ts | Expands regression coverage to simulate capped diffs, lazy detail reload (including retry), and refresh on version changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+91
to
+94
| void load(diff.file, version).then((result) => { | ||
| if (token !== loadToken || result?.file !== diff.file) return | ||
| setLoadedDiff({ source: diff, version, value: result }) | ||
| }) |
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
Testing