Skip to content

Commit db57fe6

Browse files
authored
fix(app): make error tool card respect settings (anomalyco#17005)
1 parent 8024166 commit db57fe6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/ui/src/components/message-part.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) {
11901190
</div>
11911191
)
11921192
}
1193-
return <ToolErrorCard tool={part().tool} error={error()} />
1193+
return <ToolErrorCard tool={part().tool} error={error()} defaultOpen={props.defaultOpen} />
11941194
}}
11951195
</Match>
11961196
<Match when={true}>

packages/ui/src/components/tool-error-card.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ import { useI18n } from "../context/i18n"
99
export interface ToolErrorCardProps extends Omit<ComponentProps<typeof Card>, "children" | "variant"> {
1010
tool: string
1111
error: string
12+
defaultOpen?: boolean
1213
}
1314

1415
export function ToolErrorCard(props: ToolErrorCardProps) {
1516
const i18n = useI18n()
16-
const [open, setOpen] = createSignal(true)
17+
const [open, setOpen] = createSignal(props.defaultOpen ?? false)
1718
const [copied, setCopied] = createSignal(false)
18-
const [split, rest] = splitProps(props, ["tool", "error"])
19+
const [split, rest] = splitProps(props, ["tool", "error", "defaultOpen"])
1920
const name = createMemo(() => {
2021
const map: Record<string, string> = {
2122
read: "ui.tool.read",

0 commit comments

Comments
 (0)