[test](trx-frontend-http): assert header geometry in the browser smoke test #33

Merged
sjg merged 1 commits from test/layout-regressions into main 2026-08-03 00:19:31 +02:00
Owner

First of the three follow-ups, taken one at a time.

Why

Several layout faults shipped while every gate passed, because nothing in the suite looked at geometry:

  • a header whose height tracked the viewport (112px at 1440, 169px at 1100, 246px at 720)
  • controls at four different heights in one row, and icon buttons stretched to 249px
  • a tab strip that ran under the controls, so Map sat beneath the audio button
  • a dropdown that opened underneath the spectrum, and before that as an 18px sliver

Each was found by you, not by CI. This asserts the invariants behind them, inside the existing test:browser run so CI picks it up with no workflow change.

What it checks

At 1440, 1280, 1100 and 900px: the header stays one row, the tabs do not reach the controls, the controls share a height, and the page does not scroll sideways. Then that the More menu renders with real dimensions and wins a hit test at its own centre — the check that would have caught the stacking-context bug, which reading z-index did not.

The overlap check measures the tabs, not the strip. With the strip allowed to overflow, its box shrinks while its content paints across the controls, so the container's own rect never registers the collision — my first version of this assertion measured the container and was useless.

What I could not demonstrate

I could not get these assertions to fail against the historical bugs. I tried reintroducing the wrapping and the missing overflow: hidden; both now pass, because the surrounding layout has changed enough that the old CSS no longer reproduces the old symptom at these widths.

So the assertions encode the invariants, but their sensitivity is unproven. Treat this as a floor, not a safety net — worth keeping because it is cheap and runs already, but it has not earned the claim that it would have caught what it was written for.

Not covered here

The /statistics download bug was a routing fault. I initially added a route check here, then removed it: this test drives a Node fixture server, so the check asserted the fixture's routing rather than the Rust server's. That belongs in a cargo test against the real handlers, and is not in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GdyUjuXejCEfiub675z6cz

First of the three follow-ups, taken one at a time. ## Why Several layout faults shipped while every gate passed, because nothing in the suite looked at geometry: - a header whose height tracked the viewport (112px at 1440, 169px at 1100, 246px at 720) - controls at four different heights in one row, and icon buttons stretched to 249px - a tab strip that ran under the controls, so Map sat beneath the audio button - a dropdown that opened underneath the spectrum, and before that as an 18px sliver Each was found by you, not by CI. This asserts the invariants behind them, inside the existing `test:browser` run so CI picks it up with no workflow change. ## What it checks At 1440, 1280, 1100 and 900px: the header stays one row, the tabs do not reach the controls, the controls share a height, and the page does not scroll sideways. Then that the More menu renders with real dimensions and **wins a hit test at its own centre** — the check that would have caught the stacking-context bug, which reading z-index did not. The overlap check measures the **tabs**, not the strip. With the strip allowed to overflow, its box shrinks while its content paints across the controls, so the container's own rect never registers the collision — my first version of this assertion measured the container and was useless. ## What I could not demonstrate **I could not get these assertions to fail against the historical bugs.** I tried reintroducing the wrapping and the missing `overflow: hidden`; both now pass, because the surrounding layout has changed enough that the old CSS no longer reproduces the old symptom at these widths. So the assertions encode the invariants, but their sensitivity is unproven. Treat this as a floor, not a safety net — worth keeping because it is cheap and runs already, but it has not earned the claim that it would have caught what it was written for. ## Not covered here The `/statistics` download bug was a **routing** fault. I initially added a route check here, then removed it: this test drives a Node fixture server, so the check asserted the fixture's routing rather than the Rust server's. That belongs in a `cargo test` against the real handlers, and is not in this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01GdyUjuXejCEfiub675z6cz
sjg added 1 commit 2026-08-03 00:19:11 +02:00
[test](trx-frontend-http): assert header geometry in the browser smoke test
CI / test (push) Successful in 7m27s
CI / frontend (push) Successful in 3m1s
CI / reuse (push) Successful in 3s
CI / lint (pull_request) Successful in 2m16s
CI / test (pull_request) Successful in 7m24s
CI / frontend (pull_request) Successful in 2m11s
CI / reuse (pull_request) Successful in 2s
CI / lint (push) Successful in 2m15s
b409c57296
Several layout faults shipped while every gate passed, because nothing
looked at geometry: a header whose height tracked the viewport, controls
at four different heights, a tab strip that ran under the controls, and a
dropdown that opened underneath the page.

Assert the invariants behind those at four widths — the header stays one
row, the tabs do not reach the controls, the controls share a height, the
page does not scroll sideways — and that the menu renders with real
dimensions and wins a hit test at its own centre.

The overlap check measures the tabs rather than the strip: with the strip
allowed to overflow, its box shrinks while its content paints across the
controls, so the container's own rect never registers the collision.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdyUjuXejCEfiub675z6cz
Signed-off-by: Stan Grams <sjg@haxx.space>
sjg merged commit b409c57296 into main 2026-08-03 00:19:31 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sjg/trx-rs#33