From 93faf387d2ecd16e37d6d77fadb493c085c6cc27 Mon Sep 17 00:00:00 2001
From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
Date: Mon, 12 Oct 2026 17:01:02 -0400
Subject: [PATCH] fix(composer): move the mobile dictation button off the
floating controls
On mobile the dictation button sat at the right edge of the composer, directly
below the floating cluster (Stop, Clear, TTS pill) anchored to the composer's
top-right corner, so the two were adjacent touch targets. Render the dictation
button ahead of the composer tools menu so it takes the slot one position left.
The reorder exposed a latent bug: renderVoiceButton attaches the same
voiceButtonContainerRef for both variants, so the last one rendered owns it.
The desktop variant is always rendered (CSS-hidden below md), so moving the
mobile variant first handed the ref to the desktop container and the
outside-press guard stopped recognising the mic, ending the recording on the
first tap. Render the desktop variant only at desktop widths so exactly one
voice container exists in the DOM.
---
frontend/src/components/message/PromptInput.tsx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/frontend/src/components/message/PromptInput.tsx b/frontend/src/components/message/PromptInput.tsx
index c54293bd..eb26a960 100644
--- a/frontend/src/components/message/PromptInput.tsx
+++ b/frontend/src/components/message/PromptInput.tsx
@@ -1648,6 +1648,9 @@ return (
>
+ {showMobileVoiceButton && (
+ renderVoiceButton('mobile')
+ )}
{isMobile && directory && (
void startVoiceRecording() : undefined}
/>
)}
- {sttEnabled && sttSupported && (
+ {!isMobile && sttEnabled && sttSupported && (
renderVoiceButton('desktop')
)}
- {showMobileVoiceButton && (
- renderVoiceButton('mobile')
- )}
{!showMobileVoiceButton && (