Skip to content

feat(agent-manager): add close to the right tab action - #14444

Merged
marius-kilocode merged 1 commit into
mainfrom
lowly-veterinarian
Sep 22, 2026
Merged

marius-kilocode merged 1 commit into
mainfrom
lowly-veterinarian

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The Agent Manager tab context menu offers Close and Close Others, but no way to close only the tabs that sit after the current one. With several session, terminal, and review tabs open, clearing the trailing tabs means closing them one at a time.

Why This Change Was Made

Add Close to the Right directly after Close Others in the Agent Manager tab context menu. It closes the session, terminal, and review tabs after the target in the current left-to-right order.

Behavior details:

  • Pinned session tabs survive, the same way they already do for Close Others.
  • The item is hidden when there is nothing closable to the right, so the last tab does not offer a no-op.
  • Selection changes only when the visible tab is one of the tabs being closed. Otherwise the current selection stays where it is.
  • Scope is the Agent Manager tab bar. The sidebar tab strip, subagent tabs, and document tabs are unchanged.
  • The shared logic lives in a vscode-free module (close-to-right.ts) next to the existing close-others.ts, and closeOthers keeps its existing behavior through a small shared reveal helper.

Closes #14433

User Impact

Right-click a tab in the Agent Manager tab bar and choose Close to the Right. The tabs after it close, and the current selection is preserved unless it was one of the closed tabs.

Agent Manager tab menu showing Close to the Right below Close Others with four session tabs and a terminal tab open

After choosing it, only the tabs at or before the target remain:

Agent Manager tab bar after Close to the Right, with only the two leading session tabs left

Closing all tabs to the right from the Agent Manager tab menu

Evidence

Manual verification in an isolated VS Code dev instance with the rebuilt webview:

  • The menu shows Close to the Right after Close Others.
  • With four session tabs and one terminal tab, Close to the Right on the second tab closed exactly the three trailing tabs, including the terminal tab.
  • With the selection on a tab left of the target, the selection stayed there.
  • A pinned tab to the right of the target survived.
  • The item is absent when the target is the last tab.
  • Side terminals are a separate surface and were unaffected.

Automated checks:

  • bun test tests/unit/close-to-right.test.ts tests/unit/close-others.test.ts -> 26 pass.
  • i18n keyset and unused-key tests pass with the new agentManager.tab.closeToRight key added to all 21 agent-manager locales.
  • bun run lint and bun run knip pass.
  • bun run check-types:webview reports only pre-existing errors from missing generated SDK members and unbuilt workspace packages. No errors come from the touched files.
  • The full unit suite reports the same pre-existing failures as the base commit, none in tab or i18n suites.

@kilo-code-bot

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

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The close-to-right logic mirrors the existing Close Others semantics correctly. I verified the changed lines in context: closableRightOf excludes pinned session tabs while always counting terminals and the review tab; closeToRight only reveals the target when the visible tab is itself being closed, which is what prevents a closing neighbor from stealing selection (handleCloseTab reselects only when the closed tab was active, and termHandlers.closeTerminal reselects only when activeId matches). The reveal extraction preserves the prior closeOthers behavior exactly. Reactive menu visibility holds in both paths (Solid compiles the session-tab prop expression into a getter; the terminal object literal uses an explicit getter). Tests exercise the real closeToRight/closableRightOf implementation rather than restating it, the changeset is user-facing, and all 21 locales received the new key.

Files Reviewed (31 files)
  • .changeset/agent-manager-close-to-right.md
  • packages/kilo-vscode/tests/unit/close-to-right.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/ClosableTab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/close-others.ts
  • packages/kilo-vscode/webview-ui/agent-manager/close-to-right.ts
  • packages/kilo-vscode/webview-ui/agent-manager/sortable-tab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/tab-rendering.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/SortableTerminalTab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/render.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/SessionTabMenu.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/i18n/{ar,br,bs,da,de,en,es,fa,fr,it,ja,ko,nl,no,pl,ru,th,tr,uk,zh,zht}.ts (21 locale files, new agentManager.tab.closeToRight key)

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

Review guidance: REVIEW.md from base branch main

@WebReflection WebReflection left a comment

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.

this looks good to me, I just wonder if some custom theme or some right to left language would have a different meaning for right but I guess we'll figure that out.

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.

[FEATURE]: Close to the Right in the Agent Manager tab menu

2 participants