Repository navigation
feat(frontend): give the composer its own strip and let voice mode skip reading replies - #495
Conversation
…ip reading replies
| speakTokenRef.current += 1 | ||
| speakingIdRef.current = null |
There was a problem hiding this comment.
Interrupted reply left unheard
When read-back is turned off mid-reply, the code clears speakingIdRef without adding that message to spokenIdsRef. The token bump also makes the TTS end callback ignore the stop, so that callback never marks it either. In the idle case the loop goes straight to listening, and the cut-off reply still counts as unheard. That differs from skipReading, which marks replies as heard. A later resume, through findNextUnspokenMessage in resumeConversation, can then move to working and read the stale reply again if read-back has been turned back on. The stop logic also repeats what skipReading does, which goes against the DRY rule in AGENTS.md.
| speakTokenRef.current += 1 | |
| speakingIdRef.current = null | |
| speakTokenRef.current += 1 | |
| if (speakingIdRef.current) spokenIdsRef.current.add(speakingIdRef.current) | |
| speakingIdRef.current = null |
| const composerTrailingAction = ttsEnabled && !isMobile && !isVoiceConversationActive | ||
| ? !isFormSheetOpen && !hasPromptContent && !isSessionActive && latestPlayableAssistant | ||
| ? ( | ||
| <FloatingTTSButton | ||
| messageId={latestPlayableAssistant.messageId} | ||
| content={latestPlayableAssistant.text} | ||
| isScrolledUp={showScrollButton} | ||
| onSpeakVisible={handleSpeakVisibleMessages} | ||
| /> | ||
| ) | ||
| : null | ||
| : undefined; |
There was a problem hiding this comment.
Mobile TTS controls removed
On mobile, composerTrailingAction is now always undefined, so FloatingTTSButton is never rendered there. That button was the entry point for "Read visible replies" and for the long-press auto-play toggle. Per-reply speakers cover playing a single reply, but mobile users may have no way left to turn auto-play on or off in the session view. Check that another control for this exists on mobile.
PR Reviewer Guide 🔍(Review updated until commit eab3022)Since the last review — 3 findings were open on the previous HEAD
Here are some key observations to aid the review process:
✅ Resolved findingsfrontend/src/hooks/useVoiceConversation.ts:449-451Stale failure flag
|
… and let failed sends be resent
|
Persistent review updated to latest commit 99b8d85 |
|
Persistent review updated to latest commit eca6a29 |
…once delivered, and keep the composer opaque while a form is open
| const handleTranscriptionFailure = useCallback(() => { | ||
| const phase = phaseRef.current | ||
| if (phase !== 'listening' && phase !== 'recording') return | ||
| transcriptionFailureCountRef.current += 1 | ||
| const message = sttRef.current?.error?.trim() || STT_FAILED_MESSAGE | ||
| const current = sttRef.current | ||
| if (current && (current.isRecording || current.isProcessing)) current.abortRecording() | ||
| if (transcriptionFailureCountRef.current >= TRANSCRIPTION_FAILURE_LIMIT) { | ||
| phaseRef.current = 'paused' | ||
| dispatch({ type: 'error', message, source: 'transcription' }) | ||
| return | ||
| } | ||
| setNotice(`Couldn't transcribe that: ${message}. Still listening`) |
There was a problem hiding this comment.
Mic errors retried
Every STT error that arrives while listening or recording now goes to handleTranscriptionFailure. Before this PR it went to failCapture, with the capture source. A permission or device error raised after startRecording resolves (Web Speech reports not-allowed asynchronously) is shown as "Couldn't transcribe that: Microphone access denied… Still listening". Capture then restarts in a loop until the third failure, and the pause shows "Transcription isn't working / Tap to try again" instead of "Microphone problem / Allow microphone access". Classify microphone or permission errors as capture failures and pause right away.
|
Persistent review updated to latest commit eab3022 |
User description
Summary
Follow-up polish to the condensed composer, plus a voice-mode preference.
Tests
Composer, session detail, voice conversation hook and voice bar tests are added or updated; frontend tests, typecheck and lint pass.
PR Type
Enhancement
Description
Composer sits in a full-width opaque strip
Read-aloud button moves into the composer input row
Scroll control becomes a "Back to latest" tab
Voice mode survives empty sends and transcription errors
Diagram Walkthrough
File Walkthrough
8 files
Move pill sizing and rounding onto wrapper slotAdd trailing action slot and drop frame backgroundBump desktop config trigger to 40pxAdd pressed-state read-aloud toggle buttonKeep listening, resend failed turns, toggle read-backMove TTS into composer and add back-to-latest tabAdd persisted read-replies-aloud preference storeAdd resend event, transcription source and labels9 files
Update frame compositing assertions for opaque stripAdd trailing slot tests and back-to-latest renameUpdate desktop config trigger size expectationTest read-aloud toggle and failure noticesTest transcription retries, resend and muted read-backTest resend reducer and failure-specific labelsTest composer speaker placement and back-to-latest tabThread trailingAction through the prompt fixtureExtend voice controller mock with new fields