Skip to content

feat: shared C4 layout engine for the canvas + sequence lifeline context#15

Merged
JonathanTurnock merged 1 commit into
mainfrom
feat/sequence-lifeline-ancestry-desc
Jun 3, 2026
Merged

feat: shared C4 layout engine for the canvas + sequence lifeline context#15
JonathanTurnock merged 1 commit into
mainfrom
feat/sequence-lifeline-ancestry-desc

Conversation

@JonathanTurnock
Copy link
Copy Markdown
Collaborator

Two diagram improvements on this branch. Both land as feat commits, so release-plz will open a minor-version release PR on merge to main.

Shared C4 layout engine for the interactive canvas (this session)

The web IDE's C4 canvas now shares the pseudoscript-emit layout engine with the static SVG (the same layout-rs Sugiyama pass), replacing the weaker JS Dagre layout. Cards are content-sized, edges follow the engine's routed polylines, and container/component views frame their boundary — matching the SVG. Mirrors how the sequence diagram already shares the layout crate.

  • emit: new layout_c4_scene → positioned C4Layout (placed cards, routed edge polylines, boundary frame); frame_and_extent extracted so the SVG path stays byte-identical.
  • wasm: layout_scene positions C4 scenes too (was sequence-only); renamed C4Scene.view → serde c4view, fixing a latent duplicate-view collision with the #[serde(tag = "view")] enum on the C4 round-trip.
  • web-ide: C4Flow is now a dumb renderer of C4Layout (per-node sizing, routed PolylineEdges, boundary frame), all interactivity preserved (pan/zoom/minimap, context menu, drill). Dropped grid/circular/radial algorithms, CanvasSettings, FloatingEdge, the canvas-prefs store, and @dagrejs/dagre.

Sequence lifeline ancestry + description (5b8dc6c)

Sequence lifeline head cards now show the for-ancestry path and the node's /// description, like a C4 card.

Verification

cargo test (workspace), cargo clippy, cargo fmt clean · svelte-check 0 errors · 76 vitest pass · WASM regenerated · context + container views verified live in the IDE (routed edges, content-sized cards, boundary frame, drill, boundary close-button).

🤖 Generated with Claude Code

The interactive C4 diagram now shares the `pseudoscript-emit` layout engine
with the static SVG (the same layout-rs Sugiyama pass), replacing the weaker
JS Dagre layout. Cards are content-sized, edges follow the engine's routed
polylines, and container/component views frame their boundary — matching the
SVG. Mirrors how the sequence diagram already shares the layout crate.

- emit: add `layout_c4_scene` returning a positioned `C4Layout` (placed cards,
  routed edge polylines, boundary frame); extract `frame_and_extent` so the SVG
  path stays byte-identical.
- wasm: `layout_scene` now positions C4 scenes too (was sequence-only); rename
  `C4Scene.view` to serde `c4view`, fixing a latent duplicate-`view` collision
  with the `#[serde(tag = "view")]` enum on the C4 round-trip.
- web-ide: `C4Flow` becomes a dumb renderer of `C4Layout` (per-node sizing,
  routed `PolylineEdge`s, boundary frame), all interactivity preserved; drop the
  grid/circular/radial algorithms, `CanvasSettings`, `FloatingEdge`, the
  `canvas-prefs` store, and the `@dagrejs/dagre` dependency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying pseudoscript-landing with  Cloudflare Pages  Cloudflare Pages

Latest commit: aebceea
Status: ✅  Deploy successful!
Preview URL: https://564ddb4d.pseudoscript-landing.pages.dev
Branch Preview URL: https://feat-sequence-lifeline-ances.pseudoscript-landing.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying pseudoscript-ide with  Cloudflare Pages  Cloudflare Pages

Latest commit: aebceea
Status: ✅  Deploy successful!
Preview URL: https://20b4d73d.pseudoscript-ide.pages.dev
Branch Preview URL: https://feat-sequence-lifeline-ances.pseudoscript-ide.pages.dev

View logs

@JonathanTurnock JonathanTurnock merged commit f7561da into main Jun 3, 2026
4 of 5 checks passed
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.

1 participant