From ad8d9ca24042a25927ce049e8e248395f79b8a78 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Tue, 28 Jul 2026 20:46:31 -0700 Subject: [PATCH] [eric] voice: mic tap stops an active recording (async start ate the tap's press-end); composer mic tooltip shows the real dictation combo, not F5 --- .../src/app/pages/Dashboard/desktop/DesktopSpawnPill.tsx | 3 ++- frontend/src/shared/voice/VoiceDictationContext.tsx | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/pages/Dashboard/desktop/DesktopSpawnPill.tsx b/frontend/src/app/pages/Dashboard/desktop/DesktopSpawnPill.tsx index cac473c4..faffeaa4 100644 --- a/frontend/src/app/pages/Dashboard/desktop/DesktopSpawnPill.tsx +++ b/frontend/src/app/pages/Dashboard/desktop/DesktopSpawnPill.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useRef, useState } from 'react'; +import { comboDisplay, dictationDefaultCombo } from '@/app/pages/Settings/sections/general/ShortcutRecorderChip'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import Tooltip from '@mui/material/Tooltip'; @@ -160,7 +161,7 @@ function DesktopSpawnPill({ > - + { if (holdMode) { + // A TAP while recording must stop: the quick tap's press-end fires before the async start + // flips state to 'recording', so without this the mic could be started by a click but never + // stopped by one. + if (stateRef.current === 'recording') { heldRef.current = false; void stop(); return; } if (stateRef.current === 'idle') { heldRef.current = true; void start(); } } else { toggle(); } - }, [holdMode, start, toggle]); + }, [holdMode, start, stop, toggle]); const pressEnd = useCallback((): void => { if (holdMode && heldRef.current) {