Skip to content

fix(agent-manager): align panel terminal tabs with session tabs - #12693

Merged
marius-kilocode merged 1 commit into
mainfrom
grape-airedale
Jul 30, 2026
Merged

fix(agent-manager): align panel terminal tabs with session tabs#12693
marius-kilocode merged 1 commit into
mainfrom
grape-airedale

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

The Agent Manager side panel can hold several terminals, but its tab strip was a hand-rolled row rather than the tab bar's chrome, so terminals behaved differently depending on where they were opened. Panel tabs had no context menu, no keyboard navigation, no overflow affordance, and they reflowed while a tab was closing. The strip also stretched its tab list across the full panel width, which pushed the new-terminal button to the far edge, several hundred pixels away from the tabs it belongs to.

Panel tabs now render through the same SortableTerminalTab the tab bar uses, so a terminal is the same tab wherever it lives:

  • right-click Close and Close Others
  • arrow keys / Home / End / Enter to move between tabs, scoped to the strip so focus never jumps into the top tab bar, which uses identical role="tab" markup
  • overflow scrolling with the tab bar's edge fades, vertical-wheel-to-horizontal scrolling, and scroll-active-tab-into-view
  • tab widths frozen while a tab closes or is dragged, so the remaining close buttons stay under the cursor
  • the same width clamp, so tabs collapse evenly before the strip starts scrolling

The tab list now only grows as wide as its tabs, so + sits immediately after the last tab and overflowing tabs scroll underneath it. The strip also drops its top padding, the divider that separated the tabs from +, and the per-tab left border, which only exists to mark a terminal among session tabs in the top bar and is pure noise when every tab is a terminal. Removing the vertical padding also puts + on the strip's optical center.

Panel terminal state gains a Close Others counterpart so the context menu can keep one terminal and kill the rest of the context.

Before

Panel terminal tab strip before: tabs offset from the top of the strip, dividers between tabs, and the plus button pushed to the far panel edge

After

Panel terminal tab strip after: tabs flush with the strip, no dividers, and the plus button directly next to the last tab

@marius-kilocode
marius-kilocode enabled auto-merge (squash) July 30, 2026 12:00
@marius-kilocode
marius-kilocode disabled auto-merge July 30, 2026 12:04
Comment thread packages/kilo-vscode/webview-ui/agent-manager/terminal/SideTerminalPanel.tsx Outdated
Comment thread packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
Comment thread packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts
Comment thread packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts
@kilo-code-bot

kilo-code-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Optional follow-up, nothing blocking

Overview

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

SUGGESTION

File Line Issue
webview-ui/src/stories/agent-manager.stories.tsx 999 Still no story exercising the new overflow chrome (edge fades, scrolling list, pinned +). SideTerminalPanelTabs renders 3 tabs in a 360px panel, which fits above the 72px floor, so the fades and horizontal scroll never light up. Already flagged inline; unchanged in this revision.
Files Reviewed (3 files, incremental since 8f2b908)
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-state.test.ts - 0 issues (comment wording only)
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/SideTerminalPanel.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts - 0 issues (comment wording only)

Resolved since the previous review: the close-then-add width mismatch is fixed — + now goes through start(), which calls release() before props.onStart(), so surviving tabs drop their pinned pixel widths before the new tab joins the equal-share layout (no pointerleave fires between the two clicks because + is inside the strip). closeOthers' no-op freeze() is gone; onCloseOthers calls the prop directly, correctly documented as needing no freeze since the context menu is portaled and the survivor spans the strip.

Remaining nit, not worth a comment: closing the last tab while hovering leaves data-tab-widths-frozen on the empty tablist until pointerleave, and the empty-state Start button calls props.onStart directly rather than start. The attribute only disables transition on .am-tab-sortable, so the effect is a single missing fade-in.

Fix these issues in Kilo Cloud

Previous Review Summaries (2 snapshots, latest commit 8f2b908)

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

Previous review (commit 8f2b908)

Status: 2 Issues Found | Recommendation: Optional follow-ups, nothing blocking

Overview

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

SUGGESTION

File Line Issue
webview-ui/agent-manager/terminal/SideTerminalPanel.tsx 85 release() is only reachable from pointerleave / onDragEnd, but + sits inside .am-side-terminal-tabs, so close-then-add keeps the surviving tabs pinned to pre-close widths while the new tab uses the smaller equal share — uneven tabs plus a lit overflow fade until the pointer leaves. closeOthers' freeze() also looks like a no-op under the new :hover gate, since it only fires from the portaled context menu.
webview-ui/src/stories/agent-manager.stories.tsx 999 Still no story exercising the new overflow chrome (edge fades, scrolling list, pinned +); both panel stories fit 3 tabs without overflowing.
Files Reviewed (5 files, incremental since 2f1ad51)
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-state.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/SideTerminalPanel.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/SortableTerminalTab.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts - 0 issues

Resolved since the previous review: the rAF release is gone and the freeze is now hover-gated like the top bar's freezeTabs, so it survives to paint; close no longer falls through to focusPrompt when the strip empties; the tablist gap is removed so equal-share widths no longer overflow by (N-1)*2px; closeSideOthers now pairs setSideActive with requestFocus like selectSide and is covered by a real-state test; the SortableTerminalTab docstring is no longer stale. The drag path correctly bypasses the hover gate.

Fix these issues in Kilo Cloud

Previous review (commit 2f1ad51)

Status: 6 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
webview-ui/agent-manager/terminal/SideTerminalPanel.tsx 87 requestAnimationFrame(release) runs before style/layout/paint, so the frozen widths are never committed — the close-path freeze is a no-op plus a forced layout. The top bar instead holds the freeze until pointerleave.
webview-ui/agent-manager/terminal/SideTerminalPanel.tsx 77 createTabFocus default fallback is focusPrompt, so closing the last panel terminal yanks focus into the chat composer (with window.focus() retries for ~50ms) while the panel is still open.
webview-ui/agent-manager/agent-manager.css 4685 Equal-share tab widths (100% / N, no shrink) combined with the strip's gap: 2px overflow by (N-1)*2px, so from 3 tabs on the list is permanently scrollable and the right edge fade never turns off. .am-tab-list has no gap.

SUGGESTION

File Line Issue
webview-ui/agent-manager/terminal/state.ts 730 closeSideOthers activates the survivor without requestFocus, unlike selectSide, so the revealed terminal is not keyboard-focused.
webview-ui/agent-manager/terminal/state.ts 723 No test for closeSideOthers; closeSide is covered by the existing scene() harness in tests/unit/agent-manager-terminal-state.test.ts.
webview-ui/src/stories/agent-manager.stories.tsx 999 No story exercises the new overflow chrome (edge fades, scrolling list, pinned +); both panel stories fit 3 tabs without overflowing.
Files Reviewed (7 files)
  • .changeset/side-terminal-tab-parity.md - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css - 1 issue
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/SideTerminalPanel.tsx - 2 issues
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts - 2 issues
  • packages/kilo-vscode/webview-ui/src/stories/agent-manager.stories.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/utils/tab-widths.ts - 0 issues

Notes: the reuse of SortableTerminalTab, useTabScroll, createTabFocus, and the selector parameter on setTabWidths all look sound — DnD still works because .am-tab-sortable carries touch-action: none and data-tab-id, and sidesForContext returns a fresh array so closeSideOthers iterating while removing is safe. Also worth a follow-up: the header docstring in SortableTerminalTab.tsx still says the side panel "uses the chrome directly", which this PR makes stale (unchanged line, so no inline comment).

Fix these issues in Kilo Cloud


Reviewed by claude-opus-5 · Input: 38 · Output: 8.4K · Cached: 972K

Review guidance: REVIEW.md from base branch main

Panel terminal tabs reuse the tab bar's chrome: right-click Close/Close
Others, arrow-key navigation, overflow scrolling with edge fades, and
frozen widths while closing. The new-terminal button sits next to the
last tab instead of the panel edge, and the strip loses its top padding,
stray dividers, and off-center plus button.
@marius-kilocode
marius-kilocode merged commit 5e283d6 into main Jul 30, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the grape-airedale branch July 30, 2026 13:38
unixcrh pushed a commit to unixcrh/kilocode that referenced this pull request Aug 1, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
fix(agent-manager): align panel terminal tabs with session tabs
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