Skip to content

Only show onboarding microphone picker once a real mic is detected - #328851

Merged
meganrogge merged 5 commits into
mainfrom
copilot/fix-microphone-picker-issue
Aug 3, 2026
Merged

Only show onboarding microphone picker once a real mic is detected#328851
meganrogge merged 5 commits into
mainfrom
copilot/fix-microphone-picker-issue

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

The voice-mode and dictation onboarding cards could render the microphone picker before device names were available, showing a blank selected mic or "Unknown device" rows.

Both cards guard picker rendering behind a "wait for real labels" check, but that check inspected IMicrophoneOption.label — which buildMicrophoneOptions() always fills with an "Unknown device (…)" fallback, making it unconditionally truthy. As a result the guard never fired, and a multi-mic picker rendered blank before microphone permission was granted.

  • Gate on raw device labelsrefreshMicrophones() in both dictationOnboarding.ts and voiceModeOnboarding.ts now bails when there are multiple options but no MediaDeviceInfo reports a real label:

    if (options.length > 1 && !devices.some(device => device.kind === 'audioinput' && device.label)) {
        return;
    }

    The picker stays hidden until named mics are detected, then renders (and keeps updating via the existing devicechange listener). A single mic still never shows a picker.

  • Dropped the this.options.length > 1 precondition that previously let the first render slip through unlabeled, so the gate applies from the initial refresh.

  • Test — added coverage asserting the dictation picker stays hidden while mics are unlabeled and appears with correct options once a real label lands.

Copilot AI requested review from Copilot and removed request for Copilot August 3, 2026 21:21
Copilot AI linked an issue Aug 3, 2026 that may be closed by this pull request
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot August 3, 2026 21:30
Copilot AI changed the title [WIP] Fix microphone picker display in voice mode Only show onboarding microphone picker once a real mic is detected Aug 3, 2026
Copilot AI requested a review from meganrogge August 3, 2026 21:31
@meganrogge
meganrogge marked this pull request as ready for review August 3, 2026 21:41
Copilot AI review requested due to automatic review settings August 3, 2026 21:41
@meganrogge
meganrogge enabled auto-merge (squash) August 3, 2026 21:42

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

Fixes premature microphone picker rendering before device labels are available.

Changes:

  • Gates both onboarding pickers on real microphone labels.
  • Adds dictation regression coverage for dynamic label availability.
Show a summary per file
File Description
dictationOnboarding.ts Defers dictation picker rendering.
voiceModeOnboarding.ts Defers Voice Mode picker rendering.
dictationOnboarding.test.ts Tests unlabeled-to-labeled behavior.

Review details

Suppressed comments (1)

src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.ts:780

  • The regression test covers only DictationOnboardingBanner, but this independent Voice Mode branch can still regress unnoticed even though the issue and PR explicitly cover both cards. Please add the equivalent unlabeled-to-labeled picker test in agentsVoice/test/browser/voiceModeOnboarding.test.ts.
		if (options.length > 1 && !devices.some(device => device.kind === 'audioinput' && device.label)) {
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread src/vs/workbench/contrib/chat/browser/speechToText/dictationOnboarding.ts Outdated
Comment thread src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.ts Outdated
Comment thread src/vs/workbench/contrib/chat/test/browser/dictationOnboarding.test.ts Outdated
@meganrogge meganrogge added this to the 1.132.0 milestone Aug 3, 2026
meganrogge and others added 3 commits August 3, 2026 17:49
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@meganrogge
meganrogge merged commit ea96948 into main Aug 3, 2026
29 checks passed
@meganrogge
meganrogge deleted the copilot/fix-microphone-picker-issue branch August 3, 2026 23:14
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.

Microphone picker shows when there's only one mic but shouldn't

5 participants