From 586f16ebf26e831d6f3e4c7eed02225199d82a8b Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 23 Mar 2026 03:01:58 +0800 Subject: [PATCH 1/2] Render question tool text with markdown --- web/src/components/ToolCard/AskUserQuestionFooter.tsx | 8 +++----- web/src/components/ToolCard/RequestUserInputFooter.tsx | 5 +++-- web/src/components/ToolCard/views/AskUserQuestionView.tsx | 5 +++-- .../components/ToolCard/views/RequestUserInputView.tsx | 5 +++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/web/src/components/ToolCard/AskUserQuestionFooter.tsx b/web/src/components/ToolCard/AskUserQuestionFooter.tsx index a8164711f..83da547a2 100644 --- a/web/src/components/ToolCard/AskUserQuestionFooter.tsx +++ b/web/src/components/ToolCard/AskUserQuestionFooter.tsx @@ -3,6 +3,7 @@ import type { ApiClient } from '@/api/client' import type { ChatToolCall } from '@/chat/types' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' +import { MarkdownRenderer } from '@/components/MarkdownRenderer' import { isAskUserQuestionToolName, parseAskUserQuestionInput, type AskUserQuestionQuestion } from '@/components/ToolCard/askUserQuestion' import { cn } from '@/lib/utils' import { usePlatform } from '@/hooks/usePlatform' @@ -303,11 +304,8 @@ export function AskUserQuestionFooter(props: { ) : null} {questions[clampedStep]?.question ? ( -
- {questions[clampedStep].question} +
+
) : null}
diff --git a/web/src/components/ToolCard/RequestUserInputFooter.tsx b/web/src/components/ToolCard/RequestUserInputFooter.tsx index 8498de277..56ce602ed 100644 --- a/web/src/components/ToolCard/RequestUserInputFooter.tsx +++ b/web/src/components/ToolCard/RequestUserInputFooter.tsx @@ -3,6 +3,7 @@ import type { ApiClient } from '@/api/client' import type { ChatToolCall } from '@/chat/types' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' +import { MarkdownRenderer } from '@/components/MarkdownRenderer' import { isRequestUserInputToolName, parseRequestUserInputInput, @@ -205,8 +206,8 @@ export function RequestUserInputFooter(props: { {currentQuestion ? (
{currentQuestion.question ? ( -
- {currentQuestion.question} +
+
) : null} diff --git a/web/src/components/ToolCard/views/AskUserQuestionView.tsx b/web/src/components/ToolCard/views/AskUserQuestionView.tsx index c7fbc5fc0..efb9cf854 100644 --- a/web/src/components/ToolCard/views/AskUserQuestionView.tsx +++ b/web/src/components/ToolCard/views/AskUserQuestionView.tsx @@ -1,6 +1,7 @@ import type { ReactNode } from 'react' import type { ToolViewProps } from '@/components/ToolCard/views/_all' import { parseAskUserQuestionInput } from '@/components/ToolCard/askUserQuestion' +import { MarkdownRenderer } from '@/components/MarkdownRenderer' import { cn } from '@/lib/utils' type AnswersFormat = Record | Record @@ -134,8 +135,8 @@ export function AskUserQuestionView(props: ToolViewProps) { return (
{q.question ? ( -
- {q.question} +
+
) : null} diff --git a/web/src/components/ToolCard/views/RequestUserInputView.tsx b/web/src/components/ToolCard/views/RequestUserInputView.tsx index 5aafc689a..44c9b9738 100644 --- a/web/src/components/ToolCard/views/RequestUserInputView.tsx +++ b/web/src/components/ToolCard/views/RequestUserInputView.tsx @@ -3,6 +3,7 @@ import { parseRequestUserInputInput, parseRequestUserInputAnswers } from '@/components/ToolCard/requestUserInput' +import { MarkdownRenderer } from '@/components/MarkdownRenderer' import { cn } from '@/lib/utils' function getSelectionMark(isSelected: boolean): string { @@ -42,8 +43,8 @@ export function RequestUserInputView(props: ToolViewProps) { return (
{q.question ? ( -
- {q.question} +
+
) : null} From 22c55678b5c1d3166f0ded085884238c65b2b255 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 23 Mar 2026 03:10:20 +0800 Subject: [PATCH 2/2] Render question options with markdown --- .../components/ToolCard/AskUserQuestionFooter.tsx | 8 +++++--- .../components/ToolCard/RequestUserInputFooter.tsx | 8 +++++--- .../ToolCard/views/AskUserQuestionView.tsx | 12 ++++++------ .../ToolCard/views/RequestUserInputView.tsx | 12 ++++++------ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/web/src/components/ToolCard/AskUserQuestionFooter.tsx b/web/src/components/ToolCard/AskUserQuestionFooter.tsx index 83da547a2..cadd3b0ba 100644 --- a/web/src/components/ToolCard/AskUserQuestionFooter.tsx +++ b/web/src/components/ToolCard/AskUserQuestionFooter.tsx @@ -41,10 +41,12 @@ function OptionRow(props: { > -
{props.title}
+
+ +
{props.description ? ( -
- {props.description} +
+
) : null} diff --git a/web/src/components/ToolCard/RequestUserInputFooter.tsx b/web/src/components/ToolCard/RequestUserInputFooter.tsx index 56ce602ed..4942a5e50 100644 --- a/web/src/components/ToolCard/RequestUserInputFooter.tsx +++ b/web/src/components/ToolCard/RequestUserInputFooter.tsx @@ -43,10 +43,12 @@ function OptionRow(props: { > -
{props.title}
+
+ +
{props.description ? ( -
- {props.description} +
+
) : null} diff --git a/web/src/components/ToolCard/views/AskUserQuestionView.tsx b/web/src/components/ToolCard/views/AskUserQuestionView.tsx index efb9cf854..521a69dbe 100644 --- a/web/src/components/ToolCard/views/AskUserQuestionView.tsx +++ b/web/src/components/ToolCard/views/AskUserQuestionView.tsx @@ -167,16 +167,16 @@ export function AskUserQuestionView(props: ToolViewProps) { )}
- {opt.label} +
{opt.description ? ( -
- {opt.description} +
+
) : null}
diff --git a/web/src/components/ToolCard/views/RequestUserInputView.tsx b/web/src/components/ToolCard/views/RequestUserInputView.tsx index 44c9b9738..45e1eb017 100644 --- a/web/src/components/ToolCard/views/RequestUserInputView.tsx +++ b/web/src/components/ToolCard/views/RequestUserInputView.tsx @@ -93,16 +93,16 @@ export function RequestUserInputView(props: ToolViewProps) { )}
- {opt.label} +
{opt.description ? ( -
- {opt.description} +
+
) : null}