Skip to content

Chat: onboarding spotlight tour for the Copilot harness chat input - #337814

Merged
Logan Ramos (lramos15) merged 20 commits into
microsoft:mainfrom
rfeltis:rfeltis-chat-onboarding-spotlight-tour
Oct 19, 2026
Merged

Logan Ramos (lramos15) merged 20 commits into
microsoft:mainfrom
rfeltis:rfeltis-chat-onboarding-spotlight-tour

Conversation

@rfeltis

@rfeltis Ralph Feltis (rfeltis) commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Adds an onboarding spotlight tour of the editor Chat input for new users of Copilot harness chats. It reuses the onboarding engine and spotlight primitives from the Agents window tours (workbench/contrib/onboarding).

Behavior

The tour can run when all of these are true:

  • The onb.chatInput onboarding experiment shows it, or onboarding.developerMode previews chat.onboarding.chatInput.
  • The Chat view shows a Copilot harness chat. The chat.defaultToCopilotHarness experiment makes that harness the default.
  • The user has never sent an editor chat message.

It has three steps, each described in no more than two short sentences:

  1. Model picker. Switch models to balance reasoning and cost.
  2. Agent mode. Opens the mode and permissions picker on its Agent mode section (Interactive / Plan / Autopilot).
  3. Permissions. The menu stays open. Agent mode collapses, and after a short pause the Permissions section expands.

The tour runs at most once per user. It is hidden when AI features are disabled (ChatContextKeys.enabled), does not start while a modal editor is open, and ends if one opens. Local harness chats never show it.

Implementation

  • chatOnboardingEligibility.ts: ChatOnboardingEligibility.eligibleChat is the visible Chat view showing a Copilot harness chat, when the user has never sent an editor chat message (the existing EditorChatUsage counter). It follows session switches and becomes ineligible once the user sends a message. It is separate from the tour UI.
  • chatInputSpotlightTour.ts: the tour scenario, its target providers, and the workbench contribution.
    • The scenario declares experiment: { behaviorFlag: 'onb.chatInput.show', assignmentContextIdFlag: 'onb.chatInput.id' }, so the engine gates it and attaches the onb- assignment context from the moment the tour would show, in every arm.
    • Its trigger is true only while the chat whose targets rendered is still eligible.
    • It joins its own run through runScenario so that a modal editor opening over it ends the tour.
  • AgentHostChatInputPicker: owns the section switching. showSection(section, token) opens the menu on a section, or, if the combined menu is already open, collapses the other section and expands this one after a pause. menuElement returns the open menu. ChatInputPart.getAgentHostPicker returns a narrow view of the mode or permissions picker and drops disposed pickers. The model step uses the existing getModelPickerControl().
  • Onboarding engine:
    • IOnboardingTarget.additionalElements (opt-in) highlights other elements with the target, such as the menu the mode button opens outside itself. The highlight covers them all, clicking the callout keeps focus in them so a menu that closes on blur stays open, Escape inside them is left to them, and the step is announced to screen readers because focus can move into them.
    • IOnboardingTarget.open receives the step's cancellation token, so work started by open stops when the step ends.
    • An automatic run that waited behind another presentation only starts if its when and trigger still hold. Otherwise it is dropped without being marked shown. This applies to every tour.
    • Unresolved experiment flags are read again on refetch. The engine still reads a scenario's two treatment flags at startup. While they are unresolved, it reads them again on every IAssignmentService.onDidRefetchAssignments, which tas-client fires when a fetch replaces its assignments. That includes the first fetch from the GitHub Copilot ExP endpoint, which VS Code only learns from the signed-in account's entitlements after startup; before that, flags from that workspace read as undefined. Once both flags resolve, the arm is fixed for the window. A refetch during a read in flight reads again after that read settles. No timers.

Caveat on the "never chatted" signal

chat.editorUsage.messages has only been recorded since #336792 (about Sept 18). Users who chatted before then look new until they send their next message.

ExP experiment

Chat: Onboarding tour for new Copilot harness users in the GitHub Copilot ExP workspace (githubdevdiv~vscodecopilotchat), assigned by devdeviceid. It moved from the legacy vscodeexpws workspace, where the old feature is now archived. Both experiments are created but not started. Start them after a Stable build with this change ships.

Progression Variants (onb.chatInput.show) Steps
A/A: no tour vs no tour onb-chat-input-aa-a (control, false) / onb-chat-input-aa-b (false) 5% / 5%
A/B: no tour vs spotlight tour onb-chat-input-ab-none (control, false) / onb-chat-input-ab-spotlight (true) 5% / 5% → 10% / 10% → 50% / 50%
  • Each variant sets onb.chatInput.id to its own variant id. The engine requires the onb- prefix and keeps the assignment context out of telemetry until the user reaches the tour, so no separate trigger event is needed. Scorecards compare the onb-chat-input-* assignment contexts.
  • Audience (both): extensionname IN ("vscode-core", "github.copilot-chat"); vscode_core_appversion >= 1.142.0; vscode_core_targetpopulation IN ("public"); vscode_core_windowkind IN ("editor"). Raise vscode_core_appversion if this ships later than 1.142.
  • Signed-out users: this workspace is served only once the user is signed in, because VS Code learns its endpoint from the account. Signed-out users get no assignment and no tour.
  • Traffic: both progressions share the feature's isolation group, so running experiments can use at most 100% of traffic together. Stop the A/A before the A/B moves to 50% / 50%.

Validation

  • Unit tests:
    • chatInputSpotlightTour.test.ts: readiness, targets, the experiment, combined and separate permission pickers, the step token reaching the picker, losing eligibility, and ending on a modal editor.
    • chatOnboardingEligibility.test.ts: harness, visibility, session switches, the new-user check and bypass, and sending a message.
    • agentHostChatInputPicker.test.ts: showSection opening a section, moving between sections, ignoring a cancelled request, and handing off between separate pickers.
    • onboardingService.test.ts: a queued automatic run that is no longer eligible is dropped without being marked shown, unresolved experiment flags are read again when assignments are refetched and then kept, and a refetch during a read in flight is not missed.
    • spotlightOverlay.test.ts: highlighting additional elements, keeping focus in them, and leaving Escape and Tab inside them to them.
    • The existing onboarding, picker, and Agents window tour tests pass.
  • Checks: typecheck-client, eslint, and build/hygiene.ts pass.
  • Proof in the real Code OSS Electron window under Xvfb in a Codespace, 1600x1000 H.264 at 60fps:
    • Copilot harness + developer mode: step 1 highlights the model picker. Step 2 opens the menu on Agent mode with its header focused. Next collapses Agent mode, then expands Permissions. Done closes the spotlight and the menu. Telemetry shows a completed 3-step tour with no active experiment.
    • Real ExP assignment, Chat open at startup, treatment (signed in, temporary single-device experiment in the new workspace, on f88b5f41a02): the first onb.chatInput.show read at 1.92s is unassigned, the GitHub endpoint answers at 2.35s, the refetch reads true / onb-chat-input-ab-spotlight at 2.36s, and the tour runs without the user opening Chat. scenarioShown reports the active experiment and its assignment context.
    • Real ExP assignment, Chat open at startup, control (same setup): the first read at 1.97s is unassigned, the refetch at 2.42s reads false / onb-chat-input-ab-none, no tour shows, and telemetry carries onb-chat-input-ab-none from the would-show moment.
    • Modal editor on step 3: clicking Configure Permissions in the open menu opens Settings in a modal editor. The spotlight and callout end immediately, the tour stays ended after the modal closes, and scenarioOutcome reports aborted on step 3.
    • Copilot harness, no experiment: no tour and no tour telemetry.
    • Local harness + developer mode: no tour and no tour telemetry.
    • Not run in the real window: the separate-pickers layout. Unit tests cover it.

Recording

Copilot harness with developer mode on ee118845f05, recorded at 60fps.

chat-onboarding-tour-proof.mp4
Copilot AI balanced review requested due to automatic review settings September 24, 2026 21:14

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

Eligibility can become stale across windows or while the tour is queued, causing it to appear for ineligible users.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds a two-step spotlight onboarding tour for the Chat view’s mode and model pickers.

Changes:

  • Registers the configurable onboarding scenario and eligibility trigger.
  • Exposes picker elements and editor-chat message counts.
  • Adds trigger, targeting, and eligibility tests.
File Description
workbench.common.main.ts Loads the tour contribution.
chatInputTour.test.ts Tests trigger and eligibility behavior.
editorChatUsage.ts Exposes the editor message count.
constants.ts Defines onboarding configuration values.
chatInputPart.ts Exposes rendered picker elements.
chatInputTour.contribution.ts Implements and registers the tour.

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

@rfeltis
Ralph Feltis (rfeltis) force-pushed the rfeltis-chat-onboarding-spotlight-tour branch from 69689b9 to 2b2f4d9 Compare September 28, 2026 23:15
@rfeltis Ralph Feltis (rfeltis) changed the title Chat: onboarding spotlight tour for the chat input Sep 28, 2026
@rfeltis
Ralph Feltis (rfeltis) force-pushed the rfeltis-chat-onboarding-spotlight-tour branch 4 times, most recently from 6aa0f1e to 216a05a Compare October 6, 2026 18:11

@lramos15 Logan Ramos (lramos15) left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work reusing the onboarding engine. The additionalElements extension to the spotlight is clean, opt-in, and well tested, and the tests and disposables follow our patterns.

Before merging, I'd like the lifecycle and keyboard/screen reader issues I left inline to be fixed, and I'd like to understand the experiment setup, because that decision accounts for a lot of the code here.

On size: this is ~1,180 lines (~600 production). I think 300–400 of those could go. You could use the engine's experiment support, move section switching into the picker, drop the single-entry experience table, and trim comments. About a fifth of the production lines are comments, and many of them restate the code or the PR description. I flagged a few inline, but the same applies elsewhere.

Ralph Feltis (rfeltis) and others added 14 commits October 9, 2026 14:18
Spotlights the mode picker (Agent/Ask/Plan) and model picker the first time a user who has never sent a chat message opens the Chat view. Gated by the new chat.onboarding.experience setting (none | spotlight), which is registered for ExP control.

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

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

Only show the chat onboarding tour for Copilot harness chats. The first two steps open the combined mode and permissions picker on its agent mode and permissions sections, and the spotlight highlights the open menu with its trigger through a new opt-in onboarding target popup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the mode and permissions menu open when the user clicks the spotlight callout, then collapse the agent mode section and expand the permissions section once the collapse has been visible.

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ChatOnboardingEligibility decides whether chat onboarding may run: a visible Chat view showing a Copilot harness chat, for a user who has never sent an editor chat message. The chat.onboarding.experience setting selects which experience runs on top of it, so experiences can be swapped or added without changing eligibility. The spotlight tour now only owns its steps, targets, and menu behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Log experimentTrigger for config.chat.onboarding.experience when a user with a real ExP assignment first becomes eligible for chat onboarding. The condition is the same in every arm, so a triggered scorecard, including an A/A that assigns the same value to two arms, compares the same population.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Extend show(anchor) with an optional openPermissions flag instead of adding a separate open() method.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Revert the IActionWidgetService interface additions, the exported mode picker section ids, the picker setSectionExpanded method, and EditorChatUsage.getMessageCount. The tour now switches menu sections with focusItemById and the existing collapse and expand section commands, reads the section ids from getModePermissionsPickerOptions, and reads the message count from getTelemetry. The spotlight relies on allowTargetInteraction and its existing layering instead of new popup-specific conditions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Use the onboarding engine's experiment support (onb.chatInput.show / onb.chatInput.id) instead of the chat.onboarding.experience setting and a separate experimentTrigger.
- Move section switching into AgentHostChatInputPicker.showSection, cancelled with the step's token passed to IOnboardingTarget.open.
- Start the tour only while its chat is still eligible, end it when a modal editor opens, and have the engine drop automatic runs that are no longer eligible after waiting behind another presentation.
- Leave Escape inside additional elements to them and announce the step to screen readers.
- Use getModelPickerControl, narrow the Agent Host picker lookup, and drop disposed pickers.
- Fold the contribution into the tour file, simplify eligibility tracking, and trim comments and tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@rfeltis
Ralph Feltis (rfeltis) force-pushed the rfeltis-chat-onboarding-spotlight-tour branch from a8c847c to e442df0 Compare October 9, 2026 21:19
…re refetched

Experiments in the GitHub Copilot ExP workspace are served by an endpoint that VS Code learns from the signed-in account's Copilot entitlements, after startup. Until then only the legacy endpoint is queried, so the flags of those experiments read as undefined and the experiment stayed inactive for the whole window.

Keep reading the flags at startup, and read them again on every IAssignmentService.onDidRefetchAssignments while they are unresolved. tas-client fires it (through the assignment context) when a client's fetch replaces its assignments, including the first fetch after the account's endpoint is added. Once both flags resolve the arm is fixed for the window. A refetch during a read in flight reads again after that read settles.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@rfeltis
Ralph Feltis (rfeltis) force-pushed the rfeltis-chat-onboarding-spotlight-tour branch from e442df0 to f88b5f4 Compare October 9, 2026 22:52

@lramos15 Logan Ramos (lramos15) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround, this is a big improvement. I checked each of my earlier threads against the new code and they're all addressed. The trigger now follows eligibility, the modal case is handled, the picker owns section switching behind a narrow API, and the tour uses the engine's experiment support. Production code is down to about 490 added lines, and the comments are much leaner.

What's left is mostly edge cases: how the open menu behaves when a step is cancelled or the user navigates with the mouse. I also have a question about the experiment refetch change in the shared engine, since it affects the Agents window tours too. Details are inline.

I haven't run this locally.

Comment on lines +574 to +582
// Another picker's menu, such as the separate mode picker's, stays visible until it finishes closing.
this._actionWidgetService.hide();
for (let attempt = 0; attempt < 20 && this._actionWidgetService.isVisible && !token.isCancellationRequested; attempt++) {
await timeout(50);
}
await this._showPicker(trigger, section === 'permissions');
if (token.isCancellationRequested) {
this._hidePicker();
} else if (this._pickerVisible && this.combinesPermissions) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the step is cancelled while we wait for the previous menu to close, for example when the user clicks Skip or Back right as step 2 opens, the loop exits but we still call _showPicker and then hide the menu right away. The menu flashes open, and onHide moves focus to the picker button. _showPicker also awaits item loading without checking the token. I'd return early if the token is cancelled before _showPicker, and check it again before the menu is shown. The current test only covers a token that's already cancelled up front.

@rfeltis Ralph Feltis (rfeltis) Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 29a0689. showSection now returns early if the step is cancelled while it waits for the previous menu to close. _showPicker also takes the token and checks it right before it shows the menu, so the menu no longer flashes open and focus does not move. A new test cancels the step both while the items load and while another picker's menu is still closing.

Comment on lines +241 to +246
this._stepListeners.add(addDisposableGenericMouseDownListener(this._callout, event => {
const activeElement = getActiveElement();
if (activeElement && additionalElements().some(element => element.contains(activeElement))) {
event.preventDefault();
}
}));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping focus in the menu across steps has a side effect when you leave the picker steps with the mouse. Going Back from step 2 to step 1, the overlay focuses Next, the menu closes on blur about 75 ms later, and the picker's onHide calls anchor.focus(). That puts focus on the mode button behind step 1's blocker, so Escape no longer reaches the tour and Tab moves through the workbench underneath. Ending the tour from step 2 or 3 with the mouse has the same problem: focus ends up on the picker button. Could the tour close the menu before it moves to a step that doesn't target the picker, and when the tour ends?

@rfeltis Ralph Feltis (rfeltis) Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 29a0689. Onboarding targets can now return an optional close(). The spotlight calls it before it shows a step for a different element (for example, going Back from step 2 to step 1) and when the tour ends. Both calls happen before the overlay restores focus, so the picker's onHide can no longer leave focus on the mode button. The chat tour closes the menu through a new picker.hideMenu(). In the combined layout, steps 2 and 3 target the same element, so the menu stays open between them. I added this to the README and an engine test.

const element = picker?.triggerElement;
return picker && element ? {
element,
open: token => picker.showSection(section, token ?? CancellationToken.None),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the separate mode and permissions layout (chat.experimentalModePermissionsPicker: false), choosing an option in step 2 or 3 makes _renderChip replace the trigger. The spotlight loses its target, shows the step again and calls open again, so the menu pops back open right after the selection. It isn't the default layout, but it may be worth opening only once per step.

@rfeltis Ralph Feltis (rfeltis) Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 29a0689. The chat tour now opens each picker at most once per step. The guard resets at the start of each step, and it only stays set if the menu actually opened, so a step whose first open was cancelled can still try again. I kept this in the tour instead of the engine because an existing engine test relies on the engine reopening a replaced picker for other tours.

// joins the existing run instead of scheduling a second one.
const queued = this._queue.find(entry => entry.scenario.id === scenario.id);
if (queued) {
queued.automatic &&= automatic;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small one: a manual runScenario only clears automatic while the entry is still in _queue. Once _doPump has moved it to _inflight and it's waiting for the presentation slot, a manual join keeps the captured automatic = true. The re-check below can then abort a run that was explicitly requested. Keeping the flag on a run record that both paths can update would fix it.

@rfeltis Ralph Feltis (rfeltis) Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 29a0689. Queued and in-flight runs now share one run record. A manual runScenario clears automatic in either state, and the eligibility check reads the flag when the presentation slot opens. I added a test for a manual join while the run waits for the slot. It fails on the old code.


private async _setSectionExpanded(headerId: string, expanded: boolean): Promise<void> {
this._actionWidgetService.focusItemById(headerId);
await this._commandService.executeCommand(expanded ? 'expandSectionCodeAction' : 'collapseSectionCodeAction');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: ActionWidgetService already has collapseSection() and expandSection(). Exposing them on IActionWidgetService would avoid running the keybinding commands by id, and the new ICommandService dependency.

@rfeltis Ralph Feltis (rfeltis) Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 29a0689. collapseSection() and expandSection() are now on IActionWidgetService, and the picker no longer depends on ICommandService.

@rfeltis
Ralph Feltis (rfeltis) marked this pull request as ready for review October 12, 2026 18:48
- Return early from showSection when the step is cancelled while the
  previous menu closes or items load, so the menu no longer flashes open.
- Add an optional close() to onboarding targets. Spotlight tours call it
  before a step for another element and when the tour ends, before the
  overlay restores focus, so the picker no longer takes focus from the tour.
- Open each chat tour picker only once per step, so a selection that
  replaces the separate picker's trigger does not reopen its menu.
- Keep the automatic flag on a run record shared by the queue and the
  in-flight run, so an explicit runScenario always clears it.
- Expose collapseSection/expandSection on IActionWidgetService and drop
  the ICommandService dependency from the picker.

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

Copy link
Copy Markdown
Contributor Author

Logan Ramos (@lramos15) thanks for the second pass. All five threads are addressed in 29a0689.

About your question on the experiment refetch change in the shared engine: the engine reads the flags again only for scenarios whose flags have not resolved yet. Once both flags resolve, the scenario's state stays fixed for the rest of the session, so a refetch cannot move an Agents window tour into or out of treatment mid-session. The only change for those tours is this: if their flags were missing at startup, they now resolve when that endpoint's assignments arrive, instead of staying inactive until the next reload.

…ng-spotlight-tour

# Conflicts:
#	src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatInputPicker.test.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lramos15
Logan Ramos (lramos15) enabled auto-merge (squash) October 19, 2026 13:12
@lramos15
Logan Ramos (lramos15) merged commit 2230821 into microsoft:main Oct 19, 2026
36 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants