Skip to content

feat(vscode): show PR review comments inline in diffs - #13541

Merged
marius-kilocode merged 11 commits into
mainfrom
integrate-pr-comments-into-diff-ui
Sep 7, 2026
Merged

marius-kilocode merged 11 commits into
mainfrom
integrate-pr-comments-into-diff-ui

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

GitHub PR review threads were separate from the code being reviewed. Moving a thread into chat also lost the direct path back to its location in the diff.

Why This Change Was Made

Keep remote review feedback next to the current code without replacing the existing local-comment workflow. Placement checks the file, side, hunk, and current content. Outdated or unmatched threads stay outside the current diff instead of appearing on a guessed line.

The implementation reuses the existing PR poller and diff virtualizers. Native PR polling state is isolated from the Changes panel, HTTPS validation is shared, and focused mapping, routing, lifecycle, and scroll tests replace the added render-bundle fixtures. No issue is linked because this is a standalone review-workflow enhancement.

User Impact

  • Read PR threads, replies, and reviewer avatars inline in Agent Manager and Changes, in unified or split view. Remote discussions remain read-only.
  • Use Show in diff from the PR panel or chat, including threads deep inside large virtualized files.
  • Receive fetched comments without resetting the view or taking focus from a local comment editor. Content below a new visible comment makes room normally.
  • Keep local notes and PR feedback in separate chat groups. Copy a thread or send it to the originating chat. If an unsent chat tab closes, delivery falls back to the sidebar draft without automatic submission.
  • Retain known comments during ambiguous empty lookups on the same branch, while clearing them when the branch or context changes.

Evidence

Automated local checks passed: the complete extension unit suite (4,457 tests), extension build, lint, type checks, Knip, change-marker checks, and source-link extraction.

Isolated VS Code checks covered inline placement, large-file navigation, unified/split layouts, incoming-thread insertion and removal, same-line threads, an active local-comment draft, and live/closed-chat delivery. The visible code stayed within 0.21 CSS pixels in all 12 insertion/removal cases. The local editor retained its DOM node, focus, and draft text when another thread arrived on the same line.

In the controlled 8 MB / 100-thread fixture, the synchronous refresh handler fell from a 1,399.6 ms median to 2.5 ms over three warm samples at the same 792 × 811 viewport. This measures the handler, not asynchronous layout or paint. The isolated instance had no GitHub credentials, so authenticated polling was not part of those automated UI checks.

Resulting UI

PR thread in the diff:

A remote PR review thread shown inline with Send to chat

Local review note in the same workflow:

The local review comment editor in the diff

Thread after sending it to chat:

A PR review thread marked Sent after sending it to chat

Manual Test

  1. Open a worktree with a PR and inspect its threads in Agent Manager and Changes. Check both diff layouts and an outdated thread.
  2. Keep a local comment draft open while another remote comment arrives. Confirm that the view and focus stay stable and the draft remains intact.
  3. Use Show in diff for a distant thread. Open Changes from a chat tab, close that unsent chat, and send the thread. Confirm that the sidebar receives it without replacing its draft or submitting a prompt.

@kilo-code-bot

kilo-code-bot Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-ui/src/components/diff.tsx 698 Diff handle registration leaks stale file keys when virtua reuses rows
Files Reviewed (6 files)
  • packages/kilo-vscode/src/agent-manager/pr/am-pr-utils.ts
  • packages/kilo-vscode/src/agent-manager/pr/pr-comment-context.ts
  • packages/kilo-vscode/tests/unit/pr-comment-context.test.ts
  • packages/kilo-vscode/tests/unit/remote-comments.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/pr/pr-types.ts
  • packages/kilo-vscode/webview-ui/diff-viewer/remote-comments.ts

Fix these issues in Kilo Cloud

Previous Review Summaries (4 snapshots, latest commit a729c8f)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit a729c8f)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-ui/src/components/diff.tsx 698 Diff handle registration leaks stale file keys when virtua reuses rows
packages/kilo-vscode/webview-ui/diff-viewer/remote-comments.ts 160 previewUnavailable also suppresses valid current-line threads
Files Reviewed (11 files)
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-vscode/tests/fixtures/pr-comments-render.tsx
  • packages/kilo-vscode/tests/unit/extension-arch.test.ts
  • packages/kilo-vscode/tests/unit/remote-comments.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/FullScreenDiffView.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/remote-comment-renderer.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/remote-comments.ts - 1 issue
  • packages/kilo-vscode/webview-ui/diff-viewer/review-controller.ts
  • script/kilocode-duplication-allowlist.json

Fix these issues in Kilo Cloud

Previous review (commit 6971faf)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-ui/src/components/diff.tsx 698 Diff handle registration leaks stale file keys when virtua reuses rows
packages/kilo-vscode/webview-ui/diff-viewer/remote-comments.ts 128 Unmapped GitHub threads can still be placed on a guessed line
packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx 143 Unmapped threads are shown as a failed request
packages/kilo-vscode/webview-ui/diff-viewer/remote-comment-renderer.tsx 339 Retrying prepare() undoes inner scrollToLine on large files
Files Reviewed (24 files)
  • packages/kilo-ui/src/components/diff.tsx - 1 issue
  • packages/kilo-vscode/src/agent-manager/PRStatusPoller.ts
  • packages/kilo-vscode/src/agent-manager/pr-status-bridge.ts
  • packages/kilo-vscode/src/agent-manager/pr/am-pr-utils.ts
  • packages/kilo-vscode/src/agent-manager/pr/pr-comment-context.ts
  • packages/kilo-vscode/src/diff/DiffViewerProvider.ts
  • packages/kilo-vscode/src/diff/pr-poller.ts
  • packages/kilo-vscode/src/shared/review-comments.ts
  • packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/diff-viewer/FullScreenDiffView.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/remote-comment-renderer.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/diff-viewer/remote-comments.ts - 1 issue
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/ReviewComments.tsx
  • packages/kilo-vscode/webview-ui/src/utils/prompt-drafts.ts
  • plus tests, types, stories, i18n, and remaining Agent Manager PR panel files

Fix these issues in Kilo Cloud

Previous review (commit 26f9d9c)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx 767 Pending-session comments stored under sessionDraftKey instead of pendingDraftKey
packages/kilo-ui/src/components/diff.tsx 834 Diff handle registration leaks stale file keys when virtua reuses rows
packages/kilo-vscode/webview-ui/diff-viewer/remote-comments.ts 119 Summarized large-file threads are classified as unmatched

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/diff-viewer/remote-comment-renderer.tsx 235 Each inline thread observes the whole diff-panel subtree
Files Reviewed (8 files)
  • packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/agentmanager/diff-panel-with-pr-threads-chromium-linux.png
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/agentmanager/full-screen-diff-with-pr-threads-chromium-linux.png
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/agentmanager/pr-panel-comments-200-chromium-linux.png
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/agentmanager/pr-panel-comments-chromium-linux.png
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/chat/user-message-many-review-comments-chromium-linux.png
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/chat/user-message-mixed-review-comments-chromium-linux.png
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/chat/user-message-review-comments-chromium-linux.png

Fix these issues in Kilo Cloud

Previous review (commit 3141112)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx 767 Pending-session comments stored under sessionDraftKey instead of pendingDraftKey
packages/kilo-ui/src/components/diff.tsx 834 Diff handle registration leaks stale file keys when virtua reuses rows
packages/kilo-vscode/webview-ui/diff-viewer/remote-comments.ts 119 Summarized large-file threads are classified as unmatched

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/diff-viewer/remote-comment-renderer.tsx 235 Each inline thread observes the whole diff-panel subtree
Files Reviewed (78 files)
  • packages/kilo-ui/src/components/diff.tsx - 1 issue
  • packages/kilo-ui/src/pierre/index.ts
  • packages/kilo-ui/src/pierre/scroll.ts
  • packages/kilo-vscode/src/KiloProvider.ts
  • packages/kilo-vscode/src/agent-manager/PRStatusPoller.ts
  • packages/kilo-vscode/src/agent-manager/pr-status-bridge.ts
  • packages/kilo-vscode/src/agent-manager/pr/am-pr-utils.ts
  • packages/kilo-vscode/src/diff/DiffViewerProvider.ts
  • packages/kilo-vscode/src/diff/pr-poller.ts
  • packages/kilo-vscode/src/shared/review-comments.ts
  • packages/kilo-vscode/webview-ui/agent-manager/DiffPanel.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/pr/PRCommentCard.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/FullScreenDiffView.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/remote-comment-renderer.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/diff-viewer/remote-comments.ts - 1 issue
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/components/chat/ReviewComments.tsx
  • plus tests, i18n, stories, types, and remaining Agent Manager PR panel files

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 182.7K · Output: 13.8K · Cached: 389.5K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode force-pushed the integrate-pr-comments-into-diff-ui branch from 26f9d9c to 687e41a Compare September 4, 2026 12:05
@marius-kilocode
marius-kilocode force-pushed the integrate-pr-comments-into-diff-ui branch from 6971faf to 7474ecc Compare September 4, 2026 13:20
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