diff --git a/packages/app/src/components/agent-input-area.tsx b/packages/app/src/components/agent-input-area.tsx index 9bf29bc74..147df7dd7 100644 --- a/packages/app/src/components/agent-input-area.tsx +++ b/packages/app/src/components/agent-input-area.tsx @@ -63,7 +63,7 @@ type ImageListUpdater = ImageAttachment[] | ((prev: ImageAttachment[]) => ImageA interface AgentInputAreaProps { agentId: string; serverId: string; - isInputActive: boolean; + isPaneFocused: boolean; onSubmitMessage?: (payload: MessagePayload) => Promise; /** Externally controlled loading state. When true, disables the submit button. */ isSubmitLoading?: boolean; @@ -98,7 +98,7 @@ const MOBILE_MESSAGE_PLACEHOLDER = "Message, @files, /commands"; export function AgentInputArea({ agentId, serverId, - isInputActive, + isPaneFocused, onSubmitMessage, isSubmitLoading = false, blurOnSubmit = false, @@ -421,7 +421,7 @@ export function AgentInputArea({ const handleKeyboardAction = useCallback( (action: KeyboardActionDefinition): boolean => { - if (!isInputActive) { + if (!isPaneFocused) { return false; } @@ -461,7 +461,7 @@ export function AgentInputArea({ return false; } }, - [isInputActive], + [isPaneFocused], ); useKeyboardActionHandler({ @@ -475,9 +475,9 @@ export function AgentInputArea({ "message-input.voice-toggle", "message-input.voice-mute-toggle", ], - enabled: isInputActive, + enabled: isPaneFocused, priority: isMessageInputFocused ? 200 : 100, - isActive: () => isInputActive, + isActive: () => isPaneFocused, handle: handleKeyboardAction, }); @@ -736,7 +736,7 @@ export function AgentInputArea({ autoFocus={autoFocus && isDesktopWebBreakpoint} autoFocusKey={`${serverId}:${agentId}`} disabled={isSubmitLoading} - isInputActive={isInputActive} + isPaneFocused={isPaneFocused} leftContent={leftContent} beforeVoiceContent={beforeVoiceContent} rightContent={rightContent} diff --git a/packages/app/src/components/message-input.tsx b/packages/app/src/components/message-input.tsx index fdf3492c8..44ce35c52 100644 --- a/packages/app/src/components/message-input.tsx +++ b/packages/app/src/components/message-input.tsx @@ -77,8 +77,8 @@ export interface MessageInputProps { autoFocus?: boolean; autoFocusKey?: string; disabled?: boolean; - /** True when this input is the active composer. Used to gate global hotkeys and stop dictation when hidden. */ - isInputActive?: boolean; + /** True when this composer's pane is focused. Used to gate global hotkeys and stop dictation when hidden. */ + isPaneFocused?: boolean; /** Content to render on the left side of the button row (e.g., AgentStatusBar) */ leftContent?: React.ReactNode; /** Content to render on the right side before the voice button (e.g., context window meter) */ @@ -208,7 +208,7 @@ export const MessageInput = forwardRef(funct autoFocus = false, autoFocusKey, disabled = false, - isInputActive = true, + isPaneFocused = true, leftContent, beforeVoiceContent, rightContent, @@ -431,7 +431,7 @@ export const MessageInput = forwardRef(funct onError: handleDictationError, canStart: canStartDictation, canConfirm: canConfirmDictation, - autoStopWhenHidden: { isVisible: isInputActive }, + autoStopWhenHidden: { isVisible: isPaneFocused }, enableDuration: true, }); @@ -1031,7 +1031,7 @@ export const MessageInput = forwardRef(funct autoFocus={isWeb && autoFocus} /> {inputScrollbar} - {isWeb && isInputActive && !isInputFocused && !value && focusInputKeys ? ( + {isWeb && isPaneFocused && !isInputFocused && !value && focusInputKeys ? ( {formatShortcut(focusInputKeys[0], getShortcutOs())} to focus diff --git a/packages/app/src/panels/agent-panel.tsx b/packages/app/src/panels/agent-panel.tsx index 1c2325663..ba909e776 100644 --- a/packages/app/src/panels/agent-panel.tsx +++ b/packages/app/src/panels/agent-panel.tsx @@ -762,7 +762,7 @@ function AgentPanelBody({