From 377e3c2784f5dc3b05532d1c119693cbf0eda871 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Mon, 12 Oct 2026 16:39:29 -0400 Subject: [PATCH] fix(composer): size mobile controls for touch and fill the action row The mobile composer mixed 32-38px controls with the 44px dictation button, so the action row changed height between the empty (mic) and typed (Send) states, and most controls sat below the 44px touch target. Raise the mic, Send, tools, agent, model, Latest and keybar controls to 44px on mobile and pin the mic to the right edge of its container. Let the model button fill the row by growing its left-hand group, which was content-sized and left the model button's flex-1 with nothing to grow into. Desktop sizes are unchanged through md: guards. The mobile mic is located in tests through a data-voice-variant attribute rather than Tailwind sizing classes. --- .../src/components/agent/AgentQuickSelect.tsx | 2 +- .../components/message/ComposerToolsMenu.tsx | 2 +- .../message/PromptInput.stt.test.tsx | 4 ++-- .../src/components/message/PromptInput.tsx | 22 ++++++++++--------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/agent/AgentQuickSelect.tsx b/frontend/src/components/agent/AgentQuickSelect.tsx index fad74bdb..73a9a8aa 100644 --- a/frontend/src/components/agent/AgentQuickSelect.tsx +++ b/frontend/src/components/agent/AgentQuickSelect.tsx @@ -55,7 +55,7 @@ export function AgentQuickSelect({ const buttonContent = ( diff --git a/frontend/src/components/message/ComposerToolsMenu.tsx b/frontend/src/components/message/ComposerToolsMenu.tsx index 2eca8b33..e29c9254 100644 --- a/frontend/src/components/message/ComposerToolsMenu.tsx +++ b/frontend/src/components/message/ComposerToolsMenu.tsx @@ -41,7 +41,7 @@ export function ComposerToolsMenu({ type="button" aria-label="Composer options" title="Composer options" - className={getIconToggleButtonClassName(permission.isAuto || goalArmed)} + className={`${getIconToggleButtonClassName(permission.isAuto || goalArmed)} flex items-center justify-center min-h-[44px] min-w-[44px]`} > diff --git a/frontend/src/components/message/PromptInput.stt.test.tsx b/frontend/src/components/message/PromptInput.stt.test.tsx index a6314b7e..7648d638 100644 --- a/frontend/src/components/message/PromptInput.stt.test.tsx +++ b/frontend/src/components/message/PromptInput.stt.test.tsx @@ -244,7 +244,7 @@ describe('PromptInput STT Gesture Tests', () => { if (voiceButtons.length === 0) { throw new Error('No voice button found. Available buttons: ' + allButtons.map(b => b.getAttribute('title')).join(', ')) } - const mobileButton = voiceButtons.find((btn) => btn.className.includes('px-4') && btn.className.includes('py-2')) + const mobileButton = voiceButtons.find((btn) => btn.getAttribute('data-voice-variant') === 'mobile') return mobileButton || voiceButtons[0] } @@ -561,7 +561,7 @@ describe('PromptInput STT Gesture Tests', () => { const title = (btn.getAttribute('title') || '').toLowerCase() return title.includes('tap to speak') || title.includes('tap to transcribe') || title.includes('hold to speak') || title.includes('release') }) - return voiceButtons.find((btn) => btn.className.includes('px-4') && btn.className.includes('py-2')) ?? null + return voiceButtons.find((btn) => btn.getAttribute('data-voice-variant') === 'mobile') ?? null } it('shows the mobile mic and no submit button when the prompt is empty', () => { diff --git a/frontend/src/components/message/PromptInput.tsx b/frontend/src/components/message/PromptInput.tsx index 28916804..c54293bd 100644 --- a/frontend/src/components/message/PromptInput.tsx +++ b/frontend/src/components/message/PromptInput.tsx @@ -1397,7 +1397,8 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read) const renderVoiceButton = (variant: VoiceButtonVariant) => { const isDesktop = variant === 'desktop' const isBusy = isRecording || isTogglingRecording || (isProcessing && !isRecording) - const spinnerClassName = `w-5 h-5 animate-spin rounded-full border-2 ${isDesktop ? 'border-muted-foreground' : 'border-foreground'} border-t-transparent` + const iconSizeClassName = isDesktop ? 'w-5 h-5' : 'w-6 h-6' + const spinnerClassName = `${iconSizeClassName} animate-spin rounded-full border-2 ${isDesktop ? 'border-muted-foreground' : 'border-foreground'} border-t-transparent` const voiceGestureHandlers = isDesktop ? {} : { onPointerDown: handleVoicePointerDown, onPointerMove: handleVoicePointerMove, @@ -1410,13 +1411,13 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read) ? 'bg-destructive hover:bg-destructive/90 text-destructive-foreground border-destructive/60 animate-pulse' : 'bg-muted hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground border-border' }` - : `px-4 py-2 rounded-lg transition-all duration-150 flex items-center justify-center min-w-[52px] border touch-none select-none ${ + : `px-4 min-h-[44px] min-w-[56px] rounded-lg transition-all duration-150 flex items-center justify-center border touch-none select-none ${ isBusy ? 'bg-success text-success-foreground border-success/70 shadow-lg shadow-success/40' : 'bg-muted hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground border-border active:bg-muted-foreground/30 active:scale-95' }` - const containerClassName = isDesktop ? 'relative hidden md:block' : 'relative flex w-full touch-none select-none' + const containerClassName = isDesktop ? 'relative hidden md:block' : 'relative flex w-full justify-end touch-none select-none' return (
@@ -1541,13 +1543,13 @@ return ( )}
-
+
{showMobileScrollButton ? ( <>