Repository navigation
feat(sequence): derive and draw activation bars - #376
Merged
Merged
Conversation
Collaborator
Author
This was referenced Oct 10, 2026
anandpant
force-pushed
the
feat/sequence-activations
branch
from
October 10, 2026 22:11
be34ec4 to
664fc62
Compare
anandpant
force-pushed
the
feat/sequence-one-contract
branch
from
October 10, 2026 22:11
3bdf75b to
518ebb0
Compare
anandpant
marked this pull request as ready for review
October 10, 2026 22:12
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This was referenced Oct 10, 2026
Merged
anandpant
force-pushed
the
feat/sequence-activations
branch
from
October 11, 2026 00:37
664fc62 to
67439dc
Compare
Merge activity
|
## What changed - `sequenceActivations` (diagram-core) derives activation spans from message order. A `return` answers the latest open call between the two participants, a call to a participant that is already active nests at the next depth, and calls nobody answers (fire-and-forget) open no span. The model authors nothing new; the spans are deterministic from the existing contract. - The sequence renderer draws each span as a `sequence-activation` bar on the callee's lifeline, offset half a bar per nesting level. Calls, returns, and messages sent while a participant is active attach to the edge of its innermost bar; otherwise they stay on the lifeline. Bar ids live under `<participant>:lifeline:activation:<call id>`, and core validation now reserves every id under a participant's lifeline. - `CanvasRendererRole` covers lifelines and activation bars together. Neither carries labels or icons, and Excalidraw validation lets messages cross either. Excalidraw export tags bars with `customData.sketchiRendererRole`. - Code Mode keeps the activation role through patches only while the bar still sits on its lifeline (`isStructurallyValidSequenceActivation`). The MCP canvas contract and the generated docs types list the new role, and the `buildSequenceDiagram` docs and generation prompt explain that returns close calls. ## Why #280 requires that sequence semantics, including activation and lifelines, are kept rather than flattened. Before this, nothing modeled activations and every message attached to a bare lifeline. ## Verification - `pnpm nx affected -t typecheck,test --base=origin/main` (18 projects) - New tests: span derivation (answered, nested, fire-and-forget, stray return), bar geometry and attachment, a valid Excalidraw export with messages crossing other participants' bars, Code Mode patch round-trip - MCP generated types refreshed. Storybook `Diagram Types/Sequence` checked in Chrome. Screenshot: bars on API Worker, Cache, and Database, with no bar for the fire-and-forget analytics call. Refs #280 ## Review follow-ups - Bars nested two or more levels deep keep `sequence-activation` through Code Mode patches. The structural check accepts whole nesting steps, up to the number of bars on that lifeline, and still rejects a bar moved off it. Tests cover a depth-2 renderer case and a Code Mode patch round-trip. - Answering one call no longer closes other open calls on the same lifeline. Depth counts the spans still open when a span starts, so partially overlapping spans stack instead of overlapping. A test covers `a→b q1, c→b q2, b→a p1, b→c p2`. - **Behavior change:** a participant id that starts with another participant id followed by `:lifeline` (for example `api:lifeline:v2` next to `api`) is now rejected, because bars live under that prefix. The hint reads "...does not start with another participant id followed by :lifeline." This is noted in the changeset. - **Free lanes:** each span takes the lowest depth no still-open span on its lifeline holds, above every span enclosing it. Partially overlapping spans (q1 0..2, q2 1..4, q3 3..5) no longer draw on top of each other. A message attaches to the bar of the span it opens or closes. Tests: the q1/q2/q3 case, its rendering, and a property check over 500 seeded random diagrams.
graphite-app
Bot
force-pushed
the
feat/sequence-one-contract
branch
from
October 11, 2026 01:48
97f5817 to
4d3079f
Compare
graphite-app
Bot
force-pushed
the
feat/sequence-activations
branch
from
October 11, 2026 01:49
de73f7e to
49c0292
Compare
Contributor
Sketchi Excalidraw Workspace PreviewStatus:
|
Contributor
Sketchi Eval Harness PreviewStatus:
|
Contributor
Sketchi Web PreviewStatus:
|
Contributor
Sketchi Icons PreviewStatus:
|
Merged
Contributor
Sketchi Playground / Studio PreviewStatus:
|
This branch was successfully deployed
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.

What changed
sequenceActivations(diagram-core) derives activation spans from message order. Areturnanswers the latest open call between the two participants, a call to a participant that is already active nests at the next depth, and calls nobody answers (fire-and-forget) open no span. The model authors nothing new; the spans are deterministic from the existing contract.sequence-activationbar on the callee's lifeline, offset half a bar per nesting level. Calls, returns, and messages sent while a participant is active attach to the edge of its innermost bar; otherwise they stay on the lifeline. Bar ids live under<participant>:lifeline:activation:<call id>, and core validation now reserves every id under a participant's lifeline.CanvasRendererRolecovers lifelines and activation bars together. Neither carries labels or icons, and Excalidraw validation lets messages cross either. Excalidraw export tags bars withcustomData.sketchiRendererRole.isStructurallyValidSequenceActivation). The MCP canvas contract and the generated docs types list the new role, and thebuildSequenceDiagramdocs and generation prompt explain that returns close calls.Why
#280 requires that sequence semantics, including activation and lifelines, are kept rather than flattened. Before this, nothing modeled activations and every message attached to a bare lifeline.
Verification
pnpm nx affected -t typecheck,test --base=origin/main(18 projects)Diagram Types/Sequencechecked in Chrome. Screenshot: bars on API Worker, Cache, and Database, with no bar for the fire-and-forget analytics call.Refs #280
Review follow-ups
sequence-activationthrough Code Mode patches. The structural check accepts whole nesting steps, up to the number of bars on that lifeline, and still rejects a bar moved off it. Tests cover a depth-2 renderer case and a Code Mode patch round-trip.a→b q1, c→b q2, b→a p1, b→c p2.:lifeline(for exampleapi:lifeline:v2next toapi) is now rejected, because bars live under that prefix. The hint reads "...does not start with another participant id followed by :lifeline." This is noted in the changeset.