mirror of
https://github.com/sst/opencode.git
synced 2025-08-23 14:34:08 +00:00
ignore: share page thinking blocks
This commit is contained in:
parent
b2a4f57d64
commit
04b51f2610
4 changed files with 19 additions and 39 deletions
|
@ -75,7 +75,7 @@ export function IconRobot(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://icones.js.org/collection/ri?s=brain&icon=ri:brain-2-line
|
// https://icones.js.org/collection/ri?s=brain&icon=ri:brain-2-line
|
||||||
/* export function IconBrain(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
|
export function IconBrain(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
|
||||||
return (
|
return (
|
||||||
<svg {...props} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
<svg {...props} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||||
<path
|
<path
|
||||||
|
@ -84,4 +84,4 @@ export function IconRobot(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
} */
|
}
|
||||||
|
|
|
@ -128,29 +128,28 @@
|
||||||
max-width: var(--md-tool-width);
|
max-width: var(--md-tool-width);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* [data-component="assistant-reasoning"] {
|
[data-component="assistant-reasoning"] {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
gap: 0.5rem;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
max-width: var(--md-tool-width);
|
max-width: var(--md-tool-width);
|
||||||
|
|
||||||
[data-component="assistant-reasoning-markdown"] {
|
[data-component="assistant-reasoning-markdown"] {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
font-size: 0.875rem;
|
font-size: 0.75rem;
|
||||||
border: 1px solid var(--sl-color-blue-high);
|
border: 1px solid var(--sl-color-blue-high);
|
||||||
padding: 0.5rem calc(0.5rem + 3px);
|
padding: 0.5rem calc(0.5rem + 3px);
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 0.5rem;
|
|
||||||
|
|
||||||
[data-component="copy-button"] {
|
[data-component="copy-button"] {
|
||||||
top: 0.5rem;
|
top: 0.5rem;
|
||||||
right: calc(0.5rem - 1px);
|
right: calc(0.5rem - 1px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} */
|
}
|
||||||
|
|
||||||
[data-component="assistant-text"] {
|
[data-component="assistant-text"] {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
|
@ -19,7 +19,7 @@ import {
|
||||||
IconMagnifyingGlass,
|
IconMagnifyingGlass,
|
||||||
IconDocumentMagnifyingGlass,
|
IconDocumentMagnifyingGlass,
|
||||||
} from "../icons"
|
} from "../icons"
|
||||||
import { IconMeta, IconRobot, IconOpenAI, IconGemini, IconAnthropic /*, IconBrain */ } from "../icons/custom"
|
import { IconMeta, IconRobot, IconOpenAI, IconGemini, IconAnthropic, IconBrain } from "../icons/custom"
|
||||||
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"
|
||||||
|
@ -83,9 +83,9 @@ export function Part(props: PartProps) {
|
||||||
>
|
>
|
||||||
{(model) => <ProviderIcon model={model()} size={18} />}
|
{(model) => <ProviderIcon model={model()} size={18} />}
|
||||||
</Match>
|
</Match>
|
||||||
{/* <Match when={props.part.type === "reasoning" && props.message.role === "assistant"}>
|
<Match when={props.part.type === "reasoning" && props.message.role === "assistant"}>
|
||||||
<IconBrain width={18} height={18} />
|
<IconBrain width={18} height={18} />
|
||||||
</Match> */}
|
</Match>
|
||||||
<Match when={props.part.type === "tool" && props.part.tool === "todowrite"}>
|
<Match when={props.part.type === "tool" && props.part.tool === "todowrite"}>
|
||||||
<IconQueueList width={18} height={18} />
|
<IconQueueList width={18} height={18} />
|
||||||
</Match>
|
</Match>
|
||||||
|
@ -148,33 +148,26 @@ export function Part(props: PartProps) {
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{DateTime.fromMillis(props.message.time.completed).toLocaleString(DateTime.DATETIME_MED)}
|
{DateTime.fromMillis(props.message.time.completed).toLocaleString(DateTime.DATETIME_MED)}
|
||||||
{/*
|
|
||||||
DateTime.fromMillis(props.message.time.completed || props.message.time.created).toLocaleString(
|
|
||||||
DateTime.DATETIME_MED,
|
|
||||||
)}
|
|
||||||
{` | ${props.message.modelID}`}
|
|
||||||
{props.message.mode && (
|
|
||||||
<span style={{ color: "var(--sl-color-accent)" }}>{` | ${props.message.mode}`}</span>
|
|
||||||
)
|
|
||||||
*/}
|
|
||||||
</Footer>
|
</Footer>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{/* {props.message.role === "assistant" && props.part.type === "reasoning" && (
|
{props.message.role === "assistant" && props.part.type === "reasoning" && (
|
||||||
<div data-component="tool">
|
<div data-component="tool">
|
||||||
<div data-component="tool-title">
|
<div data-component="tool-title">
|
||||||
<span data-slot="name">Thinking</span>
|
<span data-slot="name">Thinking</span>
|
||||||
</div>
|
</div>
|
||||||
<div data-component="assistant-reasoning">
|
<Show when={props.part.text}>
|
||||||
<ResultsButton showCopy="Show details" hideCopy="Hide details">
|
<div data-component="assistant-reasoning">
|
||||||
<div data-component="assistant-reasoning-markdown">
|
<ResultsButton showCopy="Show details" hideCopy="Hide details">
|
||||||
<ContentMarkdown expand text={props.part.text || "Thinking..."} />
|
<div data-component="assistant-reasoning-markdown">
|
||||||
</div>
|
<ContentMarkdown expand text={props.part.text || "Thinking..."} />
|
||||||
</ResultsButton>
|
</div>
|
||||||
|
</ResultsButton>
|
||||||
</div>
|
</div>
|
||||||
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
)} */}
|
)}
|
||||||
{
|
{
|
||||||
props.message.role === "user" && props.part.type === "file" && (
|
props.message.role === "user" && props.part.type === "file" && (
|
||||||
<div data-component="attachment">
|
<div data-component="attachment">
|
||||||
|
@ -188,17 +181,6 @@ export function Part(props: PartProps) {
|
||||||
<div data-component="step-start">
|
<div data-component="step-start">
|
||||||
<div data-slot="provider">{props.message.providerID}</div>
|
<div data-slot="provider">{props.message.providerID}</div>
|
||||||
<div data-slot="model">{props.message.modelID}</div>
|
<div data-slot="model">{props.message.modelID}</div>
|
||||||
{ /*
|
|
||||||
<div data-slot="model">
|
|
||||||
{DateTime.fromMillis(props.message.time.completed || props.message.time.created).toLocaleString(
|
|
||||||
DateTime.DATETIME_MED,
|
|
||||||
)}
|
|
||||||
{` | ${props.message.modelID}`}
|
|
||||||
{props.message.mode && (
|
|
||||||
<span style={{ color: "var(--sl-color-accent)" }}>{` | ${props.message.mode}`}</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
*/ }
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
---
|
---
|
||||||
import { Base64 } from "js-base64";
|
import { Base64 } from "js-base64";
|
||||||
// import config from "virtual:starlight/user-config";
|
|
||||||
|
|
||||||
import config from '../../../config.mjs'
|
import config from '../../../config.mjs'
|
||||||
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
|
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue