mirror of
https://github.com/sst/opencode.git
synced 2025-08-30 17:57:25 +00:00
docs: share bugs
This commit is contained in:
parent
f99e2b3429
commit
3ba5d528b4
2 changed files with 13 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
import { type JSX, splitProps, createResource, Suspense } from "solid-js"
|
|
||||||
import { codeToHtml } from "shiki"
|
import { codeToHtml } from "shiki"
|
||||||
import style from "./content-code.module.css"
|
import { createResource, Suspense } from "solid-js"
|
||||||
import { transformerNotationDiff } from "@shikijs/transformers"
|
import { transformerNotationDiff } from "@shikijs/transformers"
|
||||||
|
import style from "./content-code.module.css"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
code: string
|
code: string
|
||||||
|
|
|
@ -28,7 +28,6 @@ import {
|
||||||
IconDocumentMagnifyingGlass,
|
IconDocumentMagnifyingGlass,
|
||||||
} from "../icons"
|
} from "../icons"
|
||||||
import { IconMeta, IconOpenAI, IconGemini, IconAnthropic } from "../icons/custom"
|
import { IconMeta, IconOpenAI, IconGemini, IconAnthropic } from "../icons/custom"
|
||||||
import CodeBlock from "../CodeBlock"
|
|
||||||
import { ContentCode } from "./content-code"
|
import { ContentCode } from "./content-code"
|
||||||
import { ContentDiff } from "./content-diff"
|
import { ContentDiff } from "./content-diff"
|
||||||
import { ContentText } from "./content-text"
|
import { ContentText } from "./content-text"
|
||||||
|
@ -133,7 +132,8 @@ export function Part(props: PartProps) {
|
||||||
<div data-component="content">
|
<div data-component="content">
|
||||||
{props.message.role === "user" && props.part.type === "text" && (
|
{props.message.role === "user" && props.part.type === "text" && (
|
||||||
<>
|
<>
|
||||||
<ContentText text={props.part.text} expand={props.last} /> <Spacer />
|
<ContentText text={props.part.text} expand={props.last} />
|
||||||
|
<Spacer />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{props.message.role === "assistant" && props.part.type === "text" && (
|
{props.message.role === "assistant" && props.part.type === "text" && (
|
||||||
|
@ -165,6 +165,14 @@ export function Part(props: PartProps) {
|
||||||
<div data-slot="model">{props.message.modelID}</div>
|
<div data-slot="model">{props.message.modelID}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{props.part.type === "tool" &&
|
||||||
|
props.part.state.status === "error" && (
|
||||||
|
<div data-component="tool">
|
||||||
|
<ContentError>
|
||||||
|
{formatErrorString(props.part.state.error)}
|
||||||
|
</ContentError>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{props.part.type === "tool" &&
|
{props.part.type === "tool" &&
|
||||||
props.part.state.status === "completed" &&
|
props.part.state.status === "completed" &&
|
||||||
props.message.role === "assistant" && (
|
props.message.role === "assistant" && (
|
||||||
|
@ -453,7 +461,7 @@ export function WebFetchTool(props: ToolProps) {
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={props.state.output}>
|
<Match when={props.state.output}>
|
||||||
<ResultsButton>
|
<ResultsButton>
|
||||||
<CodeBlock lang={props.state.input.format || "text"} code={props.state.output} />
|
<ContentCode lang={props.state.input.format || "text"} code={props.state.output} />
|
||||||
</ResultsButton>
|
</ResultsButton>
|
||||||
</Match>
|
</Match>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue