Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions web/src/components/ToolCard/AskUserQuestionFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -40,10 +41,12 @@ function OptionRow(props: {
>
<SelectionMark checked={props.checked} mode={props.mode} />
<span className="min-w-0 flex-1">
<div className="font-medium text-[var(--app-fg)] break-words">{props.title}</div>
<div className="[&_.aui-md]:font-medium [&_.aui-md]:text-sm [&_.aui-md]:text-[var(--app-fg)]">
<MarkdownRenderer content={props.title} />
</div>
{props.description ? (
<div className="mt-0.5 text-xs text-[var(--app-hint)] break-words">
{props.description}
<div className="mt-0.5 [&_.aui-md]:text-xs [&_.aui-md]:text-[var(--app-hint)]">
<MarkdownRenderer content={props.description} />
</div>
) : null}
</span>
Expand Down Expand Up @@ -303,11 +306,8 @@ export function AskUserQuestionFooter(props: {
</div>
) : null}
{questions[clampedStep]?.question ? (
<div className={cn(
"text-sm text-[var(--app-fg)] break-words",
questions[clampedStep]?.header ? "mt-2" : ""
)}>
{questions[clampedStep].question}
<div className={cn(questions[clampedStep]?.header ? "mt-2" : "")}>
<MarkdownRenderer content={questions[clampedStep].question} />
</div>
) : null}
</div>
Expand Down
13 changes: 8 additions & 5 deletions web/src/components/ToolCard/RequestUserInputFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -42,10 +43,12 @@ function OptionRow(props: {
>
<SelectionMark checked={props.checked} />
<span className="min-w-0 flex-1">
<div className="font-medium text-[var(--app-fg)] break-words">{props.title}</div>
<div className="[&_.aui-md]:font-medium [&_.aui-md]:text-sm [&_.aui-md]:text-[var(--app-fg)]">
<MarkdownRenderer content={props.title} />
</div>
{props.description ? (
<div className="mt-0.5 text-xs text-[var(--app-hint)] break-words">
{props.description}
<div className="mt-0.5 [&_.aui-md]:text-xs [&_.aui-md]:text-[var(--app-hint)]">
<MarkdownRenderer content={props.description} />
</div>
) : null}
</span>
Expand Down Expand Up @@ -205,8 +208,8 @@ export function RequestUserInputFooter(props: {
{currentQuestion ? (
<div className="mt-3">
{currentQuestion.question ? (
<div className="text-sm text-[var(--app-fg)] break-words">
{currentQuestion.question}
<div>
<MarkdownRenderer content={currentQuestion.question} />
</div>
) : null}

Expand Down
17 changes: 9 additions & 8 deletions web/src/components/ToolCard/views/AskUserQuestionView.tsx
Original file line number Diff line number Diff line change
@@ -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<string, string[]> | Record<string, { answers: string[] }>
Expand Down Expand Up @@ -134,8 +135,8 @@ export function AskUserQuestionView(props: ToolViewProps) {
return (
<div key={idx} className="rounded-md border border-[var(--app-border)] bg-[var(--app-bg)] p-3">
{q.question ? (
<div className="text-sm text-[var(--app-fg)] break-words">
{q.question}
<div>
<MarkdownRenderer content={q.question} />
</div>
) : null}

Expand Down Expand Up @@ -166,16 +167,16 @@ export function AskUserQuestionView(props: ToolViewProps) {
)}
<div className="min-w-0 flex-1">
<div className={cn(
"text-sm break-words",
"[&_.aui-md]:text-sm",
isSelected
? "text-emerald-700 dark:text-emerald-300 font-medium"
: "text-[var(--app-fg)]"
? "[&_.aui-md]:text-emerald-700 dark:[&_.aui-md]:text-emerald-300 [&_.aui-md]:font-medium"
: "[&_.aui-md]:text-[var(--app-fg)]"
)}>
{opt.label}
<MarkdownRenderer content={opt.label} />
</div>
{opt.description ? (
<div className="mt-0.5 text-xs text-[var(--app-hint)] break-words">
{opt.description}
<div className="mt-0.5 [&_.aui-md]:text-xs [&_.aui-md]:text-[var(--app-hint)]">
<MarkdownRenderer content={opt.description} />
</div>
) : null}
</div>
Expand Down
17 changes: 9 additions & 8 deletions web/src/components/ToolCard/views/RequestUserInputView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -42,8 +43,8 @@ export function RequestUserInputView(props: ToolViewProps) {
return (
<div key={q.id} className="rounded-md border border-[var(--app-border)] bg-[var(--app-bg)] p-3">
{q.question ? (
<div className="text-sm text-[var(--app-fg)] break-words">
{q.question}
<div>
<MarkdownRenderer content={q.question} />
</div>
) : null}

Expand Down Expand Up @@ -92,16 +93,16 @@ export function RequestUserInputView(props: ToolViewProps) {
)}
<div className="min-w-0 flex-1">
<div className={cn(
"text-sm break-words",
"[&_.aui-md]:text-sm",
isSelected
? "text-emerald-700 dark:text-emerald-300 font-medium"
: "text-[var(--app-fg)]"
? "[&_.aui-md]:text-emerald-700 dark:[&_.aui-md]:text-emerald-300 [&_.aui-md]:font-medium"
: "[&_.aui-md]:text-[var(--app-fg)]"
)}>
{opt.label}
<MarkdownRenderer content={opt.label} />
</div>
{opt.description ? (
<div className="mt-0.5 text-xs text-[var(--app-hint)] break-words">
{opt.description}
<div className="mt-0.5 [&_.aui-md]:text-xs [&_.aui-md]:text-[var(--app-hint)]">
<MarkdownRenderer content={opt.description} />
</div>
) : null}
</div>
Expand Down
Loading