From 5b24f0cd401f58f0bcc6a6382a0dc3ed39001d4c Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Wed, 4 Feb 2026 00:34:40 +0000 Subject: [PATCH] fix(ui): tighten question tool layout Remove the redundant header row, tighten spacing, and square off question cards. Also adjust answered question container styling to match tool call layout. --- .../components/tool-call/question-block.tsx | 38 ++++++++++--------- .../ui/src/styles/messaging/tool-call.css | 4 ++ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/packages/ui/src/components/tool-call/question-block.tsx b/packages/ui/src/components/tool-call/question-block.tsx index bea2aa97..cea79806 100644 --- a/packages/ui/src/components/tool-call/question-block.tsx +++ b/packages/ui/src/components/tool-call/question-block.tsx @@ -80,6 +80,19 @@ export function QuestionToolBlock(props: QuestionToolBlockProps) { return Array.isArray(draft) ? draft : [] }) + const hasFinalAnswers = createMemo(() => { + const state = props.toolState() + if ((state as any)?.status === "completed") return true + + const request = props.request() + const requestAnswers = request?.questions?.map((q) => (q as any)?.answer) + if (Array.isArray(requestAnswers) && requestAnswers.length > 0) { + return requestAnswers.every((row) => Array.isArray(row) && row.length > 0) + } + + return false + }) + const updateAnswer = (questionIndex: number, next: string[]) => { if (!props.active()) return props.setDraftAnswers((prev) => { @@ -170,22 +183,11 @@ export function QuestionToolBlock(props: QuestionToolBlockProps) { return ( 0}> -
-
- - {props.active() - ? t("toolCall.question.status.required") - : props.request() - ? t("toolCall.question.status.queued") - : t("toolCall.question.status.questions")} - - - {questions().length === 1 ? t("toolCall.question.type.one") : t("toolCall.question.type.other")} - -
- +
-
+
{(q, index) => { const i = () => index() @@ -199,7 +201,7 @@ export function QuestionToolBlock(props: QuestionToolBlockProps) { const customChecked = () => customValue().length > 0 return ( -
+
{t("toolCall.question.number", { number: i() + 1 })} {q?.header} @@ -298,7 +300,7 @@ export function QuestionToolBlock(props: QuestionToolBlockProps) { -
+
diff --git a/packages/ui/src/styles/messaging/tool-call.css b/packages/ui/src/styles/messaging/tool-call.css index 67c6de3c..b768cb31 100644 --- a/packages/ui/src/styles/messaging/tool-call.css +++ b/packages/ui/src/styles/messaging/tool-call.css @@ -306,6 +306,10 @@ background-color: var(--message-tool-bg); } +.tool-call-permission.tool-call-permission-answered { + border-color: transparent; +} + .tool-call-permission-header { @apply flex items-center justify-between gap-3; }