feat(ui): complete trajectory request inspection

This commit is contained in:
_Kerman
2026-07-28 09:53:32 +08:00
parent 4137405cdd
commit b3ea0d987e
32 changed files with 1692 additions and 655 deletions

View File

@@ -49,7 +49,7 @@
}
.expandedTopLevelContainer {
padding: 0 0 0 calc(2ch - 12px);
padding: 0;
}
.row.topLevelBracket {
@@ -59,7 +59,7 @@
.children {
margin: 0;
padding: 0 0 0 4px;
padding: 0;
list-style: none;
}
@@ -69,7 +69,7 @@
min-width: 100%;
min-height: 16px;
margin: 0;
padding: 0 0 0 12px;
padding: 0 0 0 10px;
list-style: none;
}
@@ -178,7 +178,7 @@
left: 0;
display: inline-flex;
align-items: center;
justify-content: center;
justify-content: flex-start;
box-sizing: border-box;
width: 8px;
height: 16px;
@@ -196,7 +196,7 @@
border-left: 6px solid currentColor;
content: '';
transform: scale(0.75);
transform-origin: center;
transform-origin: 33.333% center;
}
.collapseIcon::before {

View File

@@ -66,6 +66,17 @@
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;
@@ -76,6 +87,10 @@
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

@@ -52,6 +52,7 @@ 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)
@@ -80,7 +81,10 @@ export function CodeBlock({ code, lang, className }: CodeBlockProps) {
)
return (
<div ref={rootRef} className={clsx(css.block, 'md-code-block', className)}>
<div
ref={rootRef}
className={clsx(css.block, !hasLanguage && css.noLanguage, 'md-code-block', className)}
>
<div className={css.bannerWrap}>
<div className={css.banner}>
<div className={css.infostring}>{lang ?? ''}</div>

View File

@@ -1,8 +1,7 @@
/**
* Markdown-to-plain-text projection for compact summaries and labels.
* Parsing shares the renderer's GFM grammar; raw HTML is intentionally
* omitted, links keep their labels, images keep alt text, and code keeps its
* source text.
* Parsing shares the renderer's GFM grammar; raw HTML remains literal, links
* keep their labels, images keep alt text, and code keeps its source text.
*/
import { fromMarkdown } from 'mdast-util-from-markdown'
@@ -37,6 +36,7 @@ function inlineText(node: MarkdownNode): string {
case 'break':
return '\n'
case 'html':
return node.value ?? ''
case 'thematicBreak':
case 'definition':
return ''
@@ -70,6 +70,7 @@ function blockText(node: MarkdownNode): string {
case 'tableCell':
return compactInline(inlineText(node))
case 'html':
return node.value?.trim() ?? ''
case 'thematicBreak':
case 'definition':
return ''