Skip to content

Tab rows no longer scroll when every tab fits - #331

Merged
nambok merged 1 commit into
mainfrom
tabs-no-sideways-scroll
Nov 7, 2026
Merged

nambok merged 1 commit into
mainfrom
tabs-no-sideways-scroll

Conversation

@nambok

@nambok nambok commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

On a wide desktop screen the run page's tab row (Overview, Changes, Activity, Details) showed a scrollbar even though all four tabs fit. The cause was in the shared tab row (components/tabs.tsx), so the same problem was on every page that uses it: the run page, Analytics, Tests, Platform admin, Agent permissions, Deliveries, the agent page under Skills, the section tabs (Code review, Logs, Insights and so on) and the Instructions tabs.

Root cause: the tab list had -mb-px so the active underline would overlap the nav's bottom border. The list sits inside ScrollFade's overflow-x-auto box. When one axis is set to scroll, the other one scrolls too, so the negative margin made the list 1px taller than the box (scrollHeight 45 vs clientHeight 44, measured). The box could scroll whether or not the tabs fit, and browsers that always show scrollbars drew one under the tabs. The scroll box also clipped that 1px, so the overlap the margin was meant to create never showed.

Changes

  • dashboard/src/components/tabs.tsx: the base line is now the list's own bottom border. Each tab pulls down 1px onto that border, inside the list's box, so nothing spills out of the scroll box and the active underline sits on the line as intended. The list is min-w-max, so on a phone, when the tabs do scroll, the line runs the full scrolled width. The nav no longer draws its own border. When a phone shows the tabs as a select, the border moves under the select. The scroll box gets testId="tab-row" so tests can find it.
  • dashboard/e2e/tabs-no-scroll.spec.ts (new): for 10 pages with a tab row, at 1280px and 1600px wide, every tab row's scroll box must have scrollWidth <= clientWidth and scrollHeight <= clientHeight. At 375px the page must not scroll sideways, and no tab row may scroll up and down. A listed page that stops drawing a tab row fails the test, so the list can't go stale without anyone noticing.

Verification

  • Before the fix, the new spec failed on all 10 pages ("1px taller inside than out" for every row). After the fix, all 10 pass.
  • I built the static export like CI does and ran these specs against it with E2E_STATIC=1: tabs-no-scroll, no-sideways-scroll, layout, analytics, tests, logs, skills, settings, shell-nav, audit-runs, audit-shell, admin, deliveries, agent-permissions, readable-text, run-trigger and audit-reviewer. 455 passed. One test in tests.spec.ts failed only because of a trace file I removed by hand while it ran; I reran tests.spec.ts on its own and all 25 passed.
  • Ran npm run lint, npm run typecheck and npm run check:openapi in dashboard/: all clean. Root eslint is clean on the changed files.
  • Screenshots of the run page and Tests tabs at 1280px and 375px: the underline sits on the base line, and phones still get the select or the row that scrolls.

The shared tab row (components/tabs.tsx) pulled its list down 1px with a
negative bottom margin so the active underline would sit on the nav's
border. The list is inside an overflow-x-auto box, which makes the box
scroll on both axes, so the list ended up 1px taller than the box and
the box scrolled even when every tab fit, drawing a scrollbar under the
tabs on desktop.

The base line is now the list's own bottom border, and each tab pulls
down 1px onto it inside the list's box, so nothing overflows. The list
is at least as wide as its tabs, so the line runs the full scrolled
width on a phone.

e2e/tabs-no-scroll.spec.ts checks every page with a tab row.
@nambok
nambok merged commit 9c89ecb into main Nov 7, 2026
10 checks passed
@nambok
nambok deleted the tabs-no-sideways-scroll branch November 7, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant