Draw mermaid code blocks in answers as diagrams - #90
Merged
splitbrain merged 1 commit intoOct 4, 2026
Merged
Conversation
Agents could only explain structure and flow in text. A mermaid code block in an answer now shows as a diagram that follows the light or dark mode. While the answer is still streaming, or when the source does not parse, the block shows its source text instead. A tap opens the diagram in the full screen view that images use. The browser's own pinch zoom works there, so phones need no zoom code of their own. Mermaid loads only when a thread contains a diagram. A new image skill tells Claude and Codex that the dashboard draws these blocks, and when a diagram helps. Closes splitbrain#88
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #88
What changed
```mermaidcode block in an answer now shows as a diagram. The diagram follows the light or dark mode.ImageZoomtakes one new optional prop, so the diagram fills the screen width on a solid background.diagrams, tells Claude and Codex that the dashboard draws these blocks, and when a diagram helps.Zoom
There is no zoom code. The browser's own pinch zoom works in the full screen view. I tested this in Chromium with phone settings and a two-finger touch pinch: the view zoomed in, a one-finger drag moved it, and the view stayed open. The diagram is an SVG, so it stays sharp at any zoom level. After you close the view, the page stays zoomed until you pinch back out.
Diagram types
All built-in mermaid types are allowed. Each type loads only when a diagram uses it. The ELK layout is not included.
Tests