@@ -418,8 +418,8 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
418418 const dismissDictationReview = ( ) =>
419419 setDictationReviewThreadKey ( ( current ) => ( current === selectedThreadKey ? null : current ) ) ;
420420 const handleDictationComplete = ( ) => {
421- // The voice session retains its startup callback. Focus must stay current and
422- // belong to that thread, even when another composer is now on screen.
421+ // The voice session retains its startup callback, so only expand its selected thread.
422+ if ( selectedThreadKeyRef . current !== selectedThreadKey ) return ;
423423 if ( composerFocusedThreadKeyRef . current !== selectedThreadKey ) {
424424 setDictationReviewThreadKey ( selectedThreadKey ) ;
425425 }
@@ -808,6 +808,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
808808 // A replaced or unmounted native editor may not emit a blur event.
809809 composerFocusedThreadKeyRef . current = null ;
810810 setComposerFocused ( false ) ;
811+ setDictationReviewThreadKey ( null ) ;
811812 } , [ selectedThreadKey , showContent ] ) ;
812813
813814 const visitThread = useAtomCommand ( threadEnvironment . visit , { reportFailure : false } ) ;
@@ -1195,6 +1196,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
11951196 saving = { props . isSavingQueuedEdit }
11961197 onCancel = { ( ) => {
11971198 voiceInputSession . cancel ( props . composerDraftKey ) ;
1199+ dismissDictationReview ( ) ;
11981200 props . onCancelQueuedRunEdit ( ) ;
11991201 } }
12001202 />
@@ -1373,6 +1375,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
13731375 }
13741376 bottomInset = { composerBottomInset }
13751377 onChangeDraftMessage = { props . onChangeDraftMessage }
1378+ onDraftCleared = { dismissDictationReview }
13761379 isReviewingDictation = { isReviewingDictation }
13771380 onDictationComplete = { handleDictationComplete }
13781381 onPickDraftMedia = { props . onPickDraftMedia }
0 commit comments