refactor(client): isolate trajectory history

This commit is contained in:
imccyu
2026-07-29 20:21:37 +08:00
parent ee9ea7e3aa
commit e0022ff19e
28 changed files with 1261 additions and 698 deletions

View File

@@ -66,17 +66,6 @@
font: inherit;
}
.noLanguage .bannerWrap {
position: absolute;
right: 0;
background: transparent;
}
.noLanguage .banner {
padding-left: 8px;
background: transparent;
}
.block :where(pre) {
font: var(--dsl-code-block-content-font);
padding: 16px;
@@ -87,10 +76,6 @@
background: var(--dsw-alias-markdown-code-block);
}
.noLanguage :where(pre) {
padding-right: 72px;
}
/* Shiki inlines its theme background var; route it to the repo token. */
.block :where(pre.shiki) {
background: var(--dsw-alias-markdown-code-block) !important;

View File

@@ -59,7 +59,6 @@ async function writeClipboard(text: string): Promise<boolean> {
export function CodeBlock({ code, lang, className }: CodeBlockProps) {
const trimmed = code.endsWith('\n') ? code.slice(0, -1) : code
const hasLanguage = lang !== undefined && lang !== ''
const html = useMemo(() => highlightToHtml(trimmed, lang), [trimmed, lang])
const rootRef = useRef<HTMLDivElement>(null)
const [copied, setCopied] = useState(false)
@@ -88,10 +87,7 @@ export function CodeBlock({ code, lang, className }: CodeBlockProps) {
)
return (
<div
ref={rootRef}
className={clsx(css.block, !hasLanguage && css.noLanguage, 'md-code-block', className)}
>
<div ref={rootRef} className={clsx(css.block, 'md-code-block', className)}>
<div className={css.bannerWrap}>
<div className={css.banner}>
<div className={css.infostring}>{lang ?? ''}</div>