From ad975b3176ea17521da21a64d694ddaa0bd3fb1d Mon Sep 17 00:00:00 2001 From: Valerii Kuznietsov Date: Mon, 21 Sep 2026 15:24:05 +0100 Subject: [PATCH 1/3] fix(mobile): expand composer after dictation --- apps/mobile/src/features/threads/ThreadComposer.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsx index c747a4ed8171d..d2d5c3a494040 100644 --- a/apps/mobile/src/features/threads/ThreadComposer.tsx +++ b/apps/mobile/src/features/threads/ThreadComposer.tsx @@ -394,7 +394,11 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer ownerKey: composerOwnerKey, draftMessage: props.draftMessage, selection: composerMenu.selection, - onChangeDraftMessage: props.onChangeDraftMessage, + onChangeDraftMessage: (message) => { + props.onChangeDraftMessage(message); + // Open the completed transcript for review, including when dictation began collapsed. + inputRef.current?.focus(); + }, onChangeSelection: composerMenu.onSelectionChange, }); const voicePresentation = resolveVoiceComposerPresentation( From 2b6495c4c9d5f7d83e068673ee2c91494e28af8e Mon Sep 17 00:00:00 2001 From: Valerii Kuznietsov Date: Mon, 21 Sep 2026 15:42:59 +0100 Subject: [PATCH 2/3] fix(mobile): review dictation without keyboard --- .../src/features/threads/ThreadComposer.tsx | 21 ++++++++++----- .../features/threads/ThreadDetailScreen.tsx | 26 +++++++++++++++---- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsx index d2d5c3a494040..b6c985388ff71 100644 --- a/apps/mobile/src/features/threads/ThreadComposer.tsx +++ b/apps/mobile/src/features/threads/ThreadComposer.tsx @@ -121,6 +121,8 @@ export const COMPOSER_COLLAPSED_CHROME = 60; * Used by the parent to compute the larger feed bottom inset when the composer is focused. */ export const COMPOSER_EXPANDED_CHROME = 156; +// Dictation review uses the full 160-point editor instead of the 72-point minimum. +export const COMPOSER_DICTATION_REVIEW_CHROME = COMPOSER_EXPANDED_CHROME + 160 - 72; export interface ThreadComposerProps { readonly draftMessage: string; @@ -140,6 +142,8 @@ export interface ThreadComposerProps { readonly sendBlockedReason?: string | null; readonly editorRef?: RefObject; readonly onChangeDraftMessage: (value: string) => void; + readonly isReviewingDictation: boolean; + readonly onDictationComplete: () => void; readonly onPickDraftMedia: () => Promise; readonly onPickDraftFiles: () => Promise; readonly onNativePasteImages: (uris: ReadonlyArray) => Promise; @@ -396,8 +400,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer selection: composerMenu.selection, onChangeDraftMessage: (message) => { props.onChangeDraftMessage(message); - // Open the completed transcript for review, including when dictation began collapsed. - inputRef.current?.focus(); + props.onDictationComplete(); }, onChangeSelection: composerMenu.onSelectionChange, }); @@ -407,7 +410,8 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer ); const isVoiceInputPresented = voicePresentation.statusLabel !== null; // An open draft stays visible; only a collapsed composer becomes a voice strip. - const isExpanded = isFocused || settingsSheetPresentation.keepsComposerExpanded; + const isExpanded = + isFocused || props.isReviewingDictation || settingsSheetPresentation.keepsComposerExpanded; const showsCompactDictation = isVoiceInputPresented && !isExpanded; const isToolbarVisible = isExpanded || isVoiceInputPresented; const attachmentBlockReason = composerAttachmentUploadBlockReason({ @@ -471,11 +475,16 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer const handleBlur = useCallback(() => { setIsFocused(false); - if (!settingsSheetPresentation.keepsComposerExpanded) { + if (!props.isReviewingDictation && !settingsSheetPresentation.keepsComposerExpanded) { onExpandedChange?.(false); } onEditorFocusChange?.(false); - }, [onEditorFocusChange, onExpandedChange, settingsSheetPresentation.keepsComposerExpanded]); + }, [ + onEditorFocusChange, + onExpandedChange, + props.isReviewingDictation, + settingsSheetPresentation.keepsComposerExpanded, + ]); const handleSend = useCallback(async () => { if (voiceInput.blocksSubmission || pendingPastedTextAttachmentCountRef.current > 0) return; // Typed out in full rather than picked from the menu. Attachments mean the @@ -831,7 +840,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer style={ isExpanded ? { - minHeight: 72, + minHeight: props.isReviewingDictation ? 160 : 72, maxHeight: 160, paddingVertical: 4, } diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx index ad0872ea9116d..7ba376bf5285f 100644 --- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx @@ -102,6 +102,7 @@ import { import { COMPOSER_COLLAPSED_CHROME, COMPOSER_EXPANDED_CHROME, + COMPOSER_DICTATION_REVIEW_CHROME, COMPOSER_LAYOUT_TRANSITION, COMPOSER_TRANSITION_DURATION_MS, ThreadComposer, @@ -326,8 +327,17 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread const lastScrolledSubmittedMessageIdRef = useRef(null); const [composerExpanded, setComposerExpanded] = useState(false); const [composerFocused, setComposerFocused] = useState(false); + const [dictationReviewThreadKey, setDictationReviewThreadKey] = useState(null); + const isReviewingDictation = + dictationReviewThreadKey === selectedThreadKey && + props.draftMessage.trim().length > 0 && + !composerFocused; + const handleDictationComplete = useCallback(() => { + setDictationReviewThreadKey(selectedThreadKey); + }, [selectedThreadKey]); const handleComposerFocusChange = useCallback( (focused: boolean) => { + if (focused) setDictationReviewThreadKey(null); setComposerFocused(focused); handleOwnedInputFocusChange(focused); }, @@ -343,10 +353,8 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread // animation, so the composer would ride down flush to the screen edge and // then snap up into the inset. On iOS blur precedes the hide, so the // focus-keyed inset is already in place while the composer rides down. - // Dictation keeps that focus while the composer switches to its compact pill. - const composerBottomInset = ( - Platform.OS === "android" ? isKeyboardVisible : composerExpanded || composerFocused - ) + // Dictation review can expand the card without opening the keyboard. + const composerBottomInset = (Platform.OS === "android" ? isKeyboardVisible : composerFocused) ? 0 : Math.max(insets.bottom, 12); const contentPresentationKind = props.contentPresentation.kind; @@ -425,7 +433,11 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread entry.message.text.trim().toLowerCase() !== "/compact"), ) || (Boolean(props.loadEarlier) && props.selectedThread.latestUserMessageAt !== null); - const composerChrome = composerExpanded ? COMPOSER_EXPANDED_CHROME : COMPOSER_COLLAPSED_CHROME; + const composerChrome = isReviewingDictation + ? COMPOSER_DICTATION_REVIEW_CHROME + : composerExpanded + ? COMPOSER_EXPANDED_CHROME + : COMPOSER_COLLAPSED_CHROME; const composerOverlapHeight = composerChrome + composerBottomInset; // While a user-input request is pending, the questionnaire owns the // composer slot outright: expanded it is the full card, collapsed it is a @@ -774,6 +786,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread // A sent message makes the snapshot stale; a refused send leaves it in place. clearUsageLimitsFor(targetThreadKey); + setDictationReviewThreadKey(null); setSubmittedMessageId(messageId); setAnchorMessageId( @@ -814,6 +827,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread }, []); const collapseComposer = useCallback(() => { + setDictationReviewThreadKey(null); composerEditorRef.current?.blur(); }, []); @@ -1074,6 +1088,8 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread } bottomInset={composerBottomInset} onChangeDraftMessage={props.onChangeDraftMessage} + isReviewingDictation={isReviewingDictation} + onDictationComplete={handleDictationComplete} onPickDraftMedia={props.onPickDraftMedia} onPickDraftFiles={props.onPickDraftFiles} onNativePasteImages={props.onNativePasteImages} From da0fd1555c7db572d074f922cce7019b53e0b6e7 Mon Sep 17 00:00:00 2001 From: Valerii Kuznietsov Date: Mon, 21 Sep 2026 15:48:19 +0100 Subject: [PATCH 3/3] chore(mobile): remove dictation review comments --- apps/mobile/src/features/threads/ThreadComposer.tsx | 1 - apps/mobile/src/features/threads/ThreadDetailScreen.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsx index b6c985388ff71..8e4bf8848d426 100644 --- a/apps/mobile/src/features/threads/ThreadComposer.tsx +++ b/apps/mobile/src/features/threads/ThreadComposer.tsx @@ -121,7 +121,6 @@ export const COMPOSER_COLLAPSED_CHROME = 60; * Used by the parent to compute the larger feed bottom inset when the composer is focused. */ export const COMPOSER_EXPANDED_CHROME = 156; -// Dictation review uses the full 160-point editor instead of the 72-point minimum. export const COMPOSER_DICTATION_REVIEW_CHROME = COMPOSER_EXPANDED_CHROME + 160 - 72; export interface ThreadComposerProps { diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx index 7ba376bf5285f..e2768df54b940 100644 --- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx @@ -353,7 +353,6 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread // animation, so the composer would ride down flush to the screen edge and // then snap up into the inset. On iOS blur precedes the hide, so the // focus-keyed inset is already in place while the composer rides down. - // Dictation review can expand the card without opening the keyboard. const composerBottomInset = (Platform.OS === "android" ? isKeyboardVisible : composerFocused) ? 0 : Math.max(insets.bottom, 12);