Skip to content

sessions: session chat styles itself, whatever window shows it (no behavior change) - #347609

Merged
Sandeep Somavarapu (sandy081) merged 2 commits into
mainfrom
sandy081/agents/session-chat-component
Nov 11, 2026
Merged

Sandeep Somavarapu (sandy081) merged 2 commits into
mainfrom
sandy081/agents/session-chat-component

Conversation

@sandy081

Copy link
Copy Markdown
Member

The session chat's look now comes from the component, not the window it is shown in. There is no behavior change for today's Agents window or chat windows.

Changes

  • Styling keyed on the component. AbstractChatView's root carries .sessions-chat. The CSS re-key is additive: every .agent-sessions-workbench … selector is kept, with a .sessions-chat … variant of equal specificity (chatView.css, chatWidget.css, chatInput.css, promptTimeline.css, chatPlanReview.css). chat.css's timestamp rule also skips .sessions-chat via :where.
  • Editor part surface. .part.editor.sessions-chat-surface paints --vscode-agentsPanel-background, with its content and editors transparent. The chat window's more specific rule still wins in chat windows.
  • Move. getChatWindowMainPartOptions moves from vs/sessions to the workbench chatWindow.ts (a pure move).
  • Behavior flag. A widget-scoped ChatContextKeys.inSessionsChat and a renderer option isSessionsChat. On main the widget flag is only true in the Agents window.
  • Fixtures. AssistantResponseInChatWindow / AssistantResponseInEditorWindow, pixel-identical in 4 themes.

For contrib/chat code owners

These sites now read "Agents window OR session-chat widget" (the widget flag is only true in the Agents window today, so behavior is unchanged):

  • chatInputPart: deferred notifications
  • chatInputCompletions: 2 sites
  • chatWidget: archiveLocalParentSession and the agent-leader parse
  • sessionTargetPicker
  • chatListRenderer: 6 sites
  • chatSubagentContentPart
  • chatSubagentOpenChat

Validation

  • pnpm run build-fast --client-only then pnpm run typecheck-client: passed (0 errors).
  • ./scripts/test.sh on sessions/contrib/chat/test/browser/chatView.test.ts, chatInputNotificationWidget.test.ts and sessionsChatWindowProvider.test.ts: 246 passing.
  • eslint (20 ts files) and stylelint (7 css files): clean (before rebase onto the current main).
  • An earlier broader focused run: 20258 passing, with 1 pre-existing failure on main (ChatListWidget "falls back to a full refresh…").
  • Fixtures: a headless render of 4546 sessions/ and chat/ fixtures vs main shows 8 added and 19 changed, all animated and flaky on main too. Every Agents-window and chat-window fixture is identical to main.
  • Headless computed-style check: 48/48 before/after comparisons identical (Agents window / chat window / regular workbench × 4 themes × desktop/phone × wallpaper/plain).
  • Review: reviewed by a second model (GPT-5.3-Codex): SHIP, no findings.

How to test: open the Agents window and a chat window; both should look exactly as before.

The session chat took its look from the Agents window: its rules were
keyed on the Agents window's workbench, and some of its behaviour on
the window being the Agents window. Shown elsewhere, such as in the chat
part of an editor window, it looked and behaved differently.

- The chat view's root has `.sessions-chat`. Every rule of the chat that
  was keyed on `.agent-sessions-workbench` also matches under that root,
  with the same specificity; the window-keyed selectors stay, so the
  Agents window and its chat windows are unchanged.
- An editor part that shows the chat surface paints it, and lets its
  content and editors show it through, whatever window it is in.
- The chat widget knows it shows a session chat (`chatInSessionsChat`,
  renderer option `isSessionsChat`), and behaves as in the Agents window
  wherever it is: deferred notifications, agent completions, the session
  target picker, subagent links and labels, user identity, archiving
  after delegation and the agent-leader parse.
- The options of a chat window's main part move to the workbench, for
  other chat parts to share.
- Fixtures show the same chat in a chat window and in an editor window,
  in dark, light and high contrast themes: they render identically.

No behaviour changes in the Agents window, where the chat is only ever a session chat.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 12:07
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 80eb6659 Current: 8757f0d0

Changed (1)

chat/chatToolRiskBadge/BadgeOffInContext/Light
Before After
before after

Added (2)

sessions/chat/view/chatView/AssistantResponseInChatWindow/Light

current

sessions/chat/view/chatView/AssistantResponseInEditorWindow/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.

🟡 Changes recommended

The new context-service lookup violates the repository’s constructor-injection rule and needs a compliant approach that preserves per-widget scope.

1 open issue
What changed in this PR

This PR makes session-chat styling component-scoped rather than dependent on the hosting window, while aiming to preserve existing Agents-window and chat-window behavior.

Changes:

  • Adds .sessions-chat styling variants and a shared editor-part chat surface.
  • Propagates session-chat behavior through widget context and renderer options.
  • Moves the chat-window options helper into the workbench layer and updates tests and fixtures.
File Description
src/​vs/​workbench/​test/​browser/​componentFixtures/​sessions/​chatCompositeBar.fixture.ts Adds the session-chat marker to the fixture.
src/​vs/​workbench/​contrib/​sessions/​browser/​parts/​chatView.ts Marks the shared chat root with .sessions-chat.
src/​vs/​workbench/​contrib/​sessions/​browser/​media/​chatBackground.css Defines the editor-part chat surface.
src/​vs/​workbench/​contrib/​sessions/​browser/​chat/​media/​chatWidget.css Adds component-scoped composer styles.
src/​vs/​workbench/​contrib/​sessions/​browser/​chat/​media/​chatView.css Adds component-scoped transcript and input styles.
src/​vs/​workbench/​contrib/​sessions/​browser/​chat/​media/​chatInput.css Adds component-scoped input layout rules.
src/​vs/​workbench/​contrib/​chatWindow/​browser/​chatWindow.ts Receives the shared main-part options helper.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​input/​chatInputNotificationWidget.test.ts Covers notification eligibility outside the Agents window.
src/​vs/​workbench/​contrib/​chat/​common/​actions/​chatContextKeys.ts Defines the widget-scoped session-chat context key.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​media/​chat.css Excludes session chats from timestamp padding.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​sessionTargetPickerActionItem.ts Recognizes session-chat context in the picker.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​editor/​chatInputCompletions.ts Applies completion restrictions to session-chat widgets.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatInputPart.ts Extends deferred-notification eligibility to session chats.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatWidget.ts Publishes and propagates session-chat behavior.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatListRenderer.ts Uses session-chat behavior for identity and subagent navigation.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatContentParts/​media/​chatPlanReview.css Adds component-scoped plan-review styling.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatContentParts/​chatSubagentOpenChat.ts Skips the editor-specific action provider for session chats.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatContentParts/​chatSubagentContentPart.ts Adapts the fallback subagent action to session-chat context.
src/​vs/​workbench/​contrib/​chat/​browser/​promptTimeline/​media/​promptTimeline.css Adds component-scoped timeline styling.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.ts Adds the session-chat renderer option.
src/​vs/​sessions/​test/​browser/​sessionView.test.ts Updates test markup with the component marker.
src/​vs/​sessions/​test/​browser/​sessionActivityBar.test.ts Updates test markup with the component marker.
src/​vs/​sessions/​contrib/​chatWindow/​test/​browser/​sessionsChatWindowProvider.test.ts Imports the relocated options helper.
src/​vs/​sessions/​contrib/​chatWindow/​browser/​sessionsChatWindowProvider.ts Uses the workbench-owned options helper.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​chatView.test.ts Aligns chat-view test markup with the component root.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​chatView.fixture.ts Adds chat-window and editor-window visual fixtures.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​chatInput.fixture.ts Adds component-scoped wrappers to input fixtures.

Review effort: Balanced

@sandy081
Sandeep Somavarapu (sandy081) merged commit d670f6e into main Nov 11, 2026
52 of 53 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the sandy081/agents/session-chat-component branch November 11, 2026 13:50
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 11, 2026
Sandeep Somavarapu (sandy081) added a commit that referenced this pull request Nov 11, 2026
Resolves the import conflict in sessionsChatWindowProvider.ts: #347609 moved
getChatWindowMainPartOptions into chatWindow.ts, and this branch imports
IChatWindowNewChatFolder from it; the provider imports both.

Co-authored-by: Copilot <[email protected]>
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.

3 participants