Problem
Large Mermaid diagrams in live-preview.nvim are hard to inspect when they are rendered inline in Markdown/AsciiDoc preview. Users currently need browser zoom hacks or horizontal scrolling, which is slow and inconsistent.
Goal
Add a first-class inspect/zoom UX for Mermaid diagrams so users can quickly open a larger focused view and read complex diagrams comfortably.
Proposed behavior
- Show a per-diagram magnifier button on Mermaid diagrams in preview pages.
- Clicking opens a fullscreen/lightbox modal with the diagram cloned at a readable scale.
- Provide controls:
- Zoom in
- Zoom out
- Reset zoom
- Close
- Preserve live-preview behavior across updates/rerenders.
Scope
In scope
- Mermaid diagrams rendered in preview output (Markdown + AsciiDoc where Mermaid is supported).
- UI controls and modal styling injected by preview runtime.
- Idempotent runtime behavior (no duplicated controls/modals on rerender).
Out of scope
- Global page zoom behavior.
- Non-Mermaid content zooming.
- New plugin dependencies.
Acceptance criteria
Test plan
- Manual: Markdown/AsciiDoc files with small and very large Mermaid diagrams.
- Runtime smoke: verify modal creation, controls wiring, and idempotency on repeated rerenders.
- Regression: ensure existing
:LivePreview start/close/pick flow is unaffected.
References
Problem
Large Mermaid diagrams in
live-preview.nvimare hard to inspect when they are rendered inline in Markdown/AsciiDoc preview. Users currently need browser zoom hacks or horizontal scrolling, which is slow and inconsistent.Goal
Add a first-class inspect/zoom UX for Mermaid diagrams so users can quickly open a larger focused view and read complex diagrams comfortably.
Proposed behavior
Scope
In scope
Out of scope
Acceptance criteria
Test plan
:LivePreview start/close/pickflow is unaffected.References