Render Mermaid diagrams in the TUI - #622
Open
acking-you wants to merge 1 commit into
Open
Conversation
acking-you
marked this pull request as ready for review
September 3, 2026 17:40
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 #621
Summary
mermaidcode fences as bounded Unicode diagrams in the TUI transcriptThe width-aware fallback follows the UX established by Grok Build's terminal Mermaid renderer: render the diagram when the TUI can carry it, otherwise keep the original source readable.
Example
At a wide transcript width this renders as terminal-native diagram art. Shrinking below the diagram's required width restores the fenced Mermaid source; widening the terminal renders the diagram again.
Verification
zig fmt --check src/zig build -Doptimize=ReleaseSafe./scripts/check-public-surface.shThe E2E covers the complete requested lifecycle in one real model turn: an open fence stays source, the closed fence renders at 90 columns, a resize to 20 columns falls back to source, and a resize back to 90 columns restores the diagram. It also verifies one model request, a live pane, clean stderr, and a usable composer after completion.
Classification
type: feature