From b215560d97253f47e7ecbde1ad036d86916766b9 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Tue, 7 Jul 2026 11:38:54 -0400 Subject: [PATCH] feat: the composer is the free-form answer box (like the main chat input) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While a question pause is live, the main chat textarea composes the free-form answer — placeholder swaps to 'Something else…' (or a folded model 'Other' label), Enter with text submits the answer through answer-mode key handling (composed BEFORE useTextarea's submitting-lock, so the lock can't swallow it), and the Stop button swaps to Send (enabled despite isSubmitting) per the select-then-confirm design. The popover slims to the question header, numbered option rows, and Skip/Submit — its inline input is gone since the composer owns free-form now. Dismissing the popover restores normal composer semantics (Stop button, normal sends). --- .../Chat/Input/AskUserQuestionPopover.tsx | 51 +------------------ client/src/components/Chat/Input/ChatForm.tsx | 24 +++++++-- client/src/hooks/Input/useAskAnswerMode.ts | 29 ++++++++++- 3 files changed, 49 insertions(+), 55 deletions(-) diff --git a/client/src/components/Chat/Input/AskUserQuestionPopover.tsx b/client/src/components/Chat/Input/AskUserQuestionPopover.tsx index 0a23bdd4e0..880be0d70b 100644 --- a/client/src/components/Chat/Input/AskUserQuestionPopover.tsx +++ b/client/src/components/Chat/Input/AskUserQuestionPopover.tsx @@ -14,19 +14,8 @@ import { cn } from '~/utils'; */ function AskUserQuestionPopoverContent({ conversationId }: { conversationId: string }) { const localize = useLocalize(); - const { - liveAsk, - active, - options, - selected, - setSelected, - otherText, - setOtherText, - canSubmit, - submit, - dismiss, - otherLabel, - } = useAskAnswerMode(conversationId); + const { liveAsk, active, options, selected, setSelected, canSubmit, submit, dismiss } = + useAskAnswerMode(conversationId); if (!active || !liveAsk) { return null; @@ -71,42 +60,6 @@ function AskUserQuestionPopoverContent({ conversationId }: { conversationId: str {option.label} ))} -
- {options.length > 0 && ( - - {options.length + 1} - - )} - { - setOtherText(e.target.value); - setSelected('other'); - }} - onFocus={() => setSelected('other')} - onKeyDown={(e) => { - if (e.key === 'Enter' && canSubmit) { - e.preventDefault(); - submit(); - } else if (e.key === 'Escape') { - dismiss(); - } - }} - placeholder={ - otherLabel ?? - (options.length > 0 - ? localize('com_ui_something_else') - : localize('com_ui_your_answer')) - } - className="flex-1 border-0 bg-transparent text-sm text-text-primary placeholder:text-text-secondary focus:outline-none" - aria-label={localize('com_ui_your_answer')} - /> -