Repository navigation
fix(ui): align call flow arrows with host lifelines - #1144
Conversation
Lifelines were drawn at the measured centre of each host card, but arrows were laid out with flex ratios by host index, which assumes evenly spaced hosts. Host cards size to their label, so arrow ends drifted off the lifelines. Position arrows from the same measured host centres instead (flowSegmentPx), drop the row's horizontal padding, and remove the arrowhead's trailing border so its tip lands on the line end. The now-unused rightEnd field and single-host styles are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adubovikov
left a comment
There was a problem hiding this comment.
Thanks. Straight arrows now end on the lifelines, and the screenshots match the code: the grid and the arrows share the measured host centres, the row has no horizontal padding, and the arrowhead has no trailing border.
One case to fix before merge, and one to check. Notes are on the lines.
| let to = item.start + item.middle | ||
| if (item.isRadial) { | ||
| // Self-messages loop towards the next host, or the previous one for the last host. | ||
| from = item.isLastHost ? item.start - 1 : item.start |
There was a problem hiding this comment.
For the last host this segment is the whole gap back to the previous centre. The new test locks that in: left: 1314, width: 441.
The loop does not follow that width. .radial-arrow-end is width: 25px; margin-left: auto, so it stays on the last lifeline. The port badges do follow the segment: .radial-port-labels is width: 70% from its left edge, so they sit on the previous host (about 1314–1623) while the loop is at 1730–1755. The method text is fine — for isLastHost the segment is textAlign: right.
A self-message on any other host is fine: the loop and the labels are both 70% of one real gap, counted from the left.
width: auto will not pin the badges to the loop. A block with width: auto takes the free space, and margin-left: auto becomes 0. This does:
.radial-port-labels.end {
width: max-content;
margin-left: auto;
}Add the modifier when item.isLastHost.
There was a problem hiding this comment.
Fixed in 877a9df with your .radial-port-labels.end suggestion, plus gap: 4px so the two badges don't touch. The badges were already off the loop in homer11 (~1049/1345px vs the loop at ~1510px), so this also fixes an older bug.
| Before | After |
|---|
| .item-flow-packet-container .bg-color-tab { | ||
| position: absolute; | ||
| left: calc(-1 * var(--flow-left-px, 12px)); | ||
| left: 0; |
There was a problem hiding this comment.
.single-host used to keep this tab on the host centre, and the tint on the 280px loop only. The row was inset with --flow-left-px / --flow-right-px, and those rules set left / right back to 0 inside that inset.
The margins are gone, so left: 0 is the left edge of the whole row and inset: 0 paints the full width. With several hosts that is the same full-bleed as before. With one host the card is centered, and the tab ends up far from the loop.
The loop itself is unchanged: flowSegmentPx still starts at the measured centre and uses RADIAL_FALLBACK_PX (280). Please check a one-host call.
There was a problem hiding this comment.
Checked a one-host call. I'd keep the full-width rows: they now match multi-host calls, where the tab already sits at the row edge. Putting the tint and tab back on the loop inside full-width rows (c) gives a narrow tinted column between full-width separators. Going back to a narrow row (a) would make one-host calls look different from every other call. What do you prefer?
| a: homer11 | b: this PR | c: tint/tab on the loop |
|---|
On the last host the self-message segment spans the gap back to the previous host, but the loop is pinned to the segment's right edge. The port badges were 70% wide from the left edge, so they sat near the previous host. Add an `end` modifier that sizes them to their content and pushes them right, under the loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Let's stay with (a). On a multi-host call the full-width tint matches the arrow, which actually crosses the row. With one host the message is only the loop, and (b) puts the tab on the empty left edge, away from it. (c) brings the color back, but the full-width rules make that color look like a strip that doesn't fill the row. Keep the full-width container so the lifeline math stays as it is. For a single host, put the tint, the tab, the border and the hover back on the loop, the way .single-host used to. |
With one host the message is only the self-loop, but the full-width rows put the callid tab on the empty left edge and tinted the whole row. Restore the old .single-host look on top of the full-width container: tint, tab, row border and hover sit on the loop, using --loop-left / --loop-width from the measured host centre. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Done in 4e95444: one-host calls are back to (a). The container stays full width, so the lifeline positioning is unchanged. For a single host, Single-host rendering is now pixel-identical to |
|
Thank you! Merged! |





Call flow arrows now end exactly on the host lifelines. Before this, arrow ends could land several pixels to either side of the lifeline, and the line stuck out past the arrowhead.
|


|
|
Cause
start/middle/rightEnd), which assumes even spacing. In the screenshots the lifeline gaps are 439 / 406 / 402 / 426 px, while the arrows assume about 418 px each.Fix
flowSegmentPx()inflow-data.tsturns a message into a pixel offset and width, andCallFlowpasses the centres down toFlowItemin place of the--flow-left-px/--flow-right-pxCSS variables.rightEndfield and thesingle-hoststyles.Testing
flowSegmentPxwith unevenly spaced centres, covering a host messaging itself, the last host and a single host; andFlowItemapplying the measured pixels.vitest,tsc --noEmitand eslint on the changed files pass.Note
🤖 Created on behalf of Benjamin with Claude Opus 5.5