diff options
| author | Adam <[email protected]> | 2025-10-30 10:16:45 -0500 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-10-30 12:02:50 -0500 |
| commit | 19974daa67b034062e991cff6611477741c0a09d (patch) | |
| tree | 9685c46c9c3633a27e9bad1ac105f150f2279d6f /packages/desktop/src/components | |
| parent | dcf865a889a97d00e36aa4d45464d1612b3281bd (diff) | |
| download | opencode-19974daa67b034062e991cff6611477741c0a09d.tar.gz opencode-19974daa67b034062e991cff6611477741c0a09d.zip | |
wip: desktop work
Diffstat (limited to 'packages/desktop/src/components')
| -rw-r--r-- | packages/desktop/src/components/message.tsx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/packages/desktop/src/components/message.tsx b/packages/desktop/src/components/message.tsx index 9e9e06d35..78be29d75 100644 --- a/packages/desktop/src/components/message.tsx +++ b/packages/desktop/src/components/message.tsx @@ -1,8 +1,8 @@ import type { Part, TextPart, ToolPart, Message } from "@opencode-ai/sdk" -import { createMemo, For, Show } from "solid-js" +import { createMemo, For, Match, Show, Switch } from "solid-js" import { Dynamic } from "solid-js/web" import { Markdown } from "./markdown" -import { Checkbox, Diff, Icon } from "@opencode-ai/ui" +import { Card, Checkbox, Diff, Icon } from "@opencode-ai/ui" import { Message as MessageDisplay, registerPartComponent } from "@opencode-ai/ui" import { BasicTool, GenericTool, ToolRegistry, DiffChanges } from "@opencode-ai/ui" import { getDirectory, getFilename } from "@/utils" @@ -36,6 +36,27 @@ registerPartComponent("tool", function ToolPartDisplay(props) { const metadata = part.state.status === "pending" ? {} : (part.state.metadata ?? {}) const input = part.state.status === "completed" ? part.state.input : {} + if (part.state.status === "error") { + const error = part.state.error.replace("Error: ", "") + const [title, ...rest] = error.split(": ") + return ( + <Card variant="error"> + <div class="flex items-center gap-2"> + <Icon name="circle-ban-sign" size="small" class="text-icon-critical-active" /> + <Switch> + <Match when={title}> + <div class="flex items-center gap-2"> + <div class="text-12-medium text-[var(--ember-light-11)] capitalize">{title}</div> + <span>{rest.join(": ")}</span> + </div> + </Match> + <Match when={true}>{error}</Match> + </Switch> + </div> + </Card> + ) + } + return ( <Dynamic component={render} |
