fix(agent-manager): preserve worktree list scroll on deletion - #13429
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous Review Summaries (2 snapshots, latest commit 71869fd)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 71869fd)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit 5da8d6b)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 59.2K · Output: 11.6K · Cached: 409.1K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
August 25, 2026 15:58
iscekic
approved these changes
Aug 25, 2026
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.
What Problem This Solves
Deleting a worktree from a long Agent Manager sidebar rebuilt the worktree rows from a complete state snapshot and reset the list to the top. This made repeated cleanup difficult because the selected position was lost after every deletion.
Why This Change Was Made
Agent Manager has different scroll owners in single-project and multi-project layouts. Preserve both containers before applying a state snapshot, restore their offsets after two animation frames, and cancel stale pending restores when another snapshot arrives. This keeps the fix scoped to the sidebar instead of changing project-state reconciliation.
User Impact
Worktree deletion keeps the current sidebar position in both supported layouts. Removed containers are ignored, and a shorter list naturally clamps to its new maximum scroll position.
Evidence
scrollTopfrom174to0.scrollTopremained320before and after the deletion.