Files
f76cde8e60 MUL-7766: feat(editor): fit Mermaid previews to show the whole diagram, with inline zoom (#8898)
The inline Mermaid preview now opens fitted: the whole diagram within the
column's width and at most 448px tall (the frame's collapse threshold less
padding), never upscaled past natural size. Zoom out / percent / zoom in /
fit buttons step from there; a zoomed diagram scrolls inside the same box
and can be drag-panned both ways. Tap still opens the full viewer.

- New useInlineZoom hook: measures the column, keeps a fitted preview
  fitted on resize, snaps through 100%, and zooms about the visible center.
- The SVG fills its iframe, so zoom resizes the iframe and redraws vectors
  instead of scaling a bitmap.
- Framed blocks get a floating pill bottom-right; the standalone editor
  preview puts the controls in its existing toolbar.
- The layout cache records the fitted height so the lazy shell reserves the
  space the preview actually takes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-09-27 22:55:42 +08:00
..