From 19974daa67b034062e991cff6611477741c0a09d Mon Sep 17 00:00:00 2001
From: Adam <2363879+adamdotdevin@users.noreply.github.com>
Date: Thu, 30 Oct 2025 10:16:45 -0500
Subject: wip: desktop work

---
 packages/desktop/src/components/message.tsx | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

(limited to 'packages/desktop/src/components/message.tsx')

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}
-- 
cgit v1.2.3

