Skip to content

fix(ui): align call flow arrows with host lifelines - #1144

Merged
adubovikov merged 4 commits into
sipcapture:homer11from
MrM0bi:fix/callflow-arrow-alignment
Nov 20, 2026
Merged

adubovikov merged 4 commits into
sipcapture:homer11from
MrM0bi:fix/callflow-arrow-alignment

Conversation

@MrM0bi

@MrM0bi MrM0bi commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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.

Before After

|
Screenshot_Before
|
Screenshot_After
|

Cause

  • The lifelines are drawn at the measured centre of each host card. Each card is as wide as its label, so the centres are spaced unevenly.
  • The arrows were laid out with flex ratios by host index (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.
  • Each row's 6px horizontal padding pushed every arrow inward.
  • The arrowhead kept an invisible 5px right border, so its tip stopped about 4px short of the end of the line.

Fix

  • Arrows are now placed from the same measured host centres as the lifelines. The new flowSegmentPx() in flow-data.ts turns a message into a pixel offset and width, and CallFlow passes the centres down to FlowItem in place of the --flow-left-px / --flow-right-px CSS variables.
  • Rows no longer have horizontal padding, and the arrowhead has no trailing border.
  • Removed the unused rightEnd field and the single-host styles.

Testing

  • New tests: flowSegmentPx with unevenly spaced centres, covering a host messaging itself, the last host and a single host; and FlowItem applying the measured pixels.
  • vitest, tsc --noEmit and eslint on the changed files pass.
  • Checked by eye against mock data and a live install built from this branch (screenshots above).

Note

🤖 Created on behalf of Benjamin with Claude Opus 5.5

MrM0bi and others added 2 commits November 16, 2026 15:16
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 adubovikov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@MrM0bi MrM0bi Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

|
issue1-before
|
issue1-after
|

.item-flow-packet-container .bg-color-tab {
position: absolute;
left: calc(-1 * var(--flow-left-px, 12px));
left: 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.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.

@MrM0bi MrM0bi Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

|
issue2-a-homer11-original
|
issue2-b-this-pr-full-width
|
issue2-c-tint-tab-restored
|

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>
@adubovikov

Copy link
Copy Markdown
Member

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>
@MrM0bi

MrM0bi commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

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 puts the tint, tab, row border and hover on the loop again, using --loop-left / --loop-width from the measured host centre. It also adds 6px side padding on single-host rows only, so the tab doesn't cover the text and the arrowhead, as before.

Single-host rendering is now pixel-identical to homer11, and the multi-host and last-host loop cases are unchanged from the previous push.

@adubovikov

Copy link
Copy Markdown
Member

Thank you! Merged!

@adubovikov
adubovikov merged commit e4d2c51 into sipcapture:homer11 Nov 20, 2026
4 checks passed
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