The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 20:45 UTC
fix(mobile): lock the composer while queued edits save (#21390)
maria committed
Oct 21, 2026 at 00:04 UTC
834ae4f9faad33d27f7df9b9119c4ad2b4475c6c
1 file changed
+23
-13
apps/mobile/src/features/threads/ThreadComposer.tsx
+23
-13
@@ -496,6 +496,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
496
onChangeDraftMessage: (text) => setComposerDraftText(composerDraftKey, text),
497
onChangeSelection: composerMenu.onSelectionChange,
498
});
499
+ const isSubmissionLocked = queuedEdit?.saving === true || voiceInput.blocksSubmission;
500
const voicePresentation = resolveVoiceComposerPresentation(
501
voiceInput.state,
502
voiceInput.elapsedSeconds,
@@ -552,7 +553,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
553
(props.canOperateThread || props.connectionState !== "connected") &&
554
hasContent &&
555
!contextImports[composerDraftKey] &&
555
- !voiceInput.blocksSubmission &&
556
+ !isSubmissionLocked &&
557
sendBlockedReason === null &&
558
!modelUnavailable;
559
@@ -602,7 +603,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
603
setComposerEditing(false);
604
};
605
const handleSend = async (followUp?: ActiveTurnComposerAction) => {
605
- if (voiceInput.blocksSubmission || pendingPastedTextAttachmentCountRef.current > 0) return;
606
+ if (isSubmissionLocked || pendingPastedTextAttachmentCountRef.current > 0) return;
607
if (usageLimitsOffered && isUsageLimitsCommand(draftMessage) && draftAttachments.length === 0) {
608
if (openUsageLimits()) onChangeDraftMessage("");
609
return;
@@ -725,7 +726,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
726
<ComposerQueuedEditAttachments
727
environmentId={props.environmentId}
728
attachments={queuedEdit.existingAttachments}
728
- disabled={queuedEdit.saving || voiceInput.isBusy}
729
+ disabled={isSubmissionLocked}
730
onRemove={queuedEdit.onRemoveExistingAttachment}
731
/>
732
</Animated.View>
@@ -739,11 +740,11 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
740
<ComposerAttachmentStrip
741
environmentId={props.environmentId}
742
attachments={stripAttachments}
742
- onRemove={voiceInput.isBusy ? () => undefined : props.onRemoveDraftImage}
743
- onPressPreview={voiceInput.isBusy ? undefined : onPressPreview}
744
- onPressVideo={voiceInput.isBusy ? undefined : onPressVideo}
743
+ onRemove={isSubmissionLocked ? () => undefined : props.onRemoveDraftImage}
744
+ onPressPreview={isSubmissionLocked ? undefined : onPressPreview}
745
+ onPressVideo={isSubmissionLocked ? undefined : onPressVideo}
746
onPressDocument={
746
- voiceInput.isBusy
747
+ isSubmissionLocked
748
? undefined
749
: (attachment) =>
750
openDraftDocument({
@@ -807,7 +808,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
808
style={{ maxWidth: props.contentMaxWidth }}
809
onLayout={(event) => measureRow("surfaceWidth", event.nativeEvent.layout.width)}
810
>
810
- {!voiceInput.isBusy &&
811
+ {!isSubmissionLocked &&
812
composerMenu.trigger &&
813
(composerMenu.items.length > 0 || composerMenu.trigger.kind === "pull-request") ? (
814
<ComposerPopoverAnchor>
@@ -874,6 +875,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
875
>
876
{!usesCard ? (
877
<ComposerAttachmentButton
878
+ disabled={isSubmissionLocked}
879
supportsFiles={Boolean(
880
props.serverConfig?.environment.capabilities.fileAttachments,
881
)}
@@ -911,13 +913,18 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
913
multiline
914
value={draftMessage}
915
// The save uses a draft snapshot; further typing would be discarded on success.
914
- readOnly={voiceInput.freezesEditor || queuedEdit?.saving === true}
916
+ readOnly={isSubmissionLocked}
917
skills={composerMenu.skills}
918
selection={composerMenu.selection}
917
- onChangeText={props.onChangeDraftMessage}
919
+ onChangeText={(text) => {
920
+ if (!isSubmissionLocked) props.onChangeDraftMessage(text);
921
+ }}
922
onSelectionChange={composerMenu.onSelectionChange}
919
- onPasteImages={(uris) => void props.onNativePasteImages(uris)}
923
+ onPasteImages={(uris) => {
924
+ if (!isSubmissionLocked) void props.onNativePasteImages(uris);
925
+ }}
926
onPasteText={(paste) => {
927
+ if (isSubmissionLocked) return;
928
const insertPaste = () => {
929
const insertion = replaceTextSelection({
930
value: paste.value,
@@ -1045,8 +1052,8 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
1052
size={30}
1053
borderRadius={8}
1054
compact
1048
- onPressPreview={onPressPreview}
1049
- onPressVideo={onPressVideo}
1055
+ onPressPreview={isSubmissionLocked ? undefined : onPressPreview}
1056
+ onPressVideo={isSubmissionLocked ? undefined : onPressVideo}
1057
/>
1058
))}
1059
{stripAttachments.length > 3 ? (
@@ -1067,6 +1074,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
1074
<ComposerDictationStartAction
1075
state={voiceInput.state}
1076
isAvailable={voiceInput.isAvailable}
1077
+ disabled={isSubmissionLocked}
1078
onStart={voiceInput.start}
1079
onCancel={voiceInput.cancel}
1080
/>
@@ -1139,6 +1147,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
1147
) : (
1148
<View className="min-w-0 flex-1 flex-row items-center justify-between">
1149
<ComposerAttachmentButton
1150
+ disabled={isSubmissionLocked}
1151
supportsFiles={Boolean(
1152
props.serverConfig?.environment.capabilities.fileAttachments,
1153
)}
@@ -1153,6 +1162,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
1162
state={voiceInput.state}
1163
presentation={voicePresentation}
1164
isAvailable={voiceInput.isAvailable}
1165
+ disabled={isSubmissionLocked}
1166
onStart={voiceInput.start}
1167
onConfirm={voiceInput.stop}
1168
onCancel={voiceInput.cancel}