Render Mermaid code blocks as diagrams in the TUI (#46054)

## What changed

- Render completed `mermaid` fences with `codex-mermaid`, using syntax-theme colors for nodes and edges.
- Keep source visible for unclosed, invalid, unsupported, or oversized diagrams, and preserve the original Mermaid for copying and raw mode.
- Keep streamed diagrams mutable until the next top-level block so closing fences and terminal resizing can update their display. Preserve scrollback progress across width and render-mode changes.

## Testing

Add renderer and streaming tests covering supported diagram families, nested fences, Unicode, theme colors, source fallbacks, resizing, raw-mode transitions, and original-source preservation. Verify that node connection ports retain node styling in all four flowchart directions.

GitOrigin-RevId: 9a759248110e6730d629d653061ff7e2ec5dc2c0
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-16 23:26:00 +00:00
1 parent c56dda711c
commit f915e0de07
18 files changed
+682 -42

No files matched your search

+1
View File
@@ -4784,6 +4784,7 @@ dependencies = [
"codex-install-context",
"codex-login",
"codex-mcp",
"codex-mermaid",
"codex-message-history",
"codex-model-provider",
"codex-model-provider-info",