From 1a2b70aa84db6c6c421077ec014cbb262d9d215e Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Fri, 31 Jul 2026 18:59:21 +0200 Subject: [PATCH] refactor(client): make one control move a question between chat and composer The popover carried both a chevron and a close button. Both left the question pending and both moved it into the chat, so their only real difference was invisible: the chevron kept the composer wired up as the answer box while the close button released it. Two icons for one visible outcome, with the meaning hidden in a placeholder change somewhere else. Collapsing now does both jobs at once. Moving a question to the chat hands the composer back for normal messages, and the card's chevron re-arms it, so the popover's visibility and the composer's role can never disagree. Escape maps to the same path and the dismissed-ids state is gone. Both chevrons get a tooltip and a matching label, since no glyph conveys this. Also fixes two behaviours found along the way: the card's Skip was a silent no-op once the question left the popover, because it routed through a helper gated on answer mode instead of the live pause, and clicking a multi-select row moved the keyboard highlight, leaving a row painted as selected after it was unchecked. --- .../Chat/Input/AskUserQuestionPopover.tsx | 36 ++++--- .../Chat/Messages/Content/AskUserQuestion.tsx | 9 +- client/src/hooks/Input/useAskAnswerMode.ts | 94 +++++++++---------- 3 files changed, 63 insertions(+), 76 deletions(-) diff --git a/client/src/components/Chat/Input/AskUserQuestionPopover.tsx b/client/src/components/Chat/Input/AskUserQuestionPopover.tsx index b27ea8bd41..4565ebd753 100644 --- a/client/src/components/Chat/Input/AskUserQuestionPopover.tsx +++ b/client/src/components/Chat/Input/AskUserQuestionPopover.tsx @@ -1,7 +1,7 @@ import { memo, useEffect, useRef } from 'react'; import { useWatch } from 'react-hook-form'; import { Button, TooltipAnchor } from '@librechat/client'; -import { ChevronDown, CornerDownLeft, TriangleAlert, X } from 'lucide-react'; +import { ChevronDown, CornerDownLeft, TriangleAlert } from 'lucide-react'; import AskUserQuestions from '~/components/Chat/Messages/Content/AskUserQuestions'; import useAskAnswerMode from '~/hooks/Input/useAskAnswerMode'; import AskOptions from '~/components/Chat/ask/options'; @@ -43,7 +43,7 @@ function AskUserQuestionPopoverContent({ function AskUserQuestionsPopoverPanel({ ask }: { ask: ReturnType }) { const localize = useLocalize(); - const { liveAsk, collapse, dismiss } = ask; + const { liveAsk, collapse } = ask; const questions = liveAsk?.questions; if (liveAsk == null || questions == null || questions.length === 0) { return null; @@ -59,24 +59,20 @@ function AskUserQuestionsPopoverPanel({ ask }: { ask: ReturnType -
- - -
+ +