Repository navigation
feat: edge captions written once per trunk - #104
Merged
Merged
Conversation
Edges that leave one port together run along one line until they part, and so do edges that reach one port. Each edge wrote its carried label at its own midpoint, and the midpoints of a bundle fall on the shared line: a node with twenty edges of one type stacked twenty copies of one word. `clientBehavior.edgeCaptions: 'once'` writes the label on the first edge, in model order, of each such bundle: an edge leaves its caption out when an earlier edge that leaves the same port, or reaches the same port, already writes the same text (edge-caption-sharing.ts). Edges of other captions keep theirs, and so does an edge alone on its ports. The decision is made once per model root and kept for its edges. An edge whose caption is not written, shared or because captions are off, now says what it carries in its hover tooltip, as the flag's documentation already promised. The label-or-width rule moves to `carriedTextOf`, used by the edge view and the sharing decision alike. `true` and `false` are unchanged. Claude-Session: https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8
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
Edges that leave one port together run along one line until they split, and so do edges that reach one port. Each edge wrote its carried label at its own midpoint, and the midpoints of such a bundle all fall on the shared line. On an NDF ASL unit with 23 dependencies, that stacked 23 copies of
depends-onon one trunk.clientBehavior.edgeCaptions: 'once'writes the label once per bundle. An edge leaves its caption out when an earlier edge (in model order) that leaves the same port, or reaches the same port, already writes the same text. Edges with other captions keep theirs, and so does an edge alone on its ports. The decision is made once per model root and reused for every edge (edge-caption-sharing.ts).An edge whose caption is not written, whether shared or because captions are off, now says what it carries in its hover tooltip, as the flag's documentation already promised. The label-or-width rule moves to
carriedTextOf, which the edge view and the sharing decision both use.true(the default) andfalsebehave as before;'once'is opt-in.Tests
diagram-client/test/edge-caption-sharing.test.tscovers:Checked visually with
scripts/render-svg, through ndf-ide, on pto-spec'sexpansion.asl(18 incoming and 5 outgoingdepends-onedges, now one caption on each trunk, withdefined-inkept) andexpdif.asl.https://claude.ai/code/session_01E8WfqKknDNN6xpNVcJL5K8