Skip to content

automations: move Agent/Model pickers into the automation dialog composer - #337590

Merged
Ben Villalobos (benvillalobos) merged 10 commits into
mainfrom
automation-dialog-fixture
Sep 24, 2026
Merged

Ben Villalobos (benvillalobos) merged 10 commits into
mainfrom
automation-dialog-fixture

Conversation

@benvillalobos

@benvillalobos Ben Villalobos (benvillalobos) commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Fixes #336999

Back to this style, while keeping workspace / worktree / session type above the prompt field.

image

What

  • Move the Agent and Model pickers inside the Automation dialog's prompt composer.
  • Keep execution mode and permissions directly below the prompt, removing the redundant "Session configuration" heading.
  • Leave the Target row (workspace, session type, and worktree controls) unchanged.
  • Add component fixtures for the dialog

How

Reuse the existing Automation input-toolbar menu and the chat input's responsive toolbar while retaining the provider-draft-backed model/configuration behavior. Update the related accessibility help and regression tests.

Scope

This PR is limited to picker placement and its required wiring, accessibility, and tests. The new dialog component fixture is deferred to follow-up work because its shared-bundle CSS ordering affected unrelated screenshots. The existing Cloud provider label is preserved. There are no global chat-background or screenshot-baseline changes.

Validation

  • 72 focused Automation dialog, Model picker, and Agent Host picker tests pass.
  • 3 targeted provider session-type tests pass after restoring the Cloud label.
  • npm run typecheck-client, targeted ESLint, git diff --check, and commit-time hygiene pass.
  • The four affected assistant-response fixtures render and dispose without errors.
  • Earlier live Agents-window validation covered picker selection, keyboard navigation, save/reopen persistence, and desktop/narrow/light/high-contrast layouts.
  • Screenshots & Tests passes for the narrowed change set.

Relocate the Agent mode and Model pickers from the standalone Session configuration toolbar into the chat input composer, matching how the New Chat composer surfaces the same controls. Execution mode and permissions remain below the prompt, and the now-redundant Session configuration header is removed.

- �utomationDialog.ts reuses ChatInputPart.inputToolbarElement as the embedded Agent/Model lane and keeps execution/permission controls in a separate labelled group below the prompt.
- chatInputPart.ts exposes the existing input toolbar element as a narrow, reusable getter.
- modelPicker.ts and �gentHostAgentPicker.ts contribute Agent/Model actions to the new Menus.AutomationsDialogInputToolbar menu, with responsive/compact support for the embedded layout.
- mobileChatInputConfigPicker.ts registers the combined phone picker against the same menu so phone layout stays equivalent.
- �utomationsAccessibility.ts documents the new control layout in the dialog's accessibility help.
- Tests updated/extended to cover embedded vs. below-input placement, accessible grouping, and menu gating on desktop vs. phone.
The New Session and Automation dialog pickers showed the cloud-hosted agent as \Cloud\, which reads as an infrastructure detail rather than the product name users pick. Rename the label to \Copilot\ to match how it's presented elsewhere.
Adds a component-explorer fixture for the automation dialog's Default
and Populated states, exercising the real `renderForm` export and a
real `Dialog` instance (matching `externalSessionBanner.fixture.ts`'s
precedent) rather than hand-built dialog chrome.

Follows existing fixture conventions:
- Agent-mode and execution/permission chips use plain synthetic
  `FixtureMenuService` entries (matching `newChatWidget.fixture.ts` /
  `renderChatInput.ts`), avoiding a non-provider fixture importing
  provider-specific picker contribution classes across the layer
  boundary.
- The Model picker keeps its real `AutomationModelPickerContribution`
  (a legitimate same-layer, non-provider import), preserving the real
  thinking-effort/context config-summary chip (e.g. "GPT-5.4 · High ·
  872K").

`modelPicker.ts`'s `AutomationModelPickerContribution` stays exported
so the fixture can instantiate it directly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 23, 2026 23:49

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.

Copilot review overview

🔵 Needs a closer look

Agent and mobile pickers become inaccessible when moved into the toolbar overflow.

Review effort: Balanced
Findings: None

What changed in this PR

Aligns the Automation dialog composer with New Session and adds fixture coverage.

Changes:

  • Moves Agent/Model pickers into the prompt toolbar.
  • Moves execution/permission controls below the prompt.
  • Updates Copilot labeling, accessibility help, tests, and fixtures.
File Review
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatInputPart.ts Exposes the input toolbar element.
src/​vs/​sessions/​contrib/​sessions/​browser/​views/​automationsAccessibility.ts Updates help text, but should clarify arrow-key navigation within toolbars.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​test/​browser/​copilotChatSessionsProvider.test.ts Updates label expectations.
src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​browser/​copilotChatSessionsProvider.ts Renames the Cloud label to Copilot.
src/​vs/​sessions/​contrib/​providers/​agentHost/​test/​browser/​agentHostAgentPicker.test.ts Tests automation toolbar contributions.
src/​vs/​sessions/​contrib/​providers/​agentHost/​browser/​mobile/​mobileChatInputConfigPicker.ts Adds mobile picker support, but lacks overflow activation support.
src/​vs/​sessions/​contrib/​providers/​agentHost/​browser/​agentHostAgentPicker.ts Adds Agent picker support, but lacks overflow activation support.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​modelPicker.test.ts Tests model picker registration and responsiveness.
src/​vs/​sessions/​contrib/​chat/​browser/​modelPicker.ts Adds the Automation Model picker contribution.
src/​vs/​sessions/​contrib/​automations/​test/​browser/​automationDialog.test.ts Verifies the revised layout and accessibility state.
src/​vs/​sessions/​contrib/​automations/​test/​browser/​automationDialog.fixture.ts Adds default and populated themed fixtures.
src/​vs/​sessions/​contrib/​automations/​browser/​media/​automationDialog.css Styles the revised layout.
src/​vs/​sessions/​contrib/​automations/​browser/​automationDialog.ts Reorganizes composer and session controls.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Base: ceeb50ec Current: c72f4d10

No screenshot changes.

…at changes

Merging main brought in an upstream refactor that moved 'changes'/'changesets' from ISession to IChat. The fixture's mock ISession still overrode them, and its mock ISession.modelId/mode were derived from another mocked class's same-named properties (chat.modelId/chat.mode) rather than independent literals like every other override in that class - both trigger TS4113 (override modifier target not found) under tsgo/tsc on the merged tree even though the interfaces do declare those members. Fixed by giving session.modelId/session.mode their own constObservable(...) literals (matching the rest of the class) and moving the changes/changesets mocks onto the chat object, which is what production code (readSessionChangesStats) actually reads from.
@benvillalobos Ben Villalobos (benvillalobos) changed the title sessions: move Agent/Model pickers into the automation dialog composer automations: move Agent/Model pickers into the automation dialog composer Sep 24, 2026
Defer the new Automation dialog fixture and its export-only adaptation to follow-up work because its shared-bundle CSS ordering changes unrelated screenshots. Restore the existing Cloud provider label. Keep this PR focused on picker placement, required wiring, accessibility, and tests without changing global chat backgrounds or screenshot baselines.

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

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.

Copilot review overview

🟡 Changes recommended

The actual picker toolbar remains unnamed for assistive technologies while another control receives duplicate labeling.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread src/vs/sessions/contrib/automations/browser/automationDialog.ts Outdated
Preserve main's picker DOM/control access for Try this and its regression tests while retaining the Automation-only toolbar contributions and responsive wiring. Resolve the two model-picker conflicts by combining both sets of imports and test suites.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Forward the prompt toolbar label through ChatInputPart to the existing ActionBar API and remove redundant wrapper group roles. Assert the names on real nested toolbars and ensure each label appears only once.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@benvillalobos
Ben Villalobos (benvillalobos) marked this pull request as ready for review September 24, 2026 20:55
@benvillalobos
Ben Villalobos (benvillalobos) merged commit b7b87a7 into main Sep 24, 2026
35 checks passed
@benvillalobos
Ben Villalobos (benvillalobos) deleted the automation-dialog-fixture branch September 24, 2026 21:05
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 24, 2026
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.

Automations View: Should show pickers like in new session view

3 participants