Skip to content

fix(app): load capped review patches#35633

Open
Hona wants to merge 3 commits into
anomalyco:devfrom
Hona:review-patch-load
Open

fix(app): load capped review patches#35633
Hona wants to merge 3 commits into
anomalyco:devfrom
Hona:review-patch-load

Conversation

@Hona

@Hona Hona commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • detect selected review files whose aggregate patch was omitted by the 10 MB cap
  • reload them through the existing directory-scoped VCS diff API without core or SDK changes
  • retry, revision-key, validate, and refresh detail patches safely

Testing

  • app and E2E typechecks
  • review diff unit tests
  • capped 2,740-file regression in dev and production builds
  • capped 10,000-file review benchmark

@Hona Hona requested a review from Brendonovich as a code owner July 7, 2026 00:05
Copilot AI review requested due to automatic review settings July 7, 2026 00:05
@Hona Hona added the beta label Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 })
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants