Skip to content

chat: make the dictation mic glow an ambient inner rim light - #327713

Draft
eli-w-king wants to merge 1 commit into
mainfrom
eli/agents/mic-button-animation-enhancements
Draft

chat: make the dictation mic glow an ambient inner rim light#327713
eli-w-king wants to merge 1 commit into
mainfrom
eli/agents/mic-button-animation-enhancements

Conversation

@eli-w-king

@eli-w-king eli-w-king commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Refines the dictation mic glow added in #327684. Refs https://github.com/microsoft/vscode-internalbacklog/issues/8607

Originally opened as a standalone implementation of #8607, before #327684 landed the same feature. Rebased and reworked as a focused refinement on top of it — the setupDictationMicGlow signature and all three call sites are unchanged.

What this changes

The glow today spreads outward from the button as a focusBorder-colored halo, and steps through four discrete intensity classes driven directly by each analyser frame. Two things fall out of that:

  • The stepping is visible as the level crosses a class threshold.
  • Tracking the waveform frame-for-frame reads as a level meter rather than as a microphone that is simply on.

This moves the light inside the button and smooths its response.

Before After
Placement Outward halo Inner rim light over a faint bloom
Level 4 discrete classes Continuous --dictation-mic-level
Response Raw per-frame intensity Asymmetric easing — fast attack, slow release
Color focusBorder chat.dictationActiveMicGlow (Voice Mode's listening blue)
Preparing Glow competes with the download ring Suppressed
Transcribing Cuts out when recording stops Winds down while the transcript lands

Why asymmetric easing

A symmetric filter follows your voice too literally — it reads as a VU display. Easing the rise faster than the fall (0.1 vs 0.035) makes the light swell into speech and drift back out of it, which is what makes it feel ambient. The level is also shaped (pow(level, 0.7) * 1.15, clamped) to lift quiet speech and keep loud speech from slamming opacity to full.

Color

chat.dictationActiveMicGlow defaults to the blue Voice Mode's listening glow uses, so dictation and Voice Mode read as one family. Deliberately not charts.blue — that resolves to editorInfoForeground (#1a5cff), a vivid indigo that reads as purple once softened into a wash.

Unchanged

  • setupDictationMicGlow(target, service, accessibilityService) and its three call sites (toolbar mic, voice-input pill cell, Agents composer button).
  • The high-contrast outline fallback.
  • Reduced motion: the glow still shows, held at a steady level, and the requestAnimationFrame loop never starts.
  • The glow remains a pseudo-element on the target, so hosts that rebuild their button contents keep it.

Testing

  • npm run typecheck-client, ESLint, stylelint, and a full npm run compile — all clean.
  • New unit tests cover phase resolution (including preparing suppressing the glow), the attack/release asymmetry, and level shaping at both ends of the range.
  • Verified live in Code OSS via CDP on the toolbar mic host.

Copilot AI review requested due to automatic review settings July 27, 2026 21:37

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 an audio-reactive ambient glow to indicate active chat dictation across workbench and Agents window microphone controls.

Changes:

  • Exposes live microphone levels through an AnalyserNode.
  • Adds reusable glow rendering, styling, theming, and reduced-motion behavior.
  • Adds unit coverage for glow phases and level shaping.
Show a summary per file
File Description
speechToText.test.ts Tests glow phase and level calculations.
dictationSession.test.ts Updates the speech-service test double.
chatColors.ts Registers the glow theme color.
voiceInputModeActionViewItem.ts Adds glow to the segmented dictation cell.
dictationSession.css Defines glow appearance and animation.
dictationMicGlow.ts Implements glow state and audio-level rendering.
dictationActionViewItem.ts Adds glow to toolbar microphones.
chatSpeechToTextService.ts Exposes a microphone analyser node.
newChatInput.ts Adds glow to the Agents composer microphone.
vscode-known-variables.json Registers new CSS variables for linting.

Review details

  • Files reviewed: 10/10 changed files
  • Comments generated: 4
  • Review effort level: Medium

Comment on lines +58 to +60
export function easeDictationMicLevel(current: number, target: number): number {
const rate = target > current ? LEVEL_ATTACK : LEVEL_RELEASE;
return current + (target - current) * rate;
Comment on lines +164 to +171
// With reduced motion the glow still shows, held at a steady level, so a
// hot microphone stays legible without any movement.
if (!active || this._accessibilityService.isMotionReduced()) {
this._stopAnimation();
this._applyLevel(active ? REDUCED_MOTION_LEVEL : 0);
return;
}
this._startAnimation();
Comment on lines +86 to +88
/* Slow fades in and out of the session, so the glow arrives and leaves as
light rather than as a state toggle. */
transition: opacity 420ms ease;
Comment on lines +851 to +854
const downloadRing = this._register(new MutableDisposable<DictationDownloadRing>());
// Audio-reactive "hot microphone" decoration. Created once and re-attached
// after each re-render below, since `renderState` clears the button.
const micGlow = this._register(new DictationMicGlow(button, sttService, this.accessibilityService));
@eli-w-king
eli-w-king force-pushed the eli/agents/mic-button-animation-enhancements branch from 0c44fdd to e731b01 Compare July 27, 2026 21:52
Refines the dictation mic glow added in #327684.

The glow currently spreads outward from the button as a focus-colored halo,
and steps through four discrete intensity levels driven directly by each
analyser frame. The stepping is visible as the level crosses a threshold, and
tracking the waveform frame-for-frame reads as a level meter rather than as a
microphone that is simply on.

Move the light inside the button and smooth its response:

- Light now gathers along the button's inner edge over a faint bloom, with the
  middle left clear so the glyph is never clouded.
- Replace the four level classes with a continuous `--dictation-mic-level`,
  eased asymmetrically (fast attack, slow release) so the glow swells into
  speech and drifts back out of it. The level is also shaped to lift quiet
  speech and clamp loud speech, keeping opacity in a narrow band.
- Add a `chat.dictationActiveMicGlow` theme color, defaulting to the blue Voice
  Mode's listening glow uses so the two features read as one family.
- Suppress the glow while the model is preparing, so it doesn't compete with
  the download ring, and wind it down while the final transcript lands rather
  than cutting out the moment recording stops.

The `setupDictationMicGlow` signature and its three call sites are unchanged,
as is the high-contrast outline fallback and the reduced-motion behavior (the
glow still shows, held at a steady level).

Refs microsoft/vscode-internalbacklog#8607

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eli-w-king
eli-w-king force-pushed the eli/agents/mic-button-animation-enhancements branch from e731b01 to 801cba1 Compare July 27, 2026 22:20
@eli-w-king eli-w-king changed the title chat: show an ambient glow on the mic while dictation is listening chat: make the dictation mic glow an ambient inner rim light Jul 27, 2026
@eli-w-king
eli-w-king requested a review from meganrogge July 27, 2026 23:28
@eli-w-king eli-w-king self-assigned this Jul 27, 2026
@eli-w-king eli-w-king added this to the 1.132.0 milestone Jul 27, 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.

2 participants