Skip to content

feat(scrybe-app): unify or offline-proof preview rendering — CDN mermaid@11/KaTeX vs the adopted native renderer #235

Description

@hartsock

Problem

The renderer adoption (#132/#37) created a two-renderer reality that was never filed:

  • Preview (scrybe-app): Mermaid rendered by browser mermaid@11 loaded from the jsdelivr CDN (scrybe-app/index.html, preview.ts — "@ts-ignore — Mermaid loaded via CDN"), KaTeX also from CDN.
  • Export / PNG / MCP: the adopted pure-Rust mermaid-rs-renderer 0.3.1 via scrybe-mermaid-render.

Consequences:

  1. The desktop app's diagram + math preview silently fails offline. A local-first Markdown editor whose preview needs a CDN contradicts the project's own philosophy (user's data sovereign, no lock-in — and no network dependency for core rendering).
  2. Preview can visually diverge from exported artifacts — two different renderers with different layout engines are in play, so what you see is not what you export.

Scope

Decide and implement one of:

  • (a) Unify on the native renderer: preview Mermaid via scrybe-mermaid-render SVG (server-side in the Tauri backend, swapped into the preview like a fenced-block render). KaTeX similarly vendored or replaced.
  • (b) Offline-proof the CDN path: vendor mermaid@11 + KaTeX into the app bundle (no network fetch), accepting the divergence but documenting it.

Option (a) is the philosophically consistent end-state; (b) is the smaller stopgap. Either way, the preview must render diagrams and math with the network cable pulled.

Acceptance

  • Fresh app launch with networking disabled: fenced ```mermaid blocks and KaTeX math render in preview.
  • If (a): preview SVG and export/mermaid_to_png output come from the same renderer (spot-check a fixture for visual identity).

Filed from the 2026-07-29 backlog scrub (post-adoption audit); relates to #28 (embedded-source PNG inline render) which touches the same preview pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions