mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-25 18:14:58 +00:00
fix(app): make error tool card respect settings (#17005)
This commit is contained in:
@@ -1190,7 +1190,7 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return <ToolErrorCard tool={part().tool} error={error()} />
|
return <ToolErrorCard tool={part().tool} error={error()} defaultOpen={props.defaultOpen} />
|
||||||
}}
|
}}
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={true}>
|
<Match when={true}>
|
||||||
|
|||||||
@@ -9,13 +9,14 @@ import { useI18n } from "../context/i18n"
|
|||||||
export interface ToolErrorCardProps extends Omit<ComponentProps<typeof Card>, "children" | "variant"> {
|
export interface ToolErrorCardProps extends Omit<ComponentProps<typeof Card>, "children" | "variant"> {
|
||||||
tool: string
|
tool: string
|
||||||
error: string
|
error: string
|
||||||
|
defaultOpen?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ToolErrorCard(props: ToolErrorCardProps) {
|
export function ToolErrorCard(props: ToolErrorCardProps) {
|
||||||
const i18n = useI18n()
|
const i18n = useI18n()
|
||||||
const [open, setOpen] = createSignal(true)
|
const [open, setOpen] = createSignal(props.defaultOpen ?? false)
|
||||||
const [copied, setCopied] = createSignal(false)
|
const [copied, setCopied] = createSignal(false)
|
||||||
const [split, rest] = splitProps(props, ["tool", "error"])
|
const [split, rest] = splitProps(props, ["tool", "error", "defaultOpen"])
|
||||||
const name = createMemo(() => {
|
const name = createMemo(() => {
|
||||||
const map: Record<string, string> = {
|
const map: Record<string, string> = {
|
||||||
read: "ui.tool.read",
|
read: "ui.tool.read",
|
||||||
|
|||||||
Reference in New Issue
Block a user