Skip to content

feat(emit): show for-ancestry and description on sequence lifelines#14

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

feat(emit): show for-ancestry and description on sequence lifelines#14
JonathanTurnock merged 1 commit into
mainfrom
feat/sequence-lifeline-ancestry-desc

Conversation

@JonathanTurnock
Copy link
Copy Markdown
Collaborator

What

Sequence-diagram lifeline head cards previously showed only kind + name. A container/component lifeline gave no clue where it belongs, and dropped the node's /// description that C4 cards show.

Now each lifeline head shows:

  • Dimmed for-ancestry (enclosing node names, outermost first) beneath the name — for container/component only.
  • The /// summary, wrapped (≤2 lines + ellipsis) and dimmed, like a C4 card — for every declared lifeline.

Synthesised initiators (client/scheduler/event/caller) carry neither.

Applied to both renderers — the static SVG emitter and the web-IDE svelte-flow canvas — via the one shared layout engine, so they stay byte-aligned. Card height is computed dynamically so the taller head clears the lifelines/messages.

How

The FQN is module-flat (batch::SagaSweeper, not …::Batch::SagaSweeper), so the ancestry is walked from the graph's for parent chain in the projection, then threaded through the layout IR to both render edges.

Layer Change
emit/scene.rs,project.rs Lifeline gains summary+parent_path; ancestry_path walks the for chain (cycle-guarded)
layout/text.rs wrap_desc — 2-line wrap + ellipsis, mirroring the C4 card
layout/sequence/* IR fields + dynamic uniform card height (head geometry module shared with the renderer)
emit/render.rs draws the dimmed parent path + summary under the name
wasm/lib.rs outline exposes summary so the IDE's depth-collapse resolves the collapsed node
web-ide threads summary + recomputes ancestry on collapse; SequenceLifeline.svelte renders the two dimmed lines
LANG.md §9.2 normative clause for the head-card content

Verification

  • SVG, real sample (batch::SagaSweeper::sweep): components show kind / name / dimmed AcmePay::Batch / 2-line summary; scheduler initiator carries neither.
  • Rust: 211 passed / 0 failed; cargo clippy --all-targets clean; cargo fmt applied.
  • Web: 76 vitest pass (incl. new sequence.test.ts for collapse ancestry/summary); svelte-check 0 errors.
  • WASM rebuilt (npm run build:wasm); regenerated pds-wasm_bg.wasm included.

🤖 Generated with Claude Code

Lifeline head cards previously showed only kind + name, so a container or
component lifeline gave no clue where it belongs, and dropped the node's
`///` description that C4 cards display.

Each container/component lifeline now shows its `for` ancestry (enclosing
node names, outermost first) dimmed beneath the name, and every declared
lifeline shows its `///` summary, wrapped like a C4 card. The ancestry is
walked from the graph `for` chain in the projection (the FQN is module-flat
and does not encode C4 nesting), threaded through the shared layout engine,
and drawn by both the SVG emitter and the web-IDE svelte-flow renderer. Card
height is now computed dynamically so the taller head clears the lifelines.

Applies to both renderers via one layout source; collapse in the web IDE
recomputes the ancestry/summary for the collapsed node.

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: 5b8dc6c
Status: ✅  Deploy successful!
Preview URL: https://87ca7638.pseudoscript-landing.pages.dev
Branch Preview URL: https://feat-sequence-lifeline-ances.pseudoscript-landing.pages.dev

View logs

@JonathanTurnock JonathanTurnock merged commit 44ca039 into main Jun 2, 2026
4 of 5 checks passed
@JonathanTurnock JonathanTurnock deleted the feat/sequence-lifeline-ancestry-desc branch June 2, 2026 23:58
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