Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): composer stays usable during approvals, and sending declines and redirects #21503

Mergedmaria-rcksmerged 27 commits intomain fromrefs/pull/21503/headmerged by maria-rcks View on GitHub

Showing 9 changed files with 81 additions and 15 deletions (loading 6).

x
0 of 9 viewed, 9 left
31 additions and 4 deletionsapps/mobile/src/features/threads/ThreadComposer.tsxModified
View file
@@ -178,7 +178,11 @@
readonly onStopThread: () => void;
/** Present while the thread's queue is held. */
readonly onResumeQueue: (() => Promise<void>) | null;
- readonly onSendMessage: (followUp?: ActiveTurnComposerAction) => Promise<MessageId | null>;
+ /** `stillSendable` reports whether the draft is unchanged after any wait before sending. */
+ readonly onSendMessage: (
+ followUp?: ActiveTurnComposerAction,
+ stillSendable?: () => boolean,
+ ) => Promise<MessageId | null>;
readonly onShowUsageLimits: (report: UsageLimitsReport | null) => void;
readonly canSwitchProvider: boolean;
readonly onUpdateModelSelection: (modelSelection: ModelSelection) => void;
@@ -356,6 +360,7 @@
const inputRef = props.editorRef ?? fallbackInputRef;
const [isFocused, setIsFocused] = useState(false);
const pendingPastedTextAttachmentCountRef = useRef(0);
+ const pendingNativeImagePasteCountRef = useRef(0);
const [pendingPastedTextAttachmentCount, setPendingPastedTextAttachmentCount] = useState(0);
const settingsSheetPresentation = useThreadSettingsSheetPresentation({
editorRef: inputRef,
@@ -599,7 +604,12 @@
setComposerEditing(false);
const handleSend = async (followUp?: ActiveTurnComposerAction) => {
- if (isSubmissionLocked || pendingPastedTextAttachmentCountRef.current > 0) return;
+ if (
+ isSubmissionLocked ||