Skip to content

Measure the vertical-tabs row title/indicator gap in an integration test - #14931

Closed
bobrnor wants to merge 1 commit into
warpdotdev:masterfrom
bobrnor:vertical-tabs-indicator-geometry-test
Closed

Measure the vertical-tabs row title/indicator gap in an integration test#14931
bobrnor wants to merge 1 commit into
warpdotdev:masterfrom
bobrnor:vertical-tabs-indicator-geometry-test

Conversation

@bobrnor

@bobrnor bobrnor commented Aug 11, 2026

Copy link
Copy Markdown

render_row_title_line pins a vertical-tabs row's trailing indicators to the right edge of the title line and separates them from the title with a 4px margin. Nothing verified that the title actually stays out of the indicator's box — and the headless unit-test platform cannot verify it, because its layout_line returns an empty line, so text has no width there at all.

This adds an integration test that measures the real frame.

Linked Issue

Closes #14959.

How it measures

The test puts vertical tabs in summary mode, gives the row a label far wider than the row, and turns on synchronized inputs so the row grows its trailing link icon. Then it reads the built scene instead of a screenshot:

  1. takes the row rect from the position cache (vertical_tabs:pane_row:…),
  2. picks the rightmost Icon inside that rect as the trailing indicator,
  3. walks every glyph on the indicator's line, resolving each glyph's advance through the font cache to get its painted right edge.

Glyphs the clip fade has already driven to zero alpha are skipped — Line::paint builds an end-direction fade as start = right edge − fade_width, end = right edge, and the glyph shader ramps alpha 1 → 0 across that span, so anything at or past end is not painted.

What it measures today

quantity value
row x 9…241
rightmost label glyph edge 216.62
indicator left edge 220
clearance 3.38px

That is the intended margin, so the layout is correct as it stands and the test passes. It fails if any glyph reaches past the indicator's left edge, and the failure names the indicator box, the row, and the offending glyph coordinates, so it is diagnosable by someone who has never seen the test.

Notes

  • The label is ASCII: the harness's synthetic keystrokes mangle non-ASCII input (typing Cyrillic produced a stray leading character). The geometry under test does not depend on the script.
  • Summary mode is not a display granularity of its own — it is the Tabs granularity plus the Summary tab-item mode, and resolve_vertical_tabs_mode silently falls back to FocusedSession unless FeatureFlag::VerticalTabsSummaryMode is on too. The helper sets all three.
  • An explicit guard fails the assertion when no title glyphs are found, so it cannot pass vacuously on a row whose label never rendered.

Testing

  • cargo run -p integration --bin integration -- test_vertical_tab_title_does_not_overlap_trailing_indicator — passes, both with and without WARPUI_USE_REAL_DISPLAY_IN_INTEGRATION_TESTS=1, which is why it is listed in ui_tests.rs un-ignored.

  • cargo nextest run --no-fail-fast -p integration test_vertical_tab_title_does_not_overlap_trailing_indicator1 passed.

  • Failure path verified deliberately: temporarily demanding 10px of clearance where only 3.38 exists produced

    the vertical-tabs row title is painted into its trailing indicator. Indicator box
    RectF(<220, 86.4, 232, 98.4>), row RectF(<9, 68, 241, 135.2>), rightmost title edge 216.62,
    2 of 40 title glyphs on that line reach past the indicator's left edge:
    ["x=203.53..210.26 y=88.30", "x=210.26..216.62 y=88.30"]
    

`render_row_title_line` pins a row's trailing indicators to the right edge of
the title line and separates them from the title with a 4px margin. Nothing
checked that the title actually stays out of the indicator's box, and the
headless unit-test platform cannot check it: its `layout_line` returns an empty
line, so text has no width there.

This test drives the real thing. It puts vertical tabs in summary mode, gives
the row a label far wider than the row, turns on synchronized inputs so the row
grows its trailing link icon, then reads the built scene: it takes the row rect
from the position cache, picks the rightmost icon inside it as the trailing
indicator, and walks every title glyph on that line, resolving each glyph's
advance through the font cache to get its painted right edge. Glyphs the clip
fade has already driven to zero alpha are skipped, since they are not painted.

Measured clearance today is 3.38px between the label's rightmost glyph edge
(216.62) and the indicator's left edge (220) — the intended margin. The test
fails if any glyph reaches past that edge, and reports the indicator box, the
row, and the offending glyph coordinates so the failure is diagnosable without
reading the test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LF4ZTotC6MZwg1DAto3VRt
@cla-bot cla-bot Bot added the cla-signed label Aug 11, 2026
@oz-for-oss

oz-for-oss Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@bobrnor

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Aug 11, 2026

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bobrnor

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@bobrnor

bobrnor commented Aug 11, 2026

Copy link
Copy Markdown
Author

Withdrawing this one.

There is no defect behind it: the measured clearance (3.38px) is the intended margin and the layout is correct as it stands, so this is a standalone regression guard with no user-visible problem attached — not the right shape for a PR against the review queue here.

It is also measuring a layout that is about to move. render_row_title_line and render_icon_with_status are both used by the same vertical-tabs row in app/src/workspace/view/vertical_tabs.rs, and #14930 centers the brand circle in its reserved footprint, which narrows the leading gap from roughly 14px to the 8px ICON_WITH_STATUS_GAP asks for. That hands the title line about 6px more room, so the glyph extents this test records would go stale the moment that fix lands.

The measurement is worth keeping as a guard for exactly that change — a wider title running into the trailing indicator is the risk #14930 introduces — so I would rather fold it into that PR than carry it separately. Branch is kept.

Closing #14959 alongside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No test guards a vertical-tabs row title against overlapping its trailing indicators

1 participant