Skip to content

fix(vscode): load initial diff previews - #12089

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-diff-race-condition
Jul 10, 2026
Merged

fix(vscode): load initial diff previews#12089
marius-kilocode merged 1 commit into
mainfrom
fix-diff-race-condition

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Expanded review files can remain stuck on the on-demand placeholder when summarized diff data is already available before the review surface mounts. The detail-request effect deferred its first callback, so no request was sent until another interaction, such as collapsing and reopening the file, changed the accordion state.\n\nRun initial detail scheduling for already-expanded summaries and share the request lifecycle between inline and full-screen review surfaces. Requests remain deduplicated by file revision, reset when a file is reopened or the review context changes, and resume when an existing loading state clears.

@kilo-code-bot

kilo-code-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The extraction of createDiffRequests into a shared diff-viewer/diff-requests.ts hook is a clean, well-tested fix. The key change — dropping the { defer: true } option on the effect that scans open/diffs/loading and issues detail requests — correctly addresses the described bug where already-expanded summarized diffs never triggered an initial request. The new key-clear effect stays deferred (correct, since the request map starts empty) and is created before the request effect, so requested is cleared before the request effect re-runs on a session-key change. Both DiffPanel.tsx and FullScreenDiffView.tsx now share identical logic, and the added test exercises the real implementation (initial request, dedup on unchanged diff, retry on reopen, new-session retry, and resuming after an existing loading state clears) rather than duplicating the logic. The changeset is concise and user-facing.

Files Reviewed (5 files)
  • .changeset/load-initial-diff-previews.md
  • packages/kilo-vscode/tests/unit/diff-preview-request.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/FullScreenDiffView.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/diff-requests.ts

Reviewed by claude-sonnet-5-20260630 · Input: 30 · Output: 12.7K · Cached: 816.6K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 11abbf5 into main Jul 10, 2026
21 checks passed
@marius-kilocode
marius-kilocode deleted the fix-diff-race-condition branch July 10, 2026 09:27
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
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.

2 participants