mirror of
https://github.com/sst/opencode.git
synced 2025-08-27 16:34:09 +00:00
docs: share page attachment
This commit is contained in:
parent
c056b0add9
commit
2e5f96fa41
3 changed files with 29 additions and 6 deletions
|
@ -321,6 +321,7 @@ export default function Share(props: {
|
||||||
const filteredParts = createMemo(() =>
|
const filteredParts = createMemo(() =>
|
||||||
msg.parts.filter((x, index) => {
|
msg.parts.filter((x, index) => {
|
||||||
if (x.type === "step-start" && index > 0) return false
|
if (x.type === "step-start" && index > 0) return false
|
||||||
|
if (x.type === "text" && x.synthetic === true) return false
|
||||||
if (x.type === "tool" && x.tool === "todoread") return false
|
if (x.type === "tool" && x.tool === "todoread") return false
|
||||||
if (x.type === "text" && !x.text) return false
|
if (x.type === "text" && !x.text) return false
|
||||||
if (x.type === "tool" && (x.state.status === "pending" || x.state.status === "running"))
|
if (x.type === "tool" && (x.state.status === "pending" || x.state.status === "running"))
|
||||||
|
|
|
@ -137,6 +137,29 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[data-component="attachment"] {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.375rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
|
||||||
|
[data-slot="copy"] {
|
||||||
|
line-height: 18px;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: -0.5px;
|
||||||
|
color: var(--sl-color-text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-slot="filename"] {
|
||||||
|
line-height: 1.5;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
font-weight: 500;
|
||||||
|
max-width: var(--md-tool-width);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[data-component="button-text"] {
|
[data-component="button-text"] {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
|
|
|
@ -15,6 +15,7 @@ import {
|
||||||
IconSparkles,
|
IconSparkles,
|
||||||
IconGlobeAlt,
|
IconGlobeAlt,
|
||||||
IconDocument,
|
IconDocument,
|
||||||
|
IconPaperClip,
|
||||||
IconQueueList,
|
IconQueueList,
|
||||||
IconUserCircle,
|
IconUserCircle,
|
||||||
IconCommandLine,
|
IconCommandLine,
|
||||||
|
@ -80,7 +81,7 @@ export function Part(props: PartProps) {
|
||||||
<IconUserCircle width={18} height={18} />
|
<IconUserCircle width={18} height={18} />
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={props.message.role === "user" && props.part.type === "file"}>
|
<Match when={props.message.role === "user" && props.part.type === "file"}>
|
||||||
<IconDocument width={18} height={18} />
|
<IconPaperClip width={18} height={18} />
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={props.part.type === "step-start" && props.message.role === "assistant" && props.message.modelID}>
|
<Match when={props.part.type === "step-start" && props.message.role === "assistant" && props.message.modelID}>
|
||||||
{model => <ProviderIcon model={model()} size={18} />}
|
{model => <ProviderIcon model={model()} size={18} />}
|
||||||
|
@ -152,11 +153,9 @@ export function Part(props: PartProps) {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{props.message.role === "user" && props.part.type === "file" && (
|
{props.message.role === "user" && props.part.type === "file" && (
|
||||||
<div data-component="tool-title">
|
<div data-component="attachment">
|
||||||
<span data-slot="name">Read</span>
|
<div data-slot="copy">Attachment</div>
|
||||||
<span data-slot="target" title={props.part.filename}>
|
<div data-slot="filename">{props.part.filename}</div>
|
||||||
{props.part.filename}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{props.part.type === "step-start" && props.message.role === "assistant" && (
|
{props.part.type === "step-start" && props.message.role === "assistant" && (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue