From c72d1c1c078d0dc724704a543553ef88872342bc Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Sun, 8 Nov 2026 16:17:13 -0800 Subject: [PATCH] fix(web): mic button always sits next to send Co-Authored-By: Claude Opus 5.5 --- .../chat/ComposerFooterControls.tsx | 5 +- .../chat/ComposerPrimaryActions.tsx | 123 +++++++++++------- 2 files changed, 77 insertions(+), 51 deletions(-) diff --git a/apps/web/src/components/chat/ComposerFooterControls.tsx b/apps/web/src/components/chat/ComposerFooterControls.tsx index 0a11e90a4cba4..03f11e8bbbf9f 100644 --- a/apps/web/src/components/chat/ComposerFooterControls.tsx +++ b/apps/web/src/components/chat/ComposerFooterControls.tsx @@ -300,7 +300,6 @@ export const ComposerFooterPrimaryActions = memo(function ComposerFooterPrimaryA ) : props.reserveContextWindowMeter ? ( ) : null} - {props.children} + > + {props.children} + ); }); diff --git a/apps/web/src/components/chat/ComposerPrimaryActions.tsx b/apps/web/src/components/chat/ComposerPrimaryActions.tsx index 86d6cb69f9f34..9968285d64673 100644 --- a/apps/web/src/components/chat/ComposerPrimaryActions.tsx +++ b/apps/web/src/components/chat/ComposerPrimaryActions.tsx @@ -1,4 +1,4 @@ -import { memo, type MouseEventHandler, type PointerEventHandler } from "react"; +import { memo, type MouseEventHandler, type PointerEventHandler, type ReactNode } from "react"; import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, Minimize2Icon, PlayIcon } from "lucide-react"; import { CornerUpRight, ListPlus } from "lucide"; import { MorphIcon } from "~/components/MorphIcon"; @@ -26,6 +26,8 @@ interface PendingActionState { } interface ComposerPrimaryActionsProps { + /** Footer controls (dictation) that always sit right before the primary button. */ + children?: ReactNode; compact: boolean; canOperateThread: boolean; pendingAction: PendingActionState | null; @@ -82,6 +84,7 @@ const preventPointerFocus: PointerEventHandler = (event) => { }; export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({ + children, compact, canOperateThread, pendingAction, @@ -182,6 +185,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({ ) ) : null} + {children} + <> + {children} + + ); } return ( -
- - - event.preventDefault() : undefined - } - disabled={isSendBusy || isSendDisabled || isEnvironmentUnavailable} - /> - } + <> + {children} +
+ + + event.preventDefault() + : undefined + } + disabled={isSendBusy || isSendDisabled || isEnvironmentUnavailable} + /> + } > - Implement in a new thread - - - -
+ +
+ + { + if (canOperateThread) onImplementPlanInNewThread(); + }} + > + Implement in a new thread + + +
+
+ ); } if (canInterrupt && !hasSendableContent && !isEditingQueuedMessage) { - return renderStopGenerationButton(false); + return ( + <> + {children} + {renderStopGenerationButton(false)} + + ); } const showResume = canResume && !hasSendableContent && !isEditingQueuedMessage; @@ -359,7 +376,14 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({ {submitTooltip} ); - if (compactTokens === null) return submit; + if (compactTokens === null) { + return ( + <> + {children} + {submit} + + ); + } return (
@@ -392,6 +416,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
{keepFullHistory ? "Click to compact first" : "Click to keep full history"}
+ {children} {submit}
);