Measure the vertical-tabs row title/indicator gap in an integration test - #14931
Measure the vertical-tabs row title/indicator gap in an integration test#14931bobrnor wants to merge 1 commit into
Conversation
`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
|
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 See the contribution guidelines for the full readiness model. Powered by Oz |
There was a problem hiding this comment.
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
|
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. 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. |
render_row_title_linepins 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 itslayout_linereturns 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.
ready-to-implement. — No test guards a vertical-tabs row title against overlapping its trailing indicators #14959 was filed alongside this PR and has not been triaged yet. It reports a missing regression guard rather than a user-visible defect; if that is not something the project wants tracked as an issue, say so and I will close both.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:
vertical_tabs:pane_row:…),Iconinside that rect as the trailing indicator,Glyphs the clip fade has already driven to zero alpha are skipped —
Line::paintbuilds an end-direction fade asstart = right edge − fade_width,end = right edge, and the glyph shader ramps alpha 1 → 0 across that span, so anything at or pastendis not painted.What it measures today
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
Tabsgranularity plus theSummarytab-item mode, andresolve_vertical_tabs_modesilently falls back toFocusedSessionunlessFeatureFlag::VerticalTabsSummaryModeis on too. The helper sets all three.Testing
cargo run -p integration --bin integration -- test_vertical_tab_title_does_not_overlap_trailing_indicator— passes, both with and withoutWARPUI_USE_REAL_DISPLAY_IN_INTEGRATION_TESTS=1, which is why it is listed inui_tests.rsun-ignored.cargo nextest run --no-fail-fast -p integration test_vertical_tab_title_does_not_overlap_trailing_indicator—1 passed.Failure path verified deliberately: temporarily demanding 10px of clearance where only 3.38 exists produced