diff options
| author | Adam <[email protected]> | 2025-10-28 10:46:46 -0500 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-10-28 15:29:16 -0500 |
| commit | c1278109c9600ded4ab937686d4c7288fda2524d (patch) | |
| tree | cddddb1843564754db8f314dee9f27760ffdf153 /packages/desktop/src | |
| parent | a7a88d01efc9d0d8d0c9d273c275f37d1277b43f (diff) | |
| download | opencode-c1278109c9600ded4ab937686d4c7288fda2524d.tar.gz opencode-c1278109c9600ded4ab937686d4c7288fda2524d.zip | |
wip: desktop work
Diffstat (limited to 'packages/desktop/src')
| -rw-r--r-- | packages/desktop/src/components/assistant-message.tsx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/packages/desktop/src/components/assistant-message.tsx b/packages/desktop/src/components/assistant-message.tsx index 248af5313..cfc9d1a49 100644 --- a/packages/desktop/src/components/assistant-message.tsx +++ b/packages/desktop/src/components/assistant-message.tsx @@ -2,7 +2,7 @@ import type { Part, AssistantMessage, ReasoningPart, TextPart, ToolPart } from " import { children, Component, createMemo, For, Match, Show, Switch, type JSX } from "solid-js" import { Dynamic } from "solid-js/web" import { Markdown } from "./markdown" -import { Collapsible, Icon, IconProps } from "@opencode-ai/ui" +import { Checkbox, Collapsible, Icon, IconProps } from "@opencode-ai/ui" import { getDirectory, getFilename } from "@/utils" import type { Tool } from "opencode/tool/tool" import type { ReadTool } from "opencode/tool/read" @@ -14,11 +14,11 @@ import type { TaskTool } from "opencode/tool/task" import type { BashTool } from "opencode/tool/bash" import type { EditTool } from "opencode/tool/edit" import type { WriteTool } from "opencode/tool/write" +import type { TodoWriteTool } from "opencode/tool/todo" import { DiffChanges } from "./diff-changes" -import { TodoWriteTool } from "opencode/tool/todo" export function AssistantMessage(props: { message: AssistantMessage; parts: Part[] }) { - const filteredParts = createMemo(() => props.parts.filter((x) => x.type !== "tool" || x.tool !== "todoread")) + const filteredParts = createMemo(() => props.parts?.filter((x) => x.type !== "tool" || x.tool !== "todoread")) return ( <div class="w-full flex flex-col items-start gap-4"> <For each={filteredParts()}> @@ -394,6 +394,7 @@ ToolRegistry.register<typeof WriteTool>({ ToolRegistry.register<typeof TodoWriteTool>({ name: "todowrite", render(props) { + console.log(props.input.todos) return ( <BasicTool icon="checklist" @@ -402,8 +403,16 @@ ToolRegistry.register<typeof TodoWriteTool>({ subtitle: `${props.input.todos?.filter((t) => t.status === "completed").length}/${props.input.todos?.length}`, }} > - <Show when={false && props.output}> - <div class="whitespace-pre">{props.output}</div> + <Show when={props.input.todos?.length}> + <div class="px-12 pt-2.5 pb-6 flex flex-col gap-2"> + <For each={props.input.todos}> + {(todo) => ( + <Checkbox readOnly checked={todo.status === "completed"}> + <div classList={{ "line-through text-text-weaker": todo.status === "completed" }}>{todo.content}</div> + </Checkbox> + )} + </For> + </div> </Show> </BasicTool> ) |
