Feat/mermaid rendering#29
Merged
Merged
Conversation
Builds on Darvell's mermaid-rendering work. Three small fixes: - Drop the fixed `diagramHeight()` formula and `minHeight: proxy.size.height` on the unzoomed branch. The image now flows at container-width × intrinsic aspect, eliminating the 60-150pt of dead space above and below each diagram. - Skip the inner `ScrollView` when zoom is 1. Previously the wrapping ScrollView consumed wheel events even at the natural fit, so the document scroll would stall whenever the cursor passed over a diagram. The zoom > 1 branch still wraps in a ScrollView (with a pinned 540pt viewport) so panning works. - Style picker: replace per-option `Toggle`+manual binding with a `Picker`, giving native radio semantics and a proper checkmark on the selected style. Also swaps `foregroundColor` for `foregroundStyle` on the chrome icons. Co-Authored-By: Darvell <1046915+darvell@users.noreply.github.com>
Two follow-ups on top of the sizing fix: - Diagram view: drop the stacked-above chrome row and float the toolbar as a translucent capsule in the top-right of the diagram (Preview / Quick Look style). The diagram now occupies the full box. The capsule is hover- revealed, .thinMaterial background with a hairline border. - Source view: when toggled to source, render with mdv's normal code-block chrome — `mermaid` language label top-left, hover-revealed wrap / show-diagram / copy buttons top-right, horizontal-scroll or wrap layout for the code. The view now feels like every other fenced block in the document instead of a one-off. Context menu also splits by mode: source shows wrap; diagram shows style picker and export. Co-Authored-By: Darvell <1046915+darvell@users.noreply.github.com>
`@State` was wrong — it scoped the style to a single diagram instance, so
each block had its own palette and the picker felt useless. Move to
`@AppStorage("mdv.mermaid.style")` so picking a style updates every diagram
in the document at once and the choice survives restarts.
Co-Authored-By: Darvell <1046915+darvell@users.noreply.github.com>
Owner
Author
|
THIS IS NOT MY WORK MUST CREDIT @darvell But I (1) suck at git and (2) don't fully trust Claude to drive git so however I put this together I somehow stripped attribution. Sorry. Wish I could say I was going to get better at this but I refuse to get better at git. |
10 tasks
hazadus
added a commit
to hazadus/mdv
that referenced
this pull request
May 15, 2026
PR tqbf#29 added Mermaid rendering but none of the user-facing docs were updated. Our gantt follow-up made the gap more visible: gantt.md was listed nowhere, and Help.md had no mention of diagrams at all. - README.md: add Mermaid to the features bullet list, noting the native/WKWebView split. - Help.md: new "Mermaid diagrams" section covering the style picker, source toggle, export, zoom, and the native-vs-bundled rendering split. - test-docs/README.md: add gantt.md entry explaining what it tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.