@devries-cameron20 / t3code-1 / commits / 7afa184a99
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): keep send reachable while a turn is running on mobile (#4781)

Co-authored-by: AMohamedAakhil <hello@takaitech.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>

BootesVoid committed Aug 15, 2026 at 17:31 UTC 7afa184a99b266d466cc9517c147a75c3d839ad7
3 files changed +69 -6
apps/web/src/components/chat/ChatComposer.tsx
+3
@@ -407,6 +407,7 @@ const ComposerFooterPrimaryActions = memo(function ComposerFooterPrimaryActions(
407 isEnvironmentUnavailable: boolean;
408 hasSendableContent: boolean;
409 preserveComposerFocusOnPointerDown?: boolean;
410 + showSendWhileRunning?: boolean;
411 onPreviousPendingQuestion: () => void;
412 onInterrupt: () => void;
413 onImplementPlanInNewThread: () => void;
@@ -435,6 +436,7 @@ const ComposerFooterPrimaryActions = memo(function ComposerFooterPrimaryActions(
436 isPreparingWorktree={props.isPreparingWorktree}
437 hasSendableContent={props.hasSendableContent}
438 preserveComposerFocusOnPointerDown={props.preserveComposerFocusOnPointerDown ?? false}
439 + showSendWhileRunning={props.showSendWhileRunning ?? false}
440 onPreviousPendingQuestion={props.onPreviousPendingQuestion}
441 onInterrupt={props.onInterrupt}
442 onImplementPlanInNewThread={props.onImplementPlanInNewThread}
@@ -3166,6 +3168,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
3168 isPreparingWorktree={isPreparingWorktree}
3169 hasSendableContent={composerSendState.hasSendableContent}
3170 preserveComposerFocusOnPointerDown={isMobileViewport}
3171 + showSendWhileRunning={isMobileViewport}
3172 onPreviousPendingQuestion={onPreviousActivePendingUserInputQuestion}
3173 onInterrupt={handleInterruptPrimaryAction}
3174 onImplementPlanInNewThread={handleImplementPlanInNewThreadPrimaryAction}
apps/web/src/components/chat/ComposerPrimaryActions.test.tsx renamed
+45
@@ -65,6 +65,28 @@ function renderStandaloneStop() {
65 );
66 }
67
68 +function renderRunningActions(showSendWhileRunning: boolean, hasSendableContent: boolean) {
69 + return renderToStaticMarkup(
70 + createElement(ComposerPrimaryActions, {
71 + compact: true,
72 + pendingAction: null,
73 + isRunning: true,
74 + showPlanFollowUpPrompt: false,
75 + promptHasText: hasSendableContent,
76 + isSendBusy: false,
77 + sendDisabledReason: null,
78 + isConnecting: false,
79 + isEnvironmentUnavailable: false,
80 + isPreparingWorktree: false,
81 + hasSendableContent,
82 + showSendWhileRunning,
83 + onPreviousPendingQuestion: () => {},
84 + onInterrupt: () => {},
85 + onImplementPlanInNewThread: () => {},
86 + }),
87 + );
88 +}
89 +
90 function renderSendButton() {
91 return renderToStaticMarkup(
92 createElement(ComposerPrimaryActions, {
@@ -215,4 +237,27 @@ describe("ComposerPrimaryActions", () => {
237 expect(markup).not.toContain("stage-nightly");
238 expect(markup).toContain("bg-message-action text-message-action-foreground");
239 });
240 +
241 + it("only renders stop while running when Enter-to-send is available", () => {
242 + const markup = renderRunningActions(false, true);
243 +
244 + expect(markup).toContain('aria-label="Stop generation"');
245 + expect(markup).not.toContain('aria-label="Send message"');
246 + });
247 +
248 + it("renders send alongside stop while running when Enter-to-send is unavailable", () => {
249 + const markup = renderRunningActions(true, true);
250 +
251 + expect(markup).toContain('aria-label="Stop generation"');
252 + expect(markup).toContain('aria-label="Send message"');
253 + expect(markup).toContain('type="submit"');
254 + expect(markup).toContain("size-9 sm:size-8");
255 + });
256 +
257 + it("keeps stop as the only action while running with an empty composer", () => {
258 + const markup = renderRunningActions(true, false);
259 +
260 + expect(markup).toContain('aria-label="Stop generation"');
261 + expect(markup).not.toContain('aria-label="Send message"');
262 + });
263 });
apps/web/src/components/chat/ComposerPrimaryActions.tsx
+21 -6
@@ -28,6 +28,9 @@ interface ComposerPrimaryActionsProps {
28 isPreparingWorktree: boolean;
29 hasSendableContent: boolean;
30 preserveComposerFocusOnPointerDown?: boolean;
31 + /** Enter-to-send is disabled on mobile viewports, where stop would otherwise
32 + * be the only primary action and a running turn could not be steered. */
33 + showSendWhileRunning?: boolean;
34 onPreviousPendingQuestion: () => void;
35 onInterrupt: () => void;
36 onImplementPlanInNewThread: () => void;
@@ -68,6 +71,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
71 isPreparingWorktree,
72 hasSendableContent,
73 preserveComposerFocusOnPointerDown = false,
74 + showSendWhileRunning = false,
75 onPreviousPendingQuestion,
76 onInterrupt,
77 onImplementPlanInNewThread,
@@ -86,7 +90,11 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
90 type="button"
91 className={cn(
92 "flex cursor-pointer items-center justify-center rounded-full bg-destructive/90 text-white shadow-xs shadow-destructive/24 inset-shadow-[0_1px_--theme(--color-white/16%)] transition-all duration-150 hover:bg-destructive hover:scale-105 active:inset-shadow-[0_1px_--theme(--color-black/8%)] active:shadow-none",
89 - insidePendingAction ? "size-8 sm:size-7" : "size-8 sm:h-8 sm:w-8",
93 + insidePendingAction
94 + ? "size-8 sm:size-7"
95 + : showSendWhileRunning && hasSendableContent
96 + ? "size-9 sm:size-8"
97 + : "size-8 sm:h-8 sm:w-8",
98 )}
99 {...pointerFocusProps}
100 onClick={onInterrupt}
@@ -153,10 +161,6 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
161 );
162 }
163
156 - if (isRunning) {
157 - return renderStopGenerationButton(false);
158 - }
159 -
164 if (showPlanFollowUpPrompt) {
165 if (promptHasText) {
166 return (
@@ -214,7 +218,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
218 );
219 }
220
217 - return (
221 + const sendButton = (
222 <button
223 type="submit"
224 className={cn(
@@ -265,4 +269,15 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
269 )}
270 </button>
271 );
272 +
273 + if (!isRunning) {
274 + return sendButton;
275 + }
276 +
277 + return (
278 + <>
279 + {renderStopGenerationButton(false)}
280 + {showSendWhileRunning && hasSendableContent ? sendButton : null}
281 + </>
282 + );
283 });