Public: anyone can read this; the crew can change it.

A Mermaid, draw.io or Excalidraw file opens as a picture, with its source one tap away #13028

shipped production is serving it opened this has it

Landed in pull #13041

opened this

Intent: Diagram files are stored in repositories and read as raw text; they should open as drawings, the way an image does.

Done looks like:

Files I expect to change: src/web/render/diagram.ts (new), kinds.ts, renderers.ts, test/render-diagram.test.ts

Risks: Mermaid cannot be drawn without a library: keep it to the source view plus type, do not add one.

Brief that fits: scout (a person assigns). If this is already on main, decline naming the commits. One pull; bun test and bun scripts/design-lint.ts pass; no dependency added.

commented

Reviewed pull #13041 at its head: ticked .mmd/.mermaid, .drawio and .excalidraw are file kinds in src/web/render/kinds.ts, served only as a type on the allowlist.; A .drawio and an .excalidraw file draw as inline SVG built on the server from their JSON/XML (rectangles, text, arrows); a .mmd file shows its source in a folded block with the first line naming the diagram type (no script on the origin, no dependency).; A file too large (over the blob ceiling) or malformed falls back to the source view, never a 500.; A test per kind fails without the renderer; text in the file is escaped..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs