Skip to content

Keep the space between a wrapped diagram label's lines in its part's name - #6059

Merged
max-sixty merged 2 commits into
mainfrom
diagram-wrapped-labels
Nov 15, 2026
Merged

max-sixty merged 2 commits into
mainfrom
diagram-wrapped-labels

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

A diagram drawn narrow wraps a box's label across lines, with each line in a tspan of its own. lf-diagram named each part from the box's textContent, which runs the lines together, so on a phone-width column "Start request" became the Respond control "Respond to Startrequest" and the Comment target "Startrequest". The label now reads the box's text line by line (wordsOf), with a space where a line wraps. It also stops taking in a node's tooltip <title>, which textContent included.

This is behind one of #6048's macOS nightly failures. test_a_visual_action_follows_its_own_scroller_even_when_the_target_is_gone narrows the diagram and pressed the Respond control on whichever drawing stood at that moment. In 18 concurrent copies on this Mac's efficiency cores at main, 2 timed out because the narrow drawing had already renamed the control, and 5 reported the ResizeObserver loop the nightly run saw, when the test widened the diagram again. The test now waits for the narrow drawing and checks that it wrapped the label: 18 of 18 copies pass, and 11 of 11 under --cpu-throttle 10. Without the label fix it times out at the press.

Not fixed here: the loop itself is a product race this PR leaves alone. When a part of the open comment box changes size in the same frame as the box's anchor moves, box-motion's ResizeObserver (placedParts) re-solves the placement inside its delivery, the new room changes the box's width (--lf-float-w), and the box's own observers miss that change until the next frame. A probe that grows a control in the box and widens the diagram in one task raises the loop 3 of 3 times, and 0 of 3 with the two a frame apart. The test no longer makes the two coincide, since it now presses on a settled drawing; the fix belongs in how the comment box's placement lands, which is a separate change.

The diagram and visual-part tests in test_render_reactions.py, test_render_gate.py (both tiers) and journeys/test_render_aim.py pass (18).

max-sixty asked for fixes to the macOS-only test failures; they haven't read this yet.

Refs #6048

This was written by Claude Code on behalf of max-sixty

…name

A diagram drawn narrow wraps a box's label across lines, and Pele sets each line in
a `tspan` of its own. The part's label was the box's `textContent`, which runs the
lines together, so "Start request" named its Respond control "Respond to
Startrequest" and its Comment target "Startrequest". The label now reads each
`text` line by line (`wordsOf`), with a space where a line wraps, and leaves out a
`title` tooltip that `textContent` also took in.

`test_a_visual_action_follows_its_own_scroller_even_when_the_target_is_gone`
narrows the diagram and pressed the Respond control at once, on whichever drawing
stood then. On this Mac's efficiency cores, in 18 concurrent copies at main, 2 timed
out because the narrow drawing had already renamed the control, and 5 reported the
ResizeObserver loop that failed the macOS nightly run in #6048, when the test widened
the diagram again. In those frames the comment box's placement, re-solved inside the
box-motion observer's delivery (box-motion.js, `placedParts`), changed the box's
width, which the box's other observers then missed. The test now waits for the
narrow drawing and checks that it wrapped the label. Without the label fix it times
out at the press; with it, 18 of 18 copies pass, and 11 of 11 under
`--cpu-throttle 10`, with no loop reported.

Refs #6048
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.

2 participants