Skip to content

CI test: assert no mobile horizontal overflow across all console routes #149

Description

@serge-ivo

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

  • Playwright spec sweeps all console routes at 375px (and 320px) and asserts main.scrollWidth <= clientWidth + 1.
  • Runs in CI (test:e2e) and fails with a clear per-route message on regression.
  • Uses a seeded/authenticated fixture so pages render real content (not empty states).
  • Green against current main (post-5fbbff1).

Refs: 5fbbff1. Pairs with the shared <Page> container issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfrontendFrontend / UI work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions