Repository navigation
Replies: 6 comments
|
Thanks for doing the archaeology — this is the first of these threads that names the actual dispatch point, so I verified it against the repo at Seam confirmed
Precedent table: all confirmed
Two framing corrections (the substance stands)
Tracker correctionOn the public repo, Issues and PRs are disabled ( Mergeability, maintainer viewThe core change is genuinely small and correctly placed: one settled-only arm in Consolidation: agreed — #2711 is the natural canonical thread, and this post plus #1065/#1135/#3346 could fold under it. |
|
Following up on @PerryLink's review above: I implemented that checklist as a real branch. It is now published and fetchable. Branch: https://github.com/XiaoBinGan/deepseek-harness/tree/feat-mermaid — commit Your checklist, item by item1. "mermaid in ui-primitives devDeps" — done. 2. "the lazy chunk left unassigned in
So you were right that the katex "static + vendor" half of my earlier framing was wrong, and right about the shiki-grammar precedent being the one to follow — that is what the branch does. 3. "zh+en keys for the new chrome" — done. Six keys in each of 4. "unit tests + Measured, just now, on the branch: The commit adds 22 test cases and removes 0, so the pre-commit baseline derives to 55 files / 1192 tests. I could not measure that baseline directly without checking out the base commit, so treat 55/1192 as arithmetic from a measured 1214, not as a separately observed run. 5. "an e2e mirroring Real output: Your other points
One thing you did not ask forRestoring a reliable language marker on the real code-block DOM. The language previously reached only the infostring text, so What is NOT verified
|
0.2.1-alpha.2 复测:mermaid 围栏仍然只是代码块(2026-10-12)补一条版本证据。同类请求已经有 5 条(#1065 / #1135 / #2711 / #3346 / #6056),而到今天为止还没有任何一条进版本。 实测环境: 证据(直接在安装包的 299 个
期望的 UX(对齐 DeepSeek 网页版):助手气泡里的 生态现状:这件事至少有 6 个社区包在各自实现。这既说明缺口真实,也说明 DOM 后处理的成本有多高——每个包都得自带一份 mermaid、自己的主题接线、自己的 DOM 选择器:
ask:#6502 里 PerryLink 已确认 seam 真实可行,XiaoBinGan 也交了真分支( 另:#7614 实测 (本条是补充版本证据,不是新请求;canonical 仍是 #2711。) |
|
Thanks for confirming the seam. My main goal isn't to push a specific implementation, but to avoid every plugin having to patch the DOM independently. If merging the existing branch isn't the preferred direction, an official fenced-code renderer extension point would already solve the ecosystem problem.
|
|
Retest on Two current-version details that matter for the seam proposal:
What I'd ask for, in order of value:
Interim workaround for anyone landing here: |
|
Confirming the shared-primitive path (0.2.1-rc.2) Following up on @xwh5's 10-12 note that the sidebar
On #6056: its sidebar-preview half has since been superseded by the built-in preview in 0.2.1-rc.2, but the Happy to test a branch on 0.2.1-rc.2 across both chat and the sidebar preview. |
Uh oh!
There was an error while loading. Please reload this page.
TL;DR — this is at least the fourth request for the same thing (#1065, #1135, #2711, #3346), so rather than another bare "+1" this post collects everything needed to decide once: the exact seam, the in-repo precedent, the fact that
mermaidis already a dependency of this repo, two community plugins that already ship it, and a mergeable branch in #6056. Please consolidate into one canonical thread if that helps — I'm happy to have this closed as a duplicate of #2711.Current behavior (observed on
dsh 0.1.5-rc.1)Chat messages render markdown, but a ```mermaid fence falls through to the generic code block. The renderer has exactly one special arm, and it is
math:Repro — paste this into a session; you get a highlighted code block, not a chart:
xychart-beta title "Daily reviews at 100 new cards/day" x-axis "Month" [1,3,5,7,9,11,13,15,17,19,21,23] y-axis "cards/day" 0 --> 800 line [100,466,598,700,759,847,902,960,1019,1087,1197,1284]Flowcharts and sequence diagrams are the common case, but numeric
xychart(trend data from a simulation) is the one that hurts most here — there is no way to eyeball the shape without leaving the app for mermaid.live.Everything needed already exists in this repo
The missing piece really is just the client arm:
mermaid@11.16.0is already a root dependencypackage.json(devDependencies)scripts/verify-mermaid.ts(PATTERNS: README,docs/**,packages/*/*.md,.agents/**)website/.vitepress/config.ts—withMermaid(...), and fences['mermaid','mmd']mapped torenderFencemarkdown/render.tsx→katex.tsx→apps/web/tests/math-rendering.e2e.tspackages/client/ui-primitives/src/markdown/CodeBlock.tsxSo mermaid is the only diagram vocabulary that the product UI does not render, while the repo both depends on it and validates it.
Proposed minimal change (mirrors the math arm)
if (!context.streaming && (lang === 'mermaid' || lang === 'mmd'))→<MermaidDiagram source={node.value} />, settled-only so a half-streamed fence keeps rendering as code (thematharm already establishes this rule).await import('mermaid')on first use — the ~500 KB stays out of the boot chunk; sessions without diagrams never pay for it.mermaid.initialize({ startOnLoad: false, securityLevel: 'strict' })— fence source is untrusted model output — and bind the theme to the existing light/dark tokens so it follows the app theme.math-rendering.e2e.ts.Already built, by the community and in branches
MermaidDiagramprimitive added toui-primitives(lazy chunk) plus a sidebar markdown preview: 48 files, single commit, reported asAble to merge.Those plugins prove the value but also show the cost of the current gap: each one has to ship its own mermaid bundle, its own theme wiring and its own DOM post-processing.
The actual ask
Either land #6056 (or an equivalent core arm), or expose a documented client seam for fenced-block rendering so a plugin can register a renderer for a language instead of mutating the DOM after the fact. Either outcome closes this class of request for good.
Thanks — and again, consolidating the five threads into one would probably help more than this post's contents.
All reactions