+
)
--
cgit v1.2.3
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 +++++++++++++++++++++++--
packages/ui/src/components/card.css | 29 +++++++++++++++++++++++++++++
packages/ui/src/components/card.tsx | 22 ++++++++++++++++++++++
packages/ui/src/components/icon.tsx | 1 +
packages/ui/src/components/index.ts | 1 +
packages/ui/src/styles/index.css | 1 +
6 files changed, 77 insertions(+), 2 deletions(-)
create mode 100644 packages/ui/src/components/card.css
create mode 100644 packages/ui/src/components/card.tsx
(limited to 'packages/desktop/src')
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 (
+
+
+
+
+
+
+
{title}
+
{rest.join(": ")}
+
+
+ {error}
+
+
+
+ )
+ }
+
return (
{
+ variant?: "normal" | "error" | "warning" | "success" | "info"
+}
+
+export function Card(props: CardProps) {
+ const [split, rest] = splitProps(props, ["variant", "class", "classList"])
+ return (
+
+ {props.children}
+
+ )
+}
diff --git a/packages/ui/src/components/icon.tsx b/packages/ui/src/components/icon.tsx
index 5736146e5..a2e127290 100644
--- a/packages/ui/src/components/icon.tsx
+++ b/packages/ui/src/components/icon.tsx
@@ -149,6 +149,7 @@ const newIcons = {
console: ``,
"code-lines": ``,
"square-arrow-top-right": ``,
+ "circle-ban-sign": ``,
}
export interface IconProps extends ComponentProps<"svg"> {
diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts
index 63be24d58..29e8cfe3b 100644
--- a/packages/ui/src/components/index.ts
+++ b/packages/ui/src/components/index.ts
@@ -1,5 +1,6 @@
export * from "./accordion"
export * from "./button"
+export * from "./card"
export * from "./checkbox"
export * from "./collapsible"
export * from "./dialog"
diff --git a/packages/ui/src/styles/index.css b/packages/ui/src/styles/index.css
index 9742caa0a..4fe13055a 100644
--- a/packages/ui/src/styles/index.css
+++ b/packages/ui/src/styles/index.css
@@ -7,6 +7,7 @@
@import "../components/accordion.css" layer(components);
@import "../components/button.css" layer(components);
+@import "../components/card.css" layer(components);
@import "../components/checkbox.css" layer(components);
@import "../components/diff.css" layer(components);
@import "../components/diff-changes.css" layer(components);
--
cgit v1.2.3
From dce287a42d5b4bb965ee74707bf7b0b0709d61f1 Mon Sep 17 00:00:00 2001
From: Adam <2363879+adamdotdevin@users.noreply.github.com>
Date: Thu, 30 Oct 2025 10:33:45 -0500
Subject: wip: desktop work
---
bun.lock | 4 +-
package.json | 2 +-
packages/desktop/src/components/message.tsx | 63 ++++++++++++++++-------------
packages/desktop/src/pages/index.tsx | 2 +-
packages/ui/src/components/diff.tsx | 10 ++---
packages/ui/src/components/message-part.tsx | 6 +--
6 files changed, 42 insertions(+), 45 deletions(-)
(limited to 'packages/desktop/src')
diff --git a/bun.lock b/bun.lock
index bb1d65673..c651e3a68 100644
--- a/bun.lock
+++ b/bun.lock
@@ -347,7 +347,7 @@
"@hono/zod-validator": "0.4.2",
"@kobalte/core": "0.13.11",
"@openauthjs/openauth": "0.0.0-20250322224806",
- "@pierre/precision-diffs": "0.3.6",
+ "@pierre/precision-diffs": "0.4.1",
"@solidjs/meta": "0.29.4",
"@tailwindcss/vite": "4.1.11",
"@tsconfig/bun": "1.0.9",
@@ -941,7 +941,7 @@
"@petamoriken/float16": ["@petamoriken/float16@3.9.2", "", {}, "sha512-VgffxawQde93xKxT3qap3OH+meZf7VaSB5Sqd4Rqc+FP5alWbpOyan/7tRbOAvynjpG3GpdtAuGU/NdhQpmrog=="],
- "@pierre/precision-diffs": ["@pierre/precision-diffs@0.3.6", "", { "dependencies": { "@shikijs/core": "3.13.0", "@shikijs/transformers": "3.13.0", "diff": "8.0.2", "fast-deep-equal": "3.1.3", "hast-util-to-html": "9.0.5", "shiki": "3.13.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-cKM3HcMmyr5wPFll0bHYcgHplcHgMlL6Dw4Pi4giL0jVt7ySlGwwVyXTRFW5Fva43stOL+EWB+9U5VBDSktBJA=="],
+ "@pierre/precision-diffs": ["@pierre/precision-diffs@0.4.1", "", { "dependencies": { "@shikijs/core": "3.13.0", "@shikijs/transformers": "3.13.0", "diff": "8.0.2", "fast-deep-equal": "3.1.3", "hast-util-to-html": "9.0.5", "shiki": "3.13.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-AoozHakINGyNJFgbYc/1PlDK0yunrAxbtXEMBe9fdu8RLkNjVtYRTLw7EF2mM/YuVoVRjj2HT/2VJ4a2rMyDOA=="],
"@pkgjs/parseargs": ["@pkgjs/parseargs@0.11.0", "", {}, "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg=="],
diff --git a/package.json b/package.json
index 32e974f5b..2a0c07d88 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"@tsconfig/bun": "1.0.9",
"@cloudflare/workers-types": "4.20251008.0",
"@openauthjs/openauth": "0.0.0-20250322224806",
- "@pierre/precision-diffs": "0.3.6",
+ "@pierre/precision-diffs": "0.4.1",
"@solidjs/meta": "0.29.4",
"@tailwindcss/vite": "4.1.11",
"diff": "8.0.2",
diff --git a/packages/desktop/src/components/message.tsx b/packages/desktop/src/components/message.tsx
index 78be29d75..70d03591a 100644
--- a/packages/desktop/src/components/message.tsx
+++ b/packages/desktop/src/components/message.tsx
@@ -15,7 +15,7 @@ registerPartComponent("text", function TextPartDisplay(props) {
const part = props.part as TextPart
return (
-
+
)
})
@@ -36,36 +36,41 @@ 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 (
-
-
-
-
-
+ return (
+
+
+ {(error) => {
+ const cleaned = error().replace("Error: ", "")
+ const [title, ...rest] = cleaned.split(": ")
+ return (
+
-
{title}
-
{rest.join(": ")}
+
+
+
+
+
{title}
+
{rest.join(": ")}
+
+
+ {cleaned}
+
-
- {error}
-
-
-
- )
- }
-
- return (
-
+
+ )
+ }}
+
+
+
+
+
)
})
diff --git a/packages/desktop/src/pages/index.tsx b/packages/desktop/src/pages/index.tsx
index 1ae39a6b3..0ff4423ad 100644
--- a/packages/desktop/src/pages/index.tsx
+++ b/packages/desktop/src/pages/index.tsx
@@ -832,7 +832,7 @@ export default function Page() {