Navigation

Flowchart Publish

Flowchart opts into the Publishable capability, giving a diagram the same share unit as Dashboard, Webpage and Email: a public read-only render at /view/Flowchart/[id].

This is the minimal Publishable adoption and the reference template for future types: a capability flag plus one view component. The publish procedures, the Publish and Unpublish commands, snapshotting and OG meta all arrive from the existing capability machinery — no bespoke code.

How it works

Flowchart content references no other resources and no binary assets, so the publish snapshot is the plain content copy: it declares neither a transformPublishedContent hook nor any live content (publishing).

flowchart LR
  DEF["ResourceDefinitionMap<br/>publishable: true"] -->|derives| UNION["PublishableResourceType"]
  UNION -->|"requires an entry<br/>(compile error otherwise)"| VCM["ViewComponentMap[Flowchart]"]
  UNION -->|grants| PROCS["publish procedures<br/>on the flowchart router"]
  PROCS -->|"publishResource — plain content copy"| SNAP[("published version n")]
  VCM -->|readPublishedResourceContent| VIEW["/view/Flowchart/[id]<br/>read-only VueFlow render"]
  • View component — a VueFlow instance over the snapshot's nodes and edges with editing locked down: no dragging, no connecting, no selection. Pan and zoom stay on, since a large diagram is unreadable without them. Rendered under <ClientOnly> like the editor blade, because VueFlow reads the DOM at mount and cannot server-render.
  • The view reuses the editor's NodeTypeMap, so a published diagram renders every node type exactly as the editor does. A node component reads its own node through Vue Flow's useNode, never the editor store, which the published page does not load — so a picked colour and a resized size draw there too.

Key files

FileRole
apps/web/shared/services/resource/ResourceDefinitionMap.tspublishable: true on Flowchart
apps/web/app/components/Resource/Flowchart/View.vueread-only VueFlow renderer
apps/web/app/services/resource/ViewComponentMap.tsFlowchart entry

Notes

  • Blueprint, Program, Sheet and TodoList are the remaining non-publishable types, and stay that way on purpose: sharing data rows is the dataset and export path, a todo list is personal working state, and a blueprint or a program is authoring machinery rather than an artifact to hand someone. The type system guaranteeing the absence of publish endpoints there is a feature of the capability model, not a gap.
  • Image export of a diagram is its own decision, flowchart image export, since it brings a client-side rasterization dependency.

Details

Command palette

Keyboard shortcuts