Skip to content

docs: correct claims about shipped platforms, SVG, and P/Invoke (Batch 1)#57

Merged
clintecker merged 1 commit into
mainfrom
docs/audit-batch1-capabilities
Jul 21, 2026
Merged

docs: correct claims about shipped platforms, SVG, and P/Invoke (Batch 1)#57
clintecker merged 1 commit into
mainfrom
docs/audit-batch1-capabilities

Conversation

@clintecker

@clintecker clintecker commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Batch 1 of the doc-accuracy audit — the 5 high-severity "shipped but documented as unbuilt" fixes. Closes #52.

Every claim verified against code before editing:

  • F1product.md / BRIEF.md said rendering is Apple(+Linux)-only and the Android renderer is "planned, not shipped." Reality: native renderers on Apple, Linux, Android (Kotlin Canvas), Windows/.NET (SkiaSharp), WASM, and Flutter over RenderScene/SceneWire (README:12, CHANGELOG 2.0.0).
  • F2 — SVG called "most-wanted"/unbuilt; it shipped as MermaidRenderer.svg over SVGRenderer (MermaidRenderer+SVG.swift:39). Removed from roadmap + dropped "Don't claim SVG output."
  • F3 — Windows P/Invoke bridge called "still open"; it's implemented (MermaidNative.cs [DllImport("MermaidKitCShared")]), tested (PInvokeTests.cs), CI-gated on windows-latest. Only the device-font measure callback remains. Also fixed the diagram DLL name (F13).
  • F4MermaidTheme.fromMaterial() won't compile (no zero-arg overload) → fromMaterial(MaterialTheme.colorScheme).
  • F5 — pi-canvas "zoom re-rasterizes for crispness" is false on its headline Linux/Silica path (silicaRaster ignores targetWidth); qualified per-backend.

Also advances #53 (product.md v1.4.0→v2.2.0, co-located in the same sentence) and #56 (F13).

Docs-only; no code changed.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Documentation
    • Updated platform documentation to reflect broader native rendering support across Linux, Android, Windows/.NET, WebAssembly, and Flutter.
    • Documented the shipped Windows native bridge, including verified end-to-end coverage.
    • Refined Android theming guidance for Compose integrations.
    • Clarified InfiniteCanvas rendering, caching, zoom, and viewport behavior.
    • Updated project priorities to emphasize syntax coverage and broader OS/toolchain compatibility.

…P/Invoke

Batch 1 of the documentation-accuracy audit (#52). Fixes the "we shipped it
but the docs say we didn't" cluster:

- F1 product.md / BRIEF.md: rendering is native on Apple, Linux, Android
  (Kotlin Canvas), Windows/.NET (SkiaSharp), WebAssembly, and Flutter over the
  platform-free RenderScene/SceneWire contract — not Apple(+Linux)-only. Drops
  the "planned / not shipped Android renderer" scope notes. (Bumps the
  co-located product.md Status v1.4.0 -> v2.2.0, since it shares the sentence.)
- F2 CONTRIBUTING.md / BRIEF.md: the SVG backend shipped
  (MermaidRenderer.svg / SVGRenderer) — removed from "most-wanted"/roadmap and
  the "Don't claim SVG output" site instruction.
- F3 docs/notes/windows.md / windows/README.md: the P/Invoke bridge is
  implemented, tested (PInvokeTests), and CI-gated on windows-latest — moved to
  "Done + verified"; the only open Windows item is the device-font measure
  callback. Also fixes the diagram DLL label mermaidkit.dll ->
  MermaidKitCShared.dll (F13).
- F4 docs/notes/android.md: fromMaterial() -> fromMaterial(MaterialTheme.colorScheme)
  (no zero-arg overload exists — the snippet would not compile).
- F5 tools/pi-canvas/README.md: qualify the zoom-reraster crispness claim —
  it holds on the Apple/CoreGraphics path; on Linux/Silica silicaRaster ignores
  targetWidth, so zoomed cards are repositioned, not re-rasterized larger.

Closes #52. Advances #53 (product.md version) and #56 (F13).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_014CJYAapHgDn2PWGNABnFtv
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Documentation updates correct claims about supported rendering platforms, SVG and RenderScene scope, Windows P/Invoke status, Android Compose theming, InfiniteCanvas zoom behavior, and current contribution priorities.

Changes

Platform and rendering claims

Layer / File(s) Summary
Platform and rendering scope
CONTRIBUTING.md, docs/product.md, docs/website/BRIEF.md
Documentation now lists broader native renderer support, describes shared RenderScene reuse, removes shipped SVG work from open priorities, and updates syntax and OS-floor roadmap wording.

Windows bridge status

Layer / File(s) Summary
Verified P/Invoke bridge and remaining ABI work
docs/notes/windows.md, windows/README.md
Windows documentation identifies the MermaidKitCShared P/Invoke bindings and test coverage as shipped, while listing device-font measurement and later theming, control, and packaging work as pending.

Platform-specific usage guidance

Layer / File(s) Summary
Android theming and canvas zoom behavior
docs/notes/android.md, tools/pi-canvas/README.md
The Android Compose example passes MaterialTheme.colorScheme, and InfiniteCanvas documentation distinguishes Apple re-rasterization from Linux/Silica repositioning behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • #56 — Covers the Windows documentation and pi-canvas behavior corrections included here.
  • #51 — Tracks the broader documentation audit covering platform capabilities, Windows P/Invoke, Android theming, and rendering behavior.

Poem

A bunny hops through docs so bright,
SVG blooms in morning light.
Windows bridges now stand tall,
Android themes color all.
Canvas zooms with careful care—
Fresh facts dance everywhere!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #52 isn't fully met: the docs updates cover platforms/P/Invoke/Android/pi-canvas, but the shipped SVG API/documentation change isn't shown. Add the SVG API/output-format documentation (and shipped-feature wording) or clarify the missing SVG doc update in this batch.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main docs-focused change: correcting shipped-platform, SVG, and P/Invoke claims in batch 1.
Out of Scope Changes check ✅ Passed The edits stay within documentation-accuracy fixes; the version and DLL-name tweaks are related audit updates, not unrelated scope creep.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/audit-batch1-capabilities

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/website/BRIEF.md`:
- Around line 113-116: Update the platform/toolchain statement in BRIEF.md to
use the project-wide minimums of Swift 6.2 and Xcode 26 instead of Swift 6 and
Xcode 16, preserving the surrounding platform and OS-floor wording.

In `@tools/pi-canvas/README.md`:
- Around line 15-20: Update the InfiniteCanvas description so it states that
each diagram is rendered once per zoom level and cached, while preserving the
existing explanation of Apple/CoreGraphics re-rasterization and Linux/Silica
behavior.

In `@windows/README.md`:
- Around line 50-54: Add the unfinished per-architecture NuGet packaging of
MermaidKitCShared.dll to the “Not yet here (next slices)” list in
windows/README.md, matching the corresponding item in docs/notes/windows.md.
Keep the existing device-font measure callback item unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c909c818-c6f9-4b76-b9c7-0c3175359545

📥 Commits

Reviewing files that changed from the base of the PR and between 85fdc08 and ce273fd.

📒 Files selected for processing (7)
  • CONTRIBUTING.md
  • docs/notes/android.md
  • docs/notes/windows.md
  • docs/product.md
  • docs/website/BRIEF.md
  • tools/pi-canvas/README.md
  • windows/README.md
💤 Files with no reviewable changes (1)
  • CONTRIBUTING.md

Comment thread docs/website/BRIEF.md
Comment on lines +113 to +116
- Platforms: renders natively on Apple (macOS 14+, iOS 17+, visionOS 1+),
Linux, Android, Windows/.NET, WebAssembly, and Flutter, from one Swift
layout core (Swift 6 language mode, Xcode 16+ to build). Lower Apple OS
floors are the top of the public roadmap.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== docs/product.md (relevant lines) ==\n'
sed -n '1,80p' docs/product.md | cat -n

printf '\n== docs/website/BRIEF.md (relevant lines) ==\n'
sed -n '100,130p' docs/website/BRIEF.md | cat -n

printf '\n== Search for Xcode/toolchain floors across docs ==\n'
rg -n "Xcode 1[0-9]\+|Xcode 2[0-9]\+|swift-tools-version|swift tools version|tools version" docs -S

Repository: 2389-research/MermaidKit

Length of output: 11341


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Search for Xcode 16+ / 26 mentions outside the two docs ==\n'
rg -n "Xcode 16\+|Xcode 26|swift-tools-version: 6\.2|Swift 6\.2" -S .

printf '\n== Nearby context in README.md if present ==\n'
if [ -f README.md ]; then
  rg -n "Xcode 16\+|Xcode 26|swift-tools-version: 6\.2|Swift 6\.2" README.md -n -S
fi

Repository: 2389-research/MermaidKit

Length of output: 2692


Keep the toolchain floor aligned with the rest of the docs. docs/website/BRIEF.md still says Xcode 16+ / Swift 6, but docs/product.md, README.md, CONTRIBUTING.md, and the changelog all state the current floor is Swift 6.2 / Xcode 26. Update this line to match the project-wide requirement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/website/BRIEF.md` around lines 113 - 116, Update the platform/toolchain
statement in BRIEF.md to use the project-wide minimums of Swift 6.2 and Xcode 26
instead of Swift 6 and Xcode 16, preserving the surrounding platform and
OS-floor wording.

Comment thread tools/pi-canvas/README.md
Comment on lines 15 to +20
- **`InfiniteCanvas`** — diagrams placed at positions in an unbounded virtual
space. Each is rendered once to an RGBA raster (cached; zoom re-rasterizes for
crispness rather than scaling a bitmap). Each frame culls to the viewport and
blits only the visible cards.
space. Each is rendered once to an RGBA raster (cached). On the Apple/CoreGraphics
path, zooming re-rasterizes for crispness rather than scaling a bitmap; on the
Linux/Silica path `silicaRaster` returns the natural render size and ignores the
zoom-scaled width, so zoomed cards are repositioned but not re-rasterized larger.
Each frame culls to the viewport and blits only the visible cards.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clarify that caching is per zoom level.

“Each is rendered once” contradicts the documented Apple behavior, where zooming re-rasterizes and InfiniteCanvas.swift caches rasters by diagram index and zoom. Say that each diagram is rendered once per zoom level and cached.

Suggested wording
-- **`InfiniteCanvas`** — diagrams placed at positions in an unbounded virtual
-  space. Each is rendered once to an RGBA raster (cached). On the Apple/CoreGraphics
+- **`InfiniteCanvas`** — diagrams placed at positions in an unbounded virtual
+  space. Each is rendered once per zoom level to an RGBA raster (cached). On the Apple/CoreGraphics
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **`InfiniteCanvas`** — diagrams placed at positions in an unbounded virtual
space. Each is rendered once to an RGBA raster (cached; zoom re-rasterizes for
crispness rather than scaling a bitmap). Each frame culls to the viewport and
blits only the visible cards.
space. Each is rendered once to an RGBA raster (cached). On the Apple/CoreGraphics
path, zooming re-rasterizes for crispness rather than scaling a bitmap; on the
Linux/Silica path `silicaRaster` returns the natural render size and ignores the
zoom-scaled width, so zoomed cards are repositioned but not re-rasterized larger.
Each frame culls to the viewport and blits only the visible cards.
- **`InfiniteCanvas`** — diagrams placed at positions in an unbounded virtual
space. Each is rendered once per zoom level to an RGBA raster (cached). On the Apple/CoreGraphics
path, zooming re-rasterizes for crispness rather than scaling a bitmap; on the
Linux/Silica path `silicaRaster` returns the natural render size and ignores the
zoom-scaled width, so zoomed cards are repositioned but not re-rasterized larger.
Each frame culls to the viewport and blits only the visible cards.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/pi-canvas/README.md` around lines 15 - 20, Update the InfiniteCanvas
description so it states that each diagram is rendered once per zoom level and
cached, while preserving the existing explanation of Apple/CoreGraphics
re-rasterization and Linux/Silica behavior.

Comment thread windows/README.md
Comment on lines 50 to +54
## Not yet here (next slices)

- **The P/Invoke bridge** — this library renders a `SceneWire` you hand it; wiring
`MermaidNative` → `[DllImport]` → `mmk_scene_json` in a Swift-built Windows DLL
(so the app passes a Mermaid *source string* + a measure callback) is the next
step, mirroring Android's JNI seam.
- **Device-font measure callback** — the first P/Invoke slice passes none, so native
layout uses a coarse glyph-box metric; threading a measure callback through the ABI
lets layout measure with the face that draws.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the remaining-work list consistent with docs/notes/windows.md.

The Windows notes also identify bundling MermaidKitCShared.dll in a per-architecture NuGet package as unfinished. Add that item here, or explicitly state that this list is non-exhaustive, so readers do not mistake the documented next slices for the complete roadmap.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@windows/README.md` around lines 50 - 54, Add the unfinished per-architecture
NuGet packaging of MermaidKitCShared.dll to the “Not yet here (next slices)”
list in windows/README.md, matching the corresponding item in
docs/notes/windows.md. Keep the existing device-font measure callback item
unchanged.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce273fd1e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/website/BRIEF.md
top of the public roadmap.
- Platforms: renders natively on Apple (macOS 14+, iOS 17+, visionOS 1+),
Linux, Android, Windows/.NET, WebAssembly, and Flutter, from one Swift
layout core (Swift 6 language mode, Xcode 16+ to build). Lower Apple OS

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the brief to the current build floor

The refreshed platform paragraph now describes the current multi-platform v2.x state, but it still says Xcode 16+ is sufficient. The package manifest requires SwiftPM 6.2, and the updated contributing guide says the floor is Swift 6.2 / Xcode 26, so site copy generated from this brief would tell developers on Xcode 16 to use a toolchain that cannot parse/build the package. Update this floor alongside the new platform claims.

Useful? React with 👍 / 👎.

@clintecker
clintecker merged commit c61d685 into main Jul 21, 2026
15 checks passed
@clintecker
clintecker deleted the docs/audit-batch1-capabilities branch July 21, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs audit · Batch 1: correct high-visibility claims about shipped platforms, SVG, and P/Invoke

1 participant