Context
Mobile horizontal scroll has recurred multiple times in the console; the latest root cause (missing w-full on page containers) was fixed in 5fbbff1, and the pattern-level fix is tracked in the companion issue (shared <Page> container). This issue adds the automated safety net so any future regression fails CI instead of shipping.
Proposal
A Playwright test (the repo already runs pnpm test:e2e) that, at a mobile viewport (375×812), loads each console route while signed in and asserts no page-level horizontal overflow:
// for each route:
const overflow = await page.evaluate(() => {
const m = document.querySelector('main') ?? document.scrollingElement;
return m.scrollWidth - m.clientWidth;
});
expect(overflow, `${route} overflows by ${overflow}px at 375w`).toBeLessThanOrEqual(1);
Routes to cover: /agents, /browse, /instances, /agents/:id (+ /settings), /instances/:id/{board,knowledge,settings,coding,repo}, /profile, /usage, /terminals, /notifications, /instances/:id/tasks/:taskId.
Critical assessment
- This catches the actual defect (page wider than viewport), unlike a global
overflow-x:hidden band-aid which would make this very test pass while silently clipping content. That's precisely why the test matters: it lets us keep any safety-net CSS honest.
- Auth + fixtures: the console needs a signed-in session and at least one instance per surface (coding/repo/apply). Options: a seeded test account with a stored session token, or mock the API at the network layer. Prefer a seeded read-only fixture account so the test exercises real rendered content (empty pages can hide overflow — an empty list never overflows).
- Assert against
<main>, not document — <main> is the scroll region; the header nav is an intentional overflow-x-auto. (This mirrors the manual probe that found the bug: an earlier version wrongly treated <main>'s own overflow as an inner container and under-reported.)
- Viewport realism: run at 375 (iPhone) and optionally 320 (smallest common) since some overflow only appears at the tightest width.
- Cost: one spec, ~15 route assertions; fast. Low flake risk if it waits for a stable network-idle per route.
Acceptance criteria
Refs: 5fbbff1. Pairs with the shared <Page> container issue.
Context
Mobile horizontal scroll has recurred multiple times in the console; the latest root cause (missing
w-fullon page containers) was fixed in5fbbff1, and the pattern-level fix is tracked in the companion issue (shared<Page>container). This issue adds the automated safety net so any future regression fails CI instead of shipping.Proposal
A Playwright test (the repo already runs
pnpm test:e2e) that, at a mobile viewport (375×812), loads each console route while signed in and asserts no page-level horizontal overflow:Routes to cover:
/agents,/browse,/instances,/agents/:id(+/settings),/instances/:id/{board,knowledge,settings,coding,repo},/profile,/usage,/terminals,/notifications,/instances/:id/tasks/:taskId.Critical assessment
overflow-x:hiddenband-aid which would make this very test pass while silently clipping content. That's precisely why the test matters: it lets us keep any safety-net CSS honest.<main>, notdocument—<main>is the scroll region; the header nav is an intentionaloverflow-x-auto. (This mirrors the manual probe that found the bug: an earlier version wrongly treated<main>'s own overflow as an inner container and under-reported.)Acceptance criteria
main.scrollWidth <= clientWidth + 1.test:e2e) and fails with a clear per-route message on regression.main(post-5fbbff1).Refs:
5fbbff1. Pairs with the shared<Page>container issue.