Skip to content

sessions: inline rename for chats in the chat composite bar#321384

Merged
sandy081 merged 2 commits into
mainfrom
sandy081/chat-tab-inline-rename
Jun 15, 2026
Merged

sessions: inline rename for chats in the chat composite bar#321384
sandy081 merged 2 commits into
mainfrom
sandy081/chat-tab-inline-rename

Conversation

@sandy081

@sandy081 sandy081 commented Jun 15, 2026

Copy link
Copy Markdown
Member

Fixes #321386

What

Adds inline renaming of a chat directly inside its tab in the chat composite bar (Agents window), mirroring how the session title is renamed inline in the session header.

  • Double-click a tab — or use the context-menu Rename — to reveal a themed InputBox pre-filled with the chat title.
  • Enter commits via ISessionsManagementService.renameChat; Escape or blur cancels.
  • Clicking another tab while editing cancels the edit and switches to that tab (resolved via the blur relatedTarget).

How

  • The rename input lives in a stable, empty per-tab container that is toggled via the tab's editing CSS class. The InputBox is created lazily only while editing and disposed when done — so no DOM is inserted/removed on demand, and tabs that are never renamed carry no widget overhead.
  • The label, status indicator and close action are hidden while editing (CSS), so the input fills the tab's max width.

Tests / screenshots

Adds a component fixture chatCompositeBar.fixture.ts with variants for the two-tab, mixed-status, long-title and renaming states (Dark + Light). Verified rendering locally via the Component Explorer.

Notes for reviewers

  • Changes are confined to src/vs/sessions/ plus the new fixture and a stylelint known-variable entry; the sessions skill doc was updated with the relevant pitfalls.
  • The fixture's vs/sessions/* imports use eslint-disable-next-line local/code-import-patterns, matching the existing sessions fixtures.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Support renaming a chat directly inside its tab in the chat composite
bar, mirroring the inline rename of the session title. Double-click a
tab (or use the context menu "Rename") to reveal a themed InputBox
pre-filled with the chat title; Enter commits via renameChat, Escape or
blur cancels.

The rename input lives in a stable, empty per-tab container that is
toggled via the tab's `editing` CSS class; the InputBox is created lazily
only while editing and disposed when done, so no DOM is inserted/removed
on demand and unused tabs carry no widget overhead.

Also adds a component fixture (chatCompositeBar.fixture.ts) covering the
two-tab, mixed-status, long-title and renaming states for screenshot
testing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 15, 2026 09:56
@sandy081 sandy081 self-assigned this Jun 15, 2026
@sandy081 sandy081 added this to the 1.126.0 milestone Jun 15, 2026
@vs-code-engineering

vs-code-engineering Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@benibenj

Matched files:

  • src/vs/sessions/browser/parts/chatCompositeBar.ts
  • src/vs/sessions/browser/parts/media/chatCompositeBar.css

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 0a9d0e4c Current: fb0b134f

Added (8)

sessions/chatCompositeBar/TwoChats/Dark

current

sessions/chatCompositeBar/TwoChats/Light

current

sessions/chatCompositeBar/MixedStatuses/Dark

current

sessions/chatCompositeBar/MixedStatuses/Light

current

sessions/chatCompositeBar/LongTitles/Dark

current

sessions/chatCompositeBar/LongTitles/Light

current

sessions/chatCompositeBar/Renaming/Dark

current

sessions/chatCompositeBar/Renaming/Light

current

Copilot AI 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.

Pull request overview

Adds inline renaming for chats directly within the Agents window chat composite bar tabs, using a lazily-created themed InputBox hosted in a stable per-tab container (CSS-toggled), and adds a component fixture to validate rendering across states/themes.

Changes:

  • Implement inline rename UI/behavior in ChatCompositeBar (dblclick + context menu; Enter commits, Escape/blur cancels).
  • Add tab-editing styling and a shared --chat-tab-max-width CSS variable (registered for stylelint).
  • Add a component fixture covering typical/mixed/long-title/renaming states.
Show a summary per file
File Description
src/vs/workbench/test/browser/componentFixtures/sessions/chatCompositeBar.fixture.ts Adds component explorer fixture variants to validate tab strip rendering and renaming state.
src/vs/sessions/browser/parts/media/chatCompositeBar.css Adds editing-mode tab styles and a reusable max-width CSS variable for tabs.
src/vs/sessions/browser/parts/chatCompositeBar.ts Implements inline rename input lifecycle, actions, and editing state management for chat tabs.
build/lib/stylelint/vscode-known-variables.json Registers --chat-tab-max-width for stylelint validation.
.github/skills/sessions/SKILL.md Documents the “stable container + lazy widget” pattern for transient inline UI like rename.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/browser/parts/chatCompositeBar.ts Outdated
Comment thread src/vs/sessions/browser/parts/chatCompositeBar.ts
Address PR review: the tab click handler bailed out while editing and the
input blur handler switched tabs via relatedTarget. Because blur clears
the editing state before the trailing click fires, this could switch
twice (extra openChat/flicker) and was order-sensitive.

Now blur only cancels the rename, and the tab click handler cancels any
in-progress edit before switching, so tab switching follows the normal
click path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sandy081 sandy081 enabled auto-merge (squash) June 15, 2026 10:10
@sandy081 sandy081 merged commit c98f5a1 into main Jun 15, 2026
53 of 55 checks passed
@sandy081 sandy081 deleted the sandy081/chat-tab-inline-rename branch June 15, 2026 15:36
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.

Inline rename for chats in the chat composite bar (Agents window)

3 participants