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} - {isSendBusy ? "Sending..." : "Refine"} - + <> + {children} + + {isSendBusy ? "Sending..." : "Refine"} + + > ); } return ( - - - {isSendBusy ? "Sending..." : "Implement"} - - - event.preventDefault() : undefined - } - disabled={isSendBusy || isSendDisabled || isEnvironmentUnavailable} - /> - } + <> + {children} + + - - - - { - if (canOperateThread) onImplementPlanInNewThread(); - }} + {isSendBusy ? "Sending..." : "Implement"} + + + 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} );