ci: format

This commit is contained in:
Dax Raad
2025-09-09 23:43:37 -04:00
parent 58fe884327
commit 38e8c42cf0
68 changed files with 921 additions and 1018 deletions

View File

@@ -37,11 +37,7 @@ function getStatusText(status: [Status, string?]): string {
}
}
export default function Share(props: {
id: string
api: string
info: Session.Info
}) {
export default function Share(props: { id: string; api: string; info: Session.Info }) {
let lastScrollY = 0
let hasScrolledToAnchor = false
let scrollTimeout: number | undefined
@@ -67,7 +63,8 @@ export default function Share(props: {
created: props.info.time.created,
updated: props.info.time.updated,
},
}, messages: {}
},
messages: {},
})
const messages = createMemo(() => Object.values(store.messages).toSorted((a, b) => a.id?.localeCompare(b.id)))
const [connectionStatus, setConnectionStatus] = createSignal<[Status, string?]>(["disconnected", "Disconnected"])
@@ -413,7 +410,11 @@ export default function Share(props: {
</li>
<li>
<span data-element-label>Output Tokens</span>
{data().tokens.output ? <span>{data().tokens.output}</span> : <span data-placeholder>&mdash;</span>}
{data().tokens.output ? (
<span>{data().tokens.output}</span>
) : (
<span data-placeholder>&mdash;</span>
)}
</li>
<li>
<span data-element-label>Reasoning Tokens</span>

View File

@@ -90,7 +90,6 @@
}
[data-component="mobile"] {
& > [data-component="diff-block"]:first-child > div {
padding-top: 0.25rem;
}

View File

@@ -61,5 +61,4 @@
padding: 2px 0;
font-size: 0.75rem;
}
}

View File

@@ -10,19 +10,12 @@ export function ContentError(props: Props) {
const overflow = createOverflow()
return (
<div
class={style.root}
data-expanded={expanded() || props.expand === true ? true : undefined}
>
<div class={style.root} data-expanded={expanded() || props.expand === true ? true : undefined}>
<div data-section="content" ref={overflow.ref}>
{props.children}
</div>
{((!props.expand && overflow.status) || expanded()) && (
<button
type="button"
data-element-button-text
onClick={() => setExpanded((e) => !e)}
>
<button type="button" data-element-button-text onClick={() => setExpanded((e) => !e)}>
{expanded() ? "Show less" : "Show more"}
</button>
)}

View File

@@ -11,8 +11,7 @@ export function CopyButton(props: CopyButtonProps) {
function handleCopyClick() {
if (props.text) {
navigator.clipboard.writeText(props.text)
.catch((err) => console.error("Copy failed", err))
navigator.clipboard.writeText(props.text).catch((err) => console.error("Copy failed", err))
setCopied(true)
setTimeout(() => setCopied(false), 2000)
@@ -21,15 +20,8 @@ export function CopyButton(props: CopyButtonProps) {
return (
<div data-component="copy-button" class={styles.root}>
<button
type="button"
onClick={handleCopyClick}
data-copied={copied() ? true : undefined}
>
{copied()
? <IconCheckCircle width={16} height={16} />
: <IconClipboard width={16} height={16} />
}
<button type="button" onClick={handleCopyClick} data-copied={copied() ? true : undefined}>
{copied() ? <IconCheckCircle width={16} height={16} /> : <IconClipboard width={16} height={16} />}
</button>
</div>
)

View File

@@ -168,32 +168,25 @@ export function Part(props: PartProps) {
</Show>
</div>
)}
{
props.message.role === "user" && props.part.type === "file" && (
<div data-component="attachment">
<div data-slot="copy">Attachment</div>
<div data-slot="filename">{props.part.filename}</div>
</div>
)
}
{
props.part.type === "step-start" && props.message.role === "assistant" && (
<div data-component="step-start">
<div data-slot="provider">{props.message.providerID}</div>
<div data-slot="model">{props.message.modelID}</div>
</div>
)
}
{
props.part.type === "tool" && props.part.state.status === "error" && (
<div data-component="tool" data-tool="error">
<ContentError>{formatErrorString(props.part.state.error)}</ContentError>
<Spacer />
</div>
)
}
{
props.part.type === "tool" &&
{props.message.role === "user" && props.part.type === "file" && (
<div data-component="attachment">
<div data-slot="copy">Attachment</div>
<div data-slot="filename">{props.part.filename}</div>
</div>
)}
{props.part.type === "step-start" && props.message.role === "assistant" && (
<div data-component="step-start">
<div data-slot="provider">{props.message.providerID}</div>
<div data-slot="model">{props.message.modelID}</div>
</div>
)}
{props.part.type === "tool" && props.part.state.status === "error" && (
<div data-component="tool" data-tool="error">
<ContentError>{formatErrorString(props.part.state.error)}</ContentError>
<Spacer />
</div>
)}
{props.part.type === "tool" &&
props.part.state.status === "completed" &&
props.message.role === "assistant" && (
<>
@@ -295,10 +288,9 @@ export function Part(props: PartProps) {
.toMillis()}
/>
</>
)
}
</div >
</div >
)}
</div>
</div>
)
}