Skip to content

feat(cloud-agent-next): open changes as a side-by-side diff - #6578

Merged
eshurakov merged 4 commits into
mainfrom
eshurakov/lively-delta
Sep 23, 2026
Merged

eshurakov merged 4 commits into
mainfrom
eshurakov/lively-delta

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

The Changes button now opens a main-content view: the changed-file list on the left and one file diff on the right. Selecting another file replaces that diff. It no longer opens a sheet and then a workspace file tab.

  • While that view is open, the workspace tab is not shown as selected. Clicking it closes the view and returns to that tab.
  • The file list can be dragged between 200 and 640 pixels. The width is saved in this browser and restored on the next open.
  • A review comment is labeled "Older saved capture" only when its quoted lines cannot be placed in the latest saved file. A newer snapshot id with the same text does not show that label. "Current saved capture" is no longer shown.

Verification

  • Local browser, Cloud Agent session with saved changes: Changes opens list and one diff; selecting a second file replaces the diff and adds no file tab; clicking the already-selected chat tab closes the view.

  • Local browser: dragging the file-list separator moved it from 448px to 540px, then a later drag saved 608px. After reload, the list opened at 608px.

  • Below the sm breakpoint the list is full width and the resize handle is hidden.

  • Focused unit tests passed for the selection rule, tab activation, review quote match, and stored width. The review-dialog label was not exercised against a running review with an older snapshot.

  • Changes split view, tab deselect, resize, and remembered width checked in the local app

  • Review dialog label checked in a running review

Visual Changes

The Changes surface is no longer a right-hand sheet. Desktop shows the file list and one diff side by side, with a drag handle between them. The Chat tab is not highlighted while that view is open. Narrow viewports keep the existing list-then-diff flow.

Screenshots were captured locally during verification and are not attached here.

Reviewer Notes

  • WorktreeChangesView owns which file is shown and the list width. The page only toggles the view.
  • The remembered width is browser-local, not per session. The first paint is still 448px so server render does not mismatch, then the saved width applies.
  • Review freshness uses the same diff the file pane searches, including unchanged lines outside the patch. Send still refuses a comment that cannot be applied.

The Changes button opens a file list beside one file diff instead of a
sheet that then opens a tab. The list width is draggable and remembered
in this browser. A review comment is labeled older only when its quote
no longer matches the latest saved file.
Comment thread apps/web/src/components/cloud-agent-next/useWorktreeReview.ts Outdated
Comment thread apps/web/src/components/cloud-agent-next/useWorktreeReview.ts Outdated
Comment thread apps/web/src/components/cloud-agent-next/useWorktreeReview.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The cancelled-backoff guard now preserves a restarted verification's inflight record when the snapshot changes mid-retry, resolving the previous WARNING; one lower-priority performance suggestion on verificationInputKey remains open.

Overview

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

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 352 verificationInputKey is rebuilt on every render, running JSON.stringify over each snapshot's file list in the component body.
Files Reviewed (2 files)
  • apps/web/src/components/cloud-agent-next/useWorktreeReview.ts - 0 new issues (previous WARNING at line 453 resolved by guarding the release with cancelled)
  • apps/web/src/components/cloud-agent-next/useWorktreeReview.test.ts - 0 issues (new test fails without the fix; asserts verification restarts after a snapshot change during backoff)

Fix these issues in Kilo Cloud

Previous Review Summaries (3 snapshots, latest commit f255d69)

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

Previous review (commit f255d69)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

The retry fix for unverified capture checks is sound in the common case, but a cancelled retry continuation can delete a newer effect run's inflight record via releaseInflight, silently dropping verification for a stale comment until another dependency change.

Overview

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

WARNING

File Line Issue
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 453 A cancelled retry continuation can releaseInflight a newer run's record for the same signature, dropping verification.

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 352 verificationInputKey stringifies every snapshot's file list on every render.
Files Reviewed (2 files)
  • apps/web/src/components/cloud-agent-next/useWorktreeReview.ts - 2 issues
  • apps/web/src/components/cloud-agent-next/useWorktreeReview.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 98f7d98)

Status: 3 Issues Found | Recommendation: Address before merge

Executive Summary

The new stale-comment verification effect in useWorktreeReview.ts caches verification signatures before results resolve, so unverified outcomes are never retried and its unstable dependencies make it run on every render; two maps also grow without bound.

Overview

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

WARNING

File Line Issue
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 301 unverified results are cached by signature and never retried, so a transient fetch failure suppresses the 'Older saved capture' label for that capture.

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 283 verificationSignatures / unappliedVerifications grow without bound; entries are never pruned for removed comments or previous sessions.
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 336 Effect dependencies (captures, latestSnapshots, and two inline functions) change identity every render, so the verification effect re-runs on every render.
Files Reviewed (18 files)
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.test.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/CloudChatPage.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/WorktreeChanges.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/WorktreeFileRenderer.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/WorktreeReviewDialog.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/WorktreeReviewList.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/terminal-tabs.test.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/useWorktreeReview.test.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/useWorktreeReview.ts - 3 issues
  • apps/web/src/components/cloud-agent-next/worktree-changes.test.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-changes.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-file-diff.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-file.test.mts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-review-verify.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-review.test.mts - 0 issues
  • apps/web/src/hooks/useResizableSidebar.test.ts - 0 issues
  • apps/web/src/hooks/useResizableSidebar.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit dcd731f)

Status: 3 Issues Found | Recommendation: Address before merge

Executive Summary

The new stale-comment verification effect in useWorktreeReview.ts caches verification signatures before results resolve, so unverified outcomes are never retried and its unstable dependencies make it run on every render; two maps also grow without bound.

Overview

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

WARNING

File Line Issue
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 301 unverified results are cached by signature and never retried, so a transient fetch failure suppresses the 'Older saved capture' label for that capture.

SUGGESTION

File Line Issue
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 283 verificationSignatures / unappliedVerifications grow without bound; entries are never pruned for removed comments or previous sessions.
apps/web/src/components/cloud-agent-next/useWorktreeReview.ts 336 Effect dependencies (captures, latestSnapshots, and two inline functions) change identity every render, so the verification effect re-runs on every render.
Files Reviewed (18 files)
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.test.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/CloudAgentWorkspaceTabs.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/CloudChatPage.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/WorktreeChanges.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/WorktreeFileRenderer.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/WorktreeReviewDialog.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/WorktreeReviewList.tsx - 0 issues
  • apps/web/src/components/cloud-agent-next/terminal-tabs.test.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/useWorktreeReview.test.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/useWorktreeReview.ts - 3 issues
  • apps/web/src/components/cloud-agent-next/worktree-changes.test.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-changes.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-file-diff.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-file.test.mts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-review-verify.ts - 0 issues
  • apps/web/src/components/cloud-agent-next/worktree-review.test.mts - 0 issues
  • apps/web/src/hooks/useResizableSidebar.test.ts - 0 issues
  • apps/web/src/hooks/useResizableSidebar.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

Extract useSavedWorktreeChanges into its own module so WorktreeChanges.tsx
can import WorktreeFilePane without a circular dependency back through
useWorktreeFile.ts. Behaviour is unchanged.
Do not cache a failed freshness check. Retry it while Review is open, drop records for removed comments, and keep the effect off the chat render path.
Comment thread apps/web/src/components/cloud-agent-next/useWorktreeReview.ts Outdated
const [unappliedVerifications, setUnappliedVerifications] = useState<ReadonlyMap<string, string>>(
new Map()
);
const verificationInputKey = [...latestSnapshots.entries()]

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.

SUGGESTION: verificationInputKey is rebuilt on every render.

worktreeReviewSnapshotVerificationKey runs JSON.stringify over snapshot.files for every source, and this executes in the component body on every render of the chat page, which re-renders frequently while streaming. The snapshot file list can be large, so this repeats work per render purely to produce a dependency value. Consider memoizing latestSnapshots (and the key) so the string is only recomputed when snapshot content changes.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@eshurakov

eshurakov commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Desktop Changes: file list and hello.txt diff. Chat tab is not selected.

Selecting src/note.txt replaces the diff. No file tab is added.

File list after dragging the separator wider.

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