Skip to content

Automations: Management UI (create/edit dialog, list widget, ChatInputPart integration)#323914

Draft
benvillalobos wants to merge 7 commits into
mainfrom
bv/automations-3-ui
Draft

Automations: Management UI (create/edit dialog, list widget, ChatInputPart integration)#323914
benvillalobos wants to merge 7 commits into
mainfrom
bv/automations-3-ui

Conversation

@benvillalobos

@benvillalobos benvillalobos commented Jul 1, 2026

Copy link
Copy Markdown
Member

Automations PR 3 (Management UI)

Context

This is part of a 4-PR stack adding scheduled agentic tasks to VS Code:

This PR adds the surfaces users interact with to configure and manage their automations.

Changes Made

New files:

File Purpose
automationDialog.ts Modal dialog for creating/editing automations. Embeds ChatInputPart for prompt editing, plus workspace, isolation, branch, model, mode, permission, and schedule pickers.
automationDialogService.ts Validates form input and bridges the dialog to the management service.
automationSessionTypeProvider.ts Resolves available session types (Local, Background) per folder.
automationsListWidget.ts List widget in the AI Customization editor. Toggle, run-now, edit, delete, run history.
workspacePickerInputActionItem.ts ActionViewItem wrapper rendering the workspace picker as a toolbar chip.

ChatInputPart extensions:

  • Per-surface input state isolation via widgetViewKindTag storage keys so drafts don't bleed across surfaces.
  • resetLanguageModelToDefault() tears down pending persisted-model waiters and resets to location default.
  • secondaryToolbarActionViewItemProvider option lets hosts inject toolbar items via the menu system.
  • storeSelection parameter honored in setChatMode2 (previously dead code).
  • hideCustomChatModes option filters the mode picker to built-in modes only.

WorkspacePicker refactor (sessionWorkspacePicker.ts):

  • Multi-trigger support. Trigger elements can be independently added and removed without resetting picker state (needed for toolbar re-layouts).
  • IChatInputWorkspacePicker interface for ChatInputPart integration.
  • renderTrigger() / removeTrigger() lifecycle for managed trigger elements.

Model picker improvements (chatModelPicker.ts):

  • getCategoryLabel defensive typeof guard for provider-supplied metadata.
  • Session-type model memory. Remembers last-used model per session type.
  • Configured-default override logic for enterprise policy compliance.

Architecture

The dialog embeds ChatInputPart for the prompt surface and uses the structured menu system to inject custom toolbar items:

automationDialog.ts
  |- Creates scoped InstantiationService + ContextKeyService
  |- Sets ChatContextKeys.inAutomationsDialog = true
  |- Instantiates ChatInputPart with automations-specific options
  |     |- workspacePickerInput (folder chip in primary toolbar)
  |     |- secondaryToolbarActionViewItemProvider (harness + isolation chips)
  |     |- sessionTypePickerDelegate (session type binding)
  |     '- hideCustomChatModes: true
  '- Registers actions on MenuId.ChatInputSecondary
        |- OpenAutomationsHarnessChipAction (static "Copilot CLI" label)
        '- OpenAutomationsIsolationGroupAction (worktree/folder picker + branch)

The list widget integrates with the AI Customization management editor as a dedicated section, following the same patterns as prompts/instructions/hooks sections.

Testing

  • automationsListWidget.test.ts covers list rendering, enable/disable toggle, delete with confirmation, run-now success/failure/cleanup, edit dialog error paths, create dialog flows.
  • chatModelPicker.test.ts covers resetLanguageModelToDefault and category label guard.
  • customizationHarnessService.test.ts covers harness availability checks.
Copilot AI review requested due to automatic review settings July 1, 2026 18:16

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 the “Automations” management UI surfaces to the Chat/AI Customization area of VS Code, including a new Automations section in the AI Customization Management Editor, supporting widgets, and required accessibility plumbing. It also extends several existing chat input/picker and customization-harness pathways to support the new dialog/list experiences and storage-source filtering behavior.

Changes:

  • Introduces an Automations list widget + accessibility help, and wires a new Automations section into the AI Customization Management Editor.
  • Extends customization harness descriptors with per-type storage source filtering and applies those filters when enumerating customization items/locations.
  • Updates chat input/picker infrastructure (model picker, mode picker, workspace picker, session target picker) and persists the last-used editor chat session type to improve new editor chat defaults.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/common/customizationHarnessService.test.ts Updates harness tests to cover new storage source filter behavior.
src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts Updates model picker tests for signature changes and adds ChatInputPart regression coverage.
src/vs/workbench/contrib/chat/test/browser/automations/automationsListWidget.test.ts Adds unit tests for the new Automations list widget behavior.
src/vs/workbench/contrib/chat/test/browser/automations/automationsAccessibilityHelp.test.ts Adds tests for the Automations accessibility help provider and content.
src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationListWidget.test.ts Updates AI customization list widget test harness descriptors for storage source filtering.
src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationItemsModel.test.ts Updates items-model tests for harness storage source filter support.
src/vs/workbench/contrib/chat/common/customizationHarnessService.ts Adds getStorageSourceFilter to harness descriptors and defines an empty filter/descriptor default.
src/vs/workbench/contrib/chat/common/constants.ts Adds last-used editor session type storage key and new “new editor chat” session-type resolution helpers.
src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.ts Adds Automations section id and introduces a storage-source filter type + helpers.
src/vs/workbench/contrib/chat/common/actions/chatContextKeys.ts Adds a context key for the automations dialog host (inAutomationsDialog).
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts Uses stored last-used session type when choosing the default resource for new chat editors.
src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerInputActionItem.ts Adds a toolbar-chip ActionViewItem wrapper for a workspace picker hosted by ChatInputPart.
src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.ts Adds optional delegate visibility filtering and a setting-driven hide for a specific background provider in the editor picker.
src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.ts Refactors sandbox toggle wiring and sandbox setting reads/updates.
src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.ts Supports session-less hosts via direct setMode callback and exports built-in-mode predicate.
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts Adjusts model picker item construction/signature, hover content, config descriptions, and UBB/PRU presentation logic.
src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.ts Records last-used non-local session type into profile storage based on focused widgets.
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.ts Updates hover content call site after hover API changes and drops opener dependency.
src/vs/workbench/contrib/chat/browser/chat.ts Adds IChatInputWorkspacePicker and a session type picker visibility hook on the delegate.
src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.ts Applies harness-provided source filters when returning customization items.
src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.ts Refactors customization target directory selection logic and provider construction.
src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.ts Adds the Automations list widget implementation (virtualized list, actions, history UI, layout).
src/vs/workbench/contrib/chat/browser/aiCustomization/automationsAccessibilityHelp.ts Adds the Automations accessibility help implementation and help-content builder.
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.ts Adds the Automations section, gates it behind setting, and refactors target directory picking for manual creation.
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts Renames manual-create target from localworkspace to match new editor logic.
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.ts Instantiates PromptsServiceCustomizationItemProvider with access to the active harness descriptor.
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.ts Registers a new icon for Automations.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.ts Updates harness hidden-sections logic and provides a default storage source filter.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts Simplifies directory item grouping and removes per-item badges/tooltips in this provider.
src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts Adds an automations-dialog workspace picker action surfaced in the chat input menu when in the dialog.
src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts Adds accessibility.verbosity.automations setting for the new help provider.
src/vs/workbench/api/browser/mainThreadChatAgents2.ts Updates extension-contributed harness descriptors to include a default storage source filter.
src/vs/sessions/contrib/sessions/test/browser/aiCustomizationShortcutsWidget.fixture.ts Updates sessions fixture harness descriptor with storage source filter.
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostCustomizationHarness.test.ts Updates remote agent host harness tests to supply a storage source filter.
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostCustomizationHarness.ts Provides a sessions-layer harness descriptor implementation of storage source filtering.
src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts Adds multi-trigger support and better anchor handling for workspace picker triggers.
src/vs/sessions/contrib/automations/browser/automationSessionTypeProvider.ts Adds a sessions-layer provider that resolves available automation session types per folder.
src/vs/sessions/contrib/automations/browser/automations.contribution.ts Registers automations-related singletons and registers the Automations accessibility help provider.
src/vs/sessions/contrib/automations/browser/automationDialogService.ts Adds sessions-layer dialog service bridging workbench UI and sessions-layer session-type resolution.
src/vs/platform/actions/common/actions.ts Adds a new MenuId for automations dialog input contributions.
src/vs/platform/accessibility/browser/accessibleView.ts Adds a new AccessibleView provider id for Automations.
src/vs/base/browser/ui/dialog/dialog.ts Adds isExternalFocusAllowed to support popups/pickers hosted outside dialog DOM.

Review details

  • Files reviewed: 45/45 changed files
  • Comments generated: 14
  • Review effort level: Low
Comment thread src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts Outdated
Comment thread src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts Outdated
Comment thread src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts Outdated
Comment thread src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts Outdated
Comment thread src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts Outdated

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.

Review details

  • Files reviewed: 43/43 changed files
  • Comments generated: 4
  • Review effort level: Low
Comment thread src/vs/platform/accessibility/browser/accessibleView.ts
Comment thread src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.ts Outdated
@benvillalobos benvillalobos force-pushed the bv/automations-3-ui branch 2 times, most recently from bddc808 to c14a631 Compare July 1, 2026 20:57
benvillalobos and others added 7 commits July 1, 2026 14:24
…g, modal polish

Adds the complete automations management interface:
- AutomationsListWidget: WorkbenchList-based view with run status, dynamic row heights
- Create/Edit dialog: ChatInputPart-hosted prompt editor with ghost text
- WorkspacePicker integration for folder selection
- Isolation mode dropdown (Worktree/Folder via ActionListWidget)
- Static 'Copilot CLI' harness chip (future picker placeholder)
- Schedule configuration (Manual/Hourly/Daily/Weekly with time/day pickers)
- Permission level and model selection via ChatInputPart toolbar
- CSS styling matching form field backgrounds to prompt editor
- PlaceholderTextContribution registered on ChatInputPart editor
- List widget tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a hover highlight and remove the redundant chevron so the isolation
chip matches the new-session picker. Fix the chip showing 'Folder' for an
unset isolation mode: the label now derives from !== 'workspace', so an
undefined mode reads as 'Worktree' to match the picker, provider, and run
defaults (previously it lied and the session ran as a worktree).
The stylelint rule flags --vscode-agents-fontWeight-medium as unknown.
Only regular and semiBold are registered in vscode-known-variables.json.
Use semiBold for form labels — visually equivalent for this context.
…bug fixes

- Remove 33 em dashes from comments (AI slop pattern)
- Compress 5 over-length JSDoc blocks to 1-2 sentences
- Fix semicolons-as-conjunctions in comments
- Track rAF via MutableDisposable (use-after-dispose fix)
- Switch runNow to CancellationToken.None (phantom CTS removal)
- Restore defensive typeof guard in getCategoryLabel
- Re-add ILabelService for URI display in remote contexts
- Add tests: openEditDialog error, openCreateDialog, runNow failure, resetLanguageModelToDefault
- Add race-safety comment in createSessionTypeBinder
…enu-driven actions

Migrate the harness chip and isolation group from DOM surgery
(querySelector on ChatInputPart internals) to the structured
MenuId + actionViewItemProvider pattern used by the New Session Page.

- Register OpenAutomationsHarnessChipAction on MenuId.ChatInputSecondary
- Register OpenAutomationsIsolationGroupAction on MenuId.ChatInputSecondary
- Gate both with ChatContextKeys.inAutomationsDialog context key
- Add secondaryToolbarActionViewItemProvider to IChatInputPartOptions
- Route custom items in ChatInputPart secondary toolbar provider
- Remove querySelector and eslint-disable-next-line comments
… saved modes

- setChatMode2 now gates _syncInputStateToModel behind storeSelection,
  preventing unintended persistence of transient mode changes.
- automationDialog detects when a saved mode is hidden by the
  hideCustomChatModes filter and falls back to default instead of
  setting up an infinite retry watcher.

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.

Review details

  • Files reviewed: 42/42 changed files
  • Comments generated: 3
  • Review effort level: Low
Comment on lines +57 to +62
export interface IStorageSourceFilter {
/**
* Which storage groups to display (e.g. workspace, user, extension, builtin).
*/
readonly sources: readonly AICustomizationSource[];
}
Comment on lines 326 to +328
// Onboarding spotlight target — id is referenced by the "new session" tour
// in vs/sessions/contrib/onboardingTours.
this._renderDisposables.add(markOnboardingTarget(trigger, 'sessions.newSession.workspacePicker'));
triggerDisposables.add(markOnboardingTarget(trigger, 'sessions.newSession.workspacePicker'));
Comment on lines +687 to +694
const period = hour < 12 ? 'AM' : 'PM';
const hour12 = hour === 0 ? 12 : (hour > 12 ? hour - 12 : hour);
const minuteText = minute.toString().padStart(2, '0');
options.push({
hour,
minute,
label: `${hour12}:${minuteText} ${period}`,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants