Repository navigation
Unify new session and active session composer - #342683
Logan Ramos (lramos15) merged 19 commits into
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
There was a problem hiding this comment.
🟡 Changes recommended
The composer migration leaves functional regressions in submission metadata, command handling, session references, and Voice Mode integration.
3 open issues
What changed in this PR
Unifies the Agents Window composers around the shared chat widget so new and active sessions use common input behavior and keybindings.
Changes:
- Migrates composer controls, model selection, submission, and prompt options to shared infrastructure.
- Removes standalone completion, paste, voice UI, and styling implementations.
- Generalizes file-system search and updates related tests and fixtures.
| File | Description |
|---|---|
| src/vs/workbench/test/browser/componentFixtures/chat/chatFixtureUtils.ts | Adds shared-widget fixture services. |
| src/vs/workbench/services/search/test/common/fileSystemFileSearchProvider.test.ts | Updates search-provider tests. |
| src/vs/workbench/services/search/common/fileSystemFileSearchProvider.ts | Generalizes file-system search. |
| src/vs/workbench/services/agentHost/common/agentHostFileSystemService.ts | Uses the generalized search provider. |
| src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputPart.test.ts | Tests host-owned input behavior. |
| src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputModelUtils.test.ts | Tests model cycling. |
| src/vs/workbench/contrib/chat/test/browser/widget/chatWidget.test.ts | Tests host submission gating. |
| src/vs/workbench/contrib/chat/common/actions/chatContextKeys.ts | Removes standalone composer context. |
| src/vs/workbench/contrib/chat/browser/widget/media/chat.css | Styles host-provided submit labels. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Adds host model and submission integration. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputModelUtils.ts | Extracts model cycling helper. |
| src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts | Forwards host input options. |
| src/vs/workbench/contrib/chat/browser/voiceClient/media/voiceGlow.css | Removes obsolete toolbar selector. |
| src/vs/workbench/contrib/chat/browser/speechToText/media/dictationMicGlow.css | Removes standalone mic selector. |
| src/vs/workbench/contrib/chat/browser/chat.ts | Extends widget hosting contracts. |
| src/vs/workbench/contrib/chat/browser/actions/chatActions.ts | Uses shared chat focus context. |
| src/vs/sessions/sessions.common.main.ts | Loads composer contributions. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostAgentPicker.test.ts | Updates picker and context-menu tests. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostSessionConfigPicker.test.ts | Updates toolbar expectations. |
| src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.ts | Moves mobile picker registration. |
| src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.ts | Adapts agent actions and shortcut. |
| src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.ts | Indexes directory children. |
| src/vs/sessions/contrib/fileTreeView/browser/fileTreeView.contribution.ts | Registers GitHub file search. |
| src/vs/sessions/contrib/chat/test/browser/slashCommands.test.ts | Removes standalone command tests. |
| src/vs/sessions/contrib/chat/test/browser/sharedChatInputComposer.test.ts | Tests shared composer lifecycle. |
| src/vs/sessions/contrib/chat/test/browser/sessionWorkspacePicker.test.ts | Removes old context-action test. |
| src/vs/sessions/contrib/chat/test/browser/newSessionPromptOptions.test.ts | Targets extracted presenter. |
| src/vs/sessions/contrib/chat/test/browser/newSessionComposerLayout.test.ts | Adapts layout harnesses. |
| src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts | Adapts composer tests. |
| src/vs/sessions/contrib/chat/test/browser/newChatVoiceTarget.test.ts | Removes obsolete voice-helper tests. |
| src/vs/sessions/contrib/chat/test/browser/newChatUserInteraction.test.ts | Updates submission harness. |
| src/vs/sessions/contrib/chat/test/browser/newChatModelPicker.test.ts | Tests shared model commands. |
| src/vs/sessions/contrib/chat/test/browser/newChatInputPaste.test.ts | Removes standalone paste tests. |
| src/vs/sessions/contrib/chat/test/browser/newChatInput.fixture.ts | Removes standalone input fixtures. |
| src/vs/sessions/contrib/chat/test/browser/chatView.test.ts | Updates shared-input expectations. |
| src/vs/sessions/contrib/chat/test/browser/agentHostInputCompletions.test.ts | Removes standalone completion tests. |
| src/vs/sessions/contrib/chat/browser/voiceInputDecorations.ts | Removes obsolete stylesheet import. |
| src/vs/sessions/contrib/chat/browser/variableCompletions.ts | Removes standalone file completions. |
| src/vs/sessions/contrib/chat/browser/sharedChatInputComposer.contribution.ts | Registers shared composer toolbar items. |
| src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts | Removes old context-action API. |
| src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts | Updates dictation shortcut reference. |
| src/vs/sessions/contrib/chat/browser/sessionReferenceCompletions.ts | Removes standalone session completions. |
| src/vs/sessions/contrib/chat/browser/newSessionPromptOptions.ts | Extracts prompt-options presenter. |
| src/vs/sessions/contrib/chat/browser/newSessionConfigToolbars.ts | Removes old configuration toolbar factory. |
| src/vs/sessions/contrib/chat/browser/newChatWidget.ts | Adopts shared composer. |
| src/vs/sessions/contrib/chat/browser/newChatVoice.ts | Removes standalone voice UI controller. |
| src/vs/sessions/contrib/chat/browser/newChatModelPicker.ts | Adds host model commands. |
| src/vs/sessions/contrib/chat/browser/newChatInSessionWidget.ts | Adopts shared peer-chat composer. |
| src/vs/sessions/contrib/chat/browser/newChatInputPasteTarget.ts | Removes standalone paste adapter. |
| src/vs/sessions/contrib/chat/browser/newChatComposerInput.ts | Defines composer options and helpers. |
| src/vs/sessions/contrib/chat/browser/modelPicker.ts | Registers shared-toolbar model picker. |
| src/vs/sessions/contrib/chat/browser/media/voiceChatView.css | Removes standalone voice styling. |
| src/vs/sessions/contrib/chat/browser/media/sharedChatInputComposer.css | Styles input-only widget hosting. |
| src/vs/sessions/contrib/chat/browser/media/newChatInSession.css | Removes obsolete composer overrides. |
| src/vs/sessions/contrib/chat/browser/media/chatWidget.css | Removes obsolete toolbar styles. |
| src/vs/sessions/contrib/chat/browser/media/chatInputMobile.css | Removes standalone mobile input styles. |
| src/vs/sessions/contrib/chat/browser/chatView.ts | Removes obsolete voice stylesheet import. |
| src/vs/sessions/common/contextkeys.ts | Removes old attachment-menu context key. |
| src/vs/sessions/browser/parts/mobile/mobileChatShell.css | Removes obsolete mobile toolbar override. |
| src/vs/sessions/browser/menus.ts | Defines shared composer toolbar menu. |
Review effort: Balanced
6659c88 to
c58b1e1
Compare
Justin Chen (justschen)
left a comment
There was a problem hiding this comment.
a few things and then i think it's good to go, cc Megan Rogge (@meganrogge) cc Sandeep Somavarapu (@sandy081)
- pickers are weird - i click in one place, another one lights up. we also don't need an actual click affordance (see how stuff lights up or flashes when i click, then goes back to normal). i think i'm only seeing this stuff in the composer view, and not in the non-composer view.
https://github.com/user-attachments/assets/5c1dd9e1-a4c2-429d-97a6-8612bd06bce7
- space between above input pickers
-
we shouldnt show blue border on hover or click unless keyboard and certain low contrast themes. just match what we currently have i think (click in, click out, shouldnt be focused)
https://github.com/user-attachments/assets/d16f813f-ea69-43b6-87be-6a2d61a41f47 -
space below for non composer view is too much
https://github.com/user-attachments/assets/a04314ef-4159-4b00-baff-24ac7ffb7162
Retarget the experimental tray fixture checks from #342586 to the shared chat input's editor, input surface and Add Context icon. Co-authored-by: Copilot <[email protected]>
…shared composer - Give a draft-targeted Voice Mode session to the composer that owns the draft, so its segmented control reflects and disconnects its own connection, and restore the transcript and glow decorations for it. - Run client-side slash commands such as /models and /blobby in the input instead of handing them to the host, on every submit path. - Send inline references with ranges relative to the trimmed prompt, and restore them with the prompt when sending fails. Co-authored-by: Copilot <[email protected]>
…rder Screenshot review of the shared composer's blocks-ci fixtures found unintended changes: - Attachments a host adds before the composer renders, such as a new session's initial context, were dropped. They are now kept until the input exists. - The session controls row rendered inside the composer, so phone layouts placed the chip lane below the input. It renders after the composer again, where the host layout positions it. - Issue and pull request context picked in the workspace row rendered as pasted text. Labelled pasted context now shows its icon and name. - The new-session fixture now gives the Send action its real enablement, uses the production model picker classes for its stand-in, keeps Add Context visible in the compact model state, and asserts that initial attachments render. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
The new-session composer now hosts the workbench chat input, so the automation finds its editor and Send action the same way as in an active session. Co-authored-by: Copilot <[email protected]>
When a newer draft superseded one that was still loading, the composer cancelled the load. The load is shared with the session's own view and the agent host's prewarm, so cancelling it could drop the session's subscription and leave its first turn without a response. The superseded load is now released when it finishes instead. Also dispose the prompt options presenter before the input's services, since disposing it restores the input text. Co-authored-by: Copilot <[email protected]>
The experimental layout's session controls no longer use the base action item's pointer handling, which flashed the whole group as pressed, ran its placeholder action and moved focus off the clicked picker. Focus now moves into the nested pickers. The input part no longer picks up the session view's input padding inside the session part, which left a gap below the picker tray and extra space below the input. Co-authored-by: Copilot <[email protected]>
- Use the composer's 8/2 editor padding, so the input keeps its height. - Render ChatInputStatus items in the composer's controls row, including the phone chip lane, instead of the input's own status toolbar. - Keep the pickers in place while attachments grow the input, and inset attachment pills like the composer's text. - Restore the phone Send button's size and shape. - Keep a labelled attachment's themed icon color, such as an open issue's. - Show Send enabled in fixtures with comments or a selected prompt option. Co-authored-by: Copilot <[email protected]>
…l icon Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
The lane lives in the secondary toolbar, but it was created, and subscribed to the widget's session, even when a host renders no secondary toolbar. The Agents window's new-session composer is such a host: its widget shows the draft, so the lane subscribed to a session that only exists once sent. The agent host then tried to restore that session, and when the draft's eager creation won the race, the restore reset the session during its first turn, so the turn never completed. Co-authored-by: Copilot <[email protected]>
The new-session composer set its placeholder once, and the widget replaced it with a locked agent's "Chat with ..." as soon as it bound the draft. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
4436a5c to
6ffe63b
Compare
The trigger now reports `aria-expanded`, like the input's other pickers, so screen readers hear the state and the toolbar keeps its open picker background while the list is shown. Co-authored-by: Copilot <[email protected]>
The summary was a step smaller than its own model label and than the permissions split's secondary label beside it, which made the two split separators look like different sizes. Co-authored-by: Copilot <[email protected]>
Tray items used 4px horizontal padding, so their hover backgrounds hugged the content. They now use the 6px picker padding the input toolbar uses. Co-authored-by: Copilot <[email protected]>
Phones have no hover for the wider padding to frame, and the tray needs the room: with it, the branch picker dropped its label on a 390px phone. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Addressed feedback
#343370) * sessions: fix Send and chat binding regressions in the shared composer The shared composer (#342683) hosts a real ChatWidget bound to a chat model, which the previous composer never loaded before Send. - Cloud drafts: the legacy extension seeds a "no repository" placeholder when the draft chat loads, and the chat input's option validity check disabled Send even though the repository picker had a valid choice. Inputs whose host owns submission (hostSubmit) no longer check option validity, and the Copilot provider applies the draft's selections when its chat model is published, not only on send. - Cloud drafts used `owner/repo/HEAD` as the repository option id, which the extension saved as a recently selected repository. Use `owner/repo`. - With several chat groups open, the in-session new-chat composer bound and sent to the session's active chat, overwriting another chat's input. It now binds and sends to the chat its own group shows. Co-authored-by: Copilot <[email protected]> * sessions: keep inline references when the composer binds another draft Binding a new draft's chat model replaces the input with that model's state. The composer carried its text and attachments over, but not its inline references (such as `#file:` completions), so the next parse dropped them and the prompt was sent as plain text without the file. Carry the references over as the failed-send restore already does. Co-authored-by: Copilot <[email protected]> * sessions: drop the path fallback for a Cloud draft's repository option Cloud drafts are only created for GitHub repository roots, so `repoNwo` is always available. The root path fallback could only produce the `owner/repo/HEAD` form this PR fixes. Co-authored-by: Copilot <[email protected]> * chat: fix the tabbed model picker fixture's Fusion metadata type #343258 made `autoModelFusion` a boolean while #343324 set it to an object in this fixture, which breaks compilation on main. Same change as #343376. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
…er (#343378) * sessions: restore #session references for /troubleshoot in the composer #342683 replaced the Agents window composer input and dropped its `#session` completions. The workbench completions it now relies on skip agent-host chats, such as Copilot CLI sessions, and reference a session resource that the sessions management service does not resolve. So `/troubleshoot #session:<title>` could no longer point the skill at another session's event log. Provide `#session` completions in the shared composer again, listing the Copilot CLI sessions on the composer session's host. Accepting one adds an inline reference whose value the troubleshoot augmentation resolves. Co-authored-by: Copilot <[email protected]> * sessions: keep #session completions while typing a title, and scope them to the input model - Filter on the inserted `#session:<title>` text. The `#session <title>` filter text had no `:`, so the editor hid every suggestion once `#session:` was typed. - Offer completions only for the composer's own input model, not any model that shares its resource. Co-authored-by: Copilot <[email protected]> * chat: fix the tabbed model picker fixture's Fusion metadata type #343258 made `autoModelFusion` a boolean while #343324 set it to an object in this fixture, which breaks compilation on main. Same change as #343376. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
…view (microsoft#350681) * View editors: dispose the view before its instantiation service A view's content can still create instances while it is disposed, such as a chat input reacting to its text being reset. Disposing the view's scoped instantiation service first made that throw. The service is now disposed last. Co-authored-by: Copilot <[email protected]> * Chat widget: create the request parser once Clearing a chat input reparses it, and the widget created a new request parser through its instantiation service on every parse. When a whole editor group or auxiliary window closes, the group's scoped instantiation service disposes its children before the editor panes, so the New Session prompt options clearing their generated prompt on dispose threw "InstantiationService has been disposed". The widget now creates its parser once, in its constructor. The view editor pane registers the view's instantiation service right after creating it, in an outer store that disposes the view first. Co-authored-by: Copilot <[email protected]> * Chat widget: test closing a group or window with a chat input open Closing a group or window disposes the widget's instantiation service before the New Session prompt options clear the generated prompt (microsoft#342683); parsing the cleared input must not throw, and the draft saved on close stays empty. Co-authored-by: Copilot <[email protected]> * Clarify that view editors dispose the view first only when the editor closes Co-authored-by: Copilot <[email protected]> * chat: give the slash command test's fake widget the request parser it now creates once Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>

The Agents window had two chat inputs. Running sessions used the workbench
ChatWidget/ChatInputPart, while the new-session and new-chat composers usedNewChatInputWidget: a separate implementation of about 4,600 lines with its own editor, attachments, completions, slash commands, paste handling, voice wiring and Send button. Every input feature had to be built twice, and anything that targets "the chat input" (keybindings, commands, accessibility) skipped the composer. That is how this started: the model picker keybindings did nothing before a session existed.This PR deletes the separate composer. The new-session and new-chat composers now host the same
ChatWidgetas a running session, and only add what is specific to starting one.What we gain from unification
#references, agent host commands and skills,/commands, attachment pills, paste and drag and drop, input notices (tips, migrations, promotions), voice input and draft persistence all come from the shared input. Future chat input work reaches both surfaces without a port.How it works
SharedChatInputComposerrenders aChatWidgetbound to the draft session's chat model. The host still owns workspace selection, session creation and sending.ChatWidget/ChatInputPartgain small, generic host options, so an embedder can own parts of the input instead of forking it:submitHandler+hostSubmit: the host sends, and decides when Send is enabled and how it is labeled.hostModelSelection: the session provider owns the model; the input's model commands, picker and notifications act on it.deferredNotificationsEnabled,ownsDraftVoiceSession,menus.inputToolbarandinputPartHorizontalPadding.renderGettingStartedTip: falsenow leaves the tip slot to the host.Menus.NewSessionChatInputToolbarand action view items instead of being hand-built.github-remote-fileworkspaces moves from an agent-host-specific provider to the genericFileSystemFileSearchProvider.Behavior changes for reviewers
main.NewSessionConfigandNewSessionAttachContextmenus, and the old composer's custom OpenTelemetry status hover.How to test
In the Agents window:
/modelsopens the model picker and/blobbyopens Customize Blobby, without starting a session. A#file reference is sent with the prompt.sessions.chat.experimental.newSessionComposerLayouton, the controls move into the input, and the phone layout keeps the chip lane above the input.Validation on
61d0cbc63b2:npm run typecheck-clientnpm run eslint -- $(git diff --name-only --diff-filter=ACMR origin/main...HEAD -- '*.ts')node build/hygiene.ts $(git diff --name-only --diff-filter=ACMR origin/main...HEAD)npm run valid-layers-checknpm run check-cyclic-dependencies./scripts/test.sh --runGlob '{vs/sessions/contrib/chat/test/**/*.test.js,vs/sessions/contrib/providers/agentHost/test/**/*.test.js,vs/workbench/contrib/chat/test/browser/widget/**/*.test.js,vs/workbench/contrib/chat/test/browser/voiceClient/*.test.js,vs/workbench/services/search/test/common/*.test.js}'sessions/andchat), rendered in the component explorersessions/chatReferencesfailures also fail onmainThe changes were also checked live in Code OSS: model picker keybindings, Compare Models, slash commands, inline references, Add Context, send, the in-session composer, and the experimental layout toggle.