feat: shared C4 layout engine for the canvas + sequence lifeline context#15
Merged
Merged
Conversation
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>
Deploying pseudoscript-landing with
|
| 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 |
Deploying pseudoscript-ide with
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two diagram improvements on this branch. Both land as
featcommits, so release-plz will open a minor-version release PR on merge tomain.Shared C4 layout engine for the interactive canvas (this session)
The web IDE's C4 canvas now shares the
pseudoscript-emitlayout 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.layout_c4_scene→ positionedC4Layout(placed cards, routed edge polylines, boundary frame);frame_and_extentextracted so the SVG path stays byte-identical.layout_scenepositions C4 scenes too (was sequence-only); renamedC4Scene.view→ serdec4view, fixing a latent duplicate-viewcollision with the#[serde(tag = "view")]enum on the C4 round-trip.C4Flowis now a dumb renderer ofC4Layout(per-node sizing, routedPolylineEdges, boundary frame), all interactivity preserved (pan/zoom/minimap, context menu, drill). Dropped grid/circular/radial algorithms,CanvasSettings,FloatingEdge, thecanvas-prefsstore, 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 fmtclean · 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