The open source coding agent.
TypeScript
fix: unwrap solid store part
Adam6a1552f65c04
diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsxindex 74aa3d98a16..1c2ba97f340 100644--- a/packages/ui/src/components/message-part.tsx+++ b/packages/ui/src/components/message-part.tsx@@ -18,6 +18,7 @@ import { DiffChanges } from "./diff-changes"import { Markdown } from "./markdown"import { getDirectory, getFilename } from "@opencode-ai/util/path"import { sanitizePart } from "@opencode-ai/util/sanitize"+import { unwrap } from "solid-js/store"export interface MessageProps {message: MessageType@@ -83,7 +84,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTypexport function Part(props: MessagePartProps) {const component = createMemo(() => PART_MAPPING[props.part.type])- const part = createMemo(() => sanitizePart(props.part, props.sanitize))+ const part = createMemo(() => sanitizePart(unwrap(props.part), props.sanitize))return (<Show when={component()}><Dynamic component={component()} part={part()} message={props.message} hideDetails={props.hideDetails} />@@ -175,7 +176,7 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) {PART_MAPPING["text"] = function TextPartDisplay(props) {const part = props.part as TextPart- const sanitized = createMemo(() => (props.sanitize ? (sanitizePart(part, props.sanitize) as TextPart) : part))+ const sanitized = createMemo(() => (props.sanitize ? (sanitizePart(unwrap(part), props.sanitize) as TextPart) : part))return (<Show when={part.text.trim()}><div data-component="text-part">