Skip to content

Fit a signup's three tabs on a 320px phone in every language - #1112

Merged
richshaw merged 5 commits into
mainfrom
claude/issue-1022-tabs-fit-320
Nov 26, 2026
Merged

richshaw merged 5 commits into
mainfrom
claude/issue-1022-tabs-fit-320

Conversation

@richshaw

@richshaw richshaw commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1022.
Session: https://claude.ai/code/session_016YZ9STsNeQFCos1mPCTVrc

The problem

On a 320px phone, a signup's tab strip (Build · Responses · Settings, in TabsNav) was wider than the screen in Swedish and German. A signup opens on Build, so the Settings tab showed cut in half at the right edge. The strip scrolls, but its scrollbar is hidden, so nothing said there was more. Measured on the seeded signups (counts 7 and 5): the strip needed 372px in Swedish and 352px in German. English already fit.

The fix

  • src/components/signup/TabsNav.tsx, below sm only:
    • each tab's side padding goes from px-3 (12px) to px-1.5 (6px), and the gap before a count from gap-2 to gap-1
    • the count's minimum width goes from 1.5rem to 1.25rem, and its side padding from px-1.5 to px-1
    • the strip's own side padding goes from px-4 to px-2. I made this choice; the issue doesn't list it. The issue's levers alone leave Swedish over. The first tab's label now starts 14px from the screen edge, about in line with the page's 16px gutter. Before, it started at 28px.
  • Tab height (py-3) is unchanged, so the tap target doesn't shrink. From sm up, every class is what it was, so the desktop strip looks the same. The centring effect (fix(a11y): center the active tab by scrolling the strip, not the page #673) is untouched.
  • Room to spare: CI's Chromium hints Inter to whole pixels, which makes text a few pixels wider than it is on a machine that lays it out at fractional widths. At 320px the Swedish strip now takes 311px hinted and 304px unhinted; German takes less. That leaves room for a two-digit count. A three-digit count can still make the strip scroll, which the issue says is fine. It doesn't wrap or clip.
  • This uses one set of sizes for every language and no Swedish-only CSS, as the issue's default says.
  • CHANGELOG entry under Unreleased › Fixed.
  • affected-articles.mjs names no help article, and no help screenshot shows the strip at phone width, so no help change.

Tests

  • tests/e2e/translated-organizer.spec.ts: the label-fit test now checks "every tab in view" (the strip doesn't scroll sideways) at 320px as well as 390px, for each test language. On main's TabsNav it failed at 320px in both Swedish and German.
  • The first push left Swedish only 4px to spare, and CI's e2e failed on it. I reproduced that locally by turning on full font hinting (a fontconfig file with hintfull), which gave 323px. With this PR's head, the spec passes with hinting on and off.
  • Ran and passed on the head: pnpm lint, pnpm format:check, pnpm typecheck, pnpm knip, pnpm test (252 files, 3869 passed, 1 expected fail), and pnpm build && pnpm budgets with CI's NEXT_PUBLIC_* values (Build page 151.7 of 151.8 kB; no budget changes). Against the production build, chromium, with hinting: translated-organizer, tabs-focus-ring and organizer (37 passed). On the first push, the whole chromium suite passed locally (310).
  • Overlap: Keep the organizer header's crumbs clear of Help, Account and Sign out on a phone #1104 (for The organizer header's crumbs run into Help and Account on a phone #978) adds a header layout spec over the same pages at 320 and 390px, but doesn't touch TabsNav or this spec. No conflict is expected.

🤖 Generated with Claude Code

https://claude.ai/code/session_016YZ9STsNeQFCos1mPCTVrc

In Swedish and German the tab strip was wider than a 320px screen, so a
signup opened on Build showed Settings cut in half at the right edge.
Below sm, the tabs' side padding, the gap before a count, the count's
minimum width and the strip's own side margin are narrower; the tabs
keep their height, and wider screens are unchanged.

The label-fit test now checks every tab is in view at 320px as well as
390px, in every catalog language.

Fixes #1022.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9STsNeQFCos1mPCTVrc
@richshaw richshaw added pipeline:tophat pipeline:ux Changes what a person using OpenSignup sees or does pipeline:working A session is working on it right now labels Nov 24, 2026 — with Claude
CI's Chromium hints Inter to whole pixels, which made the Swedish tabs
323px wide at 320px; here the text is laid out at fractional widths and
they took 316px. Below sm each tab's side padding goes from 8px to 6px,
so the Swedish strip takes 311px hinted and 304px unhinted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9STsNeQFCos1mPCTVrc

Copy link
Copy Markdown
Owner Author

CI: e2e failed on the first push, fixed in c8d00c0

e2e failed on 6e99818 on the new check this PR adds: "every tab in view at 320px", in Swedish only, on both tries. German passed.

Cause: CI's Chromium hints Inter to whole pixels, so each tab's text is a few pixels wider there than in the container where I measured. In the container the Swedish strip took 316 of 320px, which left too little room. With a fontconfig file that turns on full hinting, I got the same failure locally: the strip took 323px.

Fix: below sm, each tab's side padding goes from 8px to 6px. The Swedish strip now takes 311px with hinting and 304px without. The spec passes either way, and so do lint, format, typecheck, knip, the unit tests, and pnpm build && pnpm budgets. No budget changes.

https://claude.ai/code/session_016YZ9STsNeQFCos1mPCTVrc


Generated by Claude Code

@richshaw richshaw added pipeline:working A session is working on it right now and removed pipeline:working A session is working on it right now labels Nov 24, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Tophat: passed

See it: https://claude.ai/artifact/EeRgZvFu43K5pa9SiykCJN
What changes for people: on a phone, a signup's Build, Responses and Settings tabs sit a little closer together, so all three fit whole on a 320 px screen in Swedish and German. Before, Settings was cut off at the screen's edge with nothing to show there was more. On a computer the tabs look exactly as before.

Check Result What I saw
Bug on the base, 320 px ✅ reproduced The Swedish strip was 373 px wide and the German one 353 px, in a 320 px screen. Settings was cut off. English fit.
Head at 320 and 390 px: English, Swedish and German, on the Build and Settings tabs ✅ In all 12 cases the strip is exactly the screen's width, every tab is wholly in view, and nothing scrolls sideways. Swedish "Inställningar" ends at 297 px of 320. Every tab is still 46 px high.
Computer, 1280 px ✅ In all three languages, every tab has the same position and width as on the base.
Tap and keyboard, Swedish at 320 px ✅ Tapping Inställningar opens Settings. The keyboard focus ring sits fully inside its tab.
Console and server log ✅ The browser printed one 404 line, which matches no request the page made, and a class-only change can't cause it. The server's only error is the health check's worker query, because no worker was running.

Worth a look: the tighter spacing applies on every phone, not only at 320 px. At 390 px in English the tabs also sit closer together. The first tab now starts 8 px from the screen's edge (its word at 14 px), while the panel below starts at 16 px. The card shows the 390 px pair.

Not checked: a two- or three-digit Responses count (these signups had 0 responses; the PR's e2e spec measures the seeded counts). Firefox and Safari (only Chromium here).

Ran c8d00c0 against 90369ba locally, Chromium at 320, 390 and 1280 px wide, made-up data. https://claude.ai/code/session_016YZ9SUXdWjAwJhK7qPRd9V


Generated by Claude Code

@richshaw richshaw added pipeline:review and removed pipeline:tophat pipeline:working A session is working on it right now labels Nov 24, 2026 — with Claude

@richshaw richshaw left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: passed (round 1)

This changes classes only, in TabsNav. Below sm, the tab padding, the gap before a count, the count's minimum width and padding, and the strip's side padding all get smaller. Every sm: variant puts back the old value, so the desktop strip is unchanged (the tophat measured the same positions at 1280 px). py-3 stays, so the tap target keeps its height. The e2e check "every tab in view" now runs at 320 px as well as 390, so a regression in any test language fails CI. The CHANGELOG entry is there.

Blocking (0)
Optional (1): TabsNav.tsx L60: with -mx-4 px-2, the strip's first tab starts 8 px from the screen's edge, while the panel below starts at 16. The tophat's 390 px pair shows the offset. The description makes this choice on purpose, so whether it reads fine is the owner's call.
Earlier threads: none
Checks: CI green on c8d00c0 (lint-type-test, e2e, CodeQL). The tophat passed on this same SHA. No conflict with main.

Waits for the owner because it's UX (the tab strip's spacing on every phone). Card: https://claude.ai/artifact/EeRgZvFu43K5pa9SiykCJN. The code adds no risk beyond what's on screen.

https://claude.ai/code/session_016YZ9SUXdWjAwJhK7qPRd9V


Generated by Claude Code

@richshaw richshaw added pipeline:owner Passed; waits for the owner (UX or high-risk) and removed pipeline:review labels Nov 24, 2026 — with Claude
@richshaw richshaw added pipeline:merge and removed pipeline:owner Passed; waits for the owner (UX or high-risk) labels Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Approved by the owner at c8d00c0.

https://claude.ai/code/session_016YZ9SVEZdRizJssntdwLA8


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Merge: not merged, sent to fix

One gate failed on c8d00c0:

The other gates passed: review and tophat at c8d00c0, no open threads, owner approval recorded for c8d00c0 above. A conflict fix in runtime code is a change of the PR's own, so it goes back through tophat and a fresh owner OK.

https://claude.ai/code/session_016YZ9SVEZdRizJssntdwLA8


Generated by Claude Code

@richshaw richshaw added pipeline:fix pipeline:working A session is working on it right now and removed pipeline:merge labels Nov 25, 2026 — with Claude
Resolves the conflict with #1077 in TabsNav: the count badge keeps
#1077's aria-hidden on Build (with its sr-only words after it) and this
branch's narrower phone spacing. CHANGELOG keeps both entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SSe4RUc89LXkqYHJs6

Copy link
Copy Markdown
Owner Author

Conflict with main: resolved in 1f6ac7e

main (#1077) changed the same count badge in src/components/signup/TabsNav.tsx that this PR restyles. The merge keeps both:

The sr-only span is positioned absolutely, so it adds no width to the tab. Build's number also counts only slots now, so it's the same width or narrower than before.

Checked on the merge: pnpm lint, format:check, typecheck, knip, pnpm test (252 files, 3881 passed, 1 expected fail). pnpm build && pnpm budgets with CI's NEXT_PUBLIC_* values: all within budget (Build 152.0 of 152 kB). Against the production build in Chromium, with full font hinting on (as CI renders): translated-organizer, tabs-focus-ring, organizer and organizer-header-layout, 55 passed, including "every tab in view" at 320px in Swedish and German. With hinting off, translated-organizer and tabs-focus-ring passed too (6).

The conflict was in runtime code, so this goes back to tophat once CI is green, and then needs a fresh owner OK.

https://claude.ai/code/session_016YZ9SSe4RUc89LXkqYHJs6


Generated by Claude Code

@richshaw richshaw added pipeline:tophat pipeline:working A session is working on it right now and removed pipeline:fix pipeline:working A session is working on it right now labels Nov 25, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Tophat: passed

See it: https://claude.ai/artifact/EeRgZvFu43K5pa9SiykCJN
What changes for people: on a phone, a signup's Build, Responses and Settings tabs sit a little closer together, so all three fit whole on a 320 px screen in Swedish and German. Before, Settings was cut off at the screen's edge with nothing to show there was more. On a computer the tabs look exactly as before.

This re-checks the merge from main that resolved the conflict with #1077's Build-tab count.

Check Result What I saw
Bug on the base (main with #1077), 320 px ✅ reproduced Swedish strip 372 px wide, German 352 px, in a 320 px screen. Settings was cut off. English fit.
Head at 320 and 390 px: English, Swedish, German, Build and Settings tabs ✅ In all 12 cases the strip is exactly the screen's width, every tab is wholly in view, and nothing scrolls sideways. Tabs still 46 px high.
Two-digit counts, Swedish, 320 px (12 slots, 12 sign-ups) ✅ All three fit, and Inställningar ends at 298 px of 320. Tapping it opens Settings.
#1077's hidden "N slots" words on Build ✅ They're still there after the merge and add no width.
Computer, 1280 px ✅ Every tab has the same position and width as on the base, in all three languages.
Console and server log ✅ No browser console errors in 36 page loads. The server's only errors come from the health check's worker query, because no worker was running.

Worth a look: the tighter spacing applies at every phone width, not only 320 px. At 390 px the first tab starts 8 px from the edge, while the panel below starts at 16 px.

Not checked: the keyboard focus ring, which the merge didn't change and the tophat at c8d00c0 checked. Firefox and Safari, because only Chromium is available here.

Ran 1f6ac7e against ae90fa8 locally, Chromium at 320×800, 390×800 and 1280×800, made-up e2e seed data. https://claude.ai/code/session_016YZ9SWSbhtCnF13yMBu7QU


Generated by Claude Code

@richshaw richshaw removed the pipeline:tophat label Nov 25, 2026 — with Claude
@richshaw richshaw added pipeline:review pipeline:working A session is working on it right now and removed pipeline:working A session is working on it right now labels Nov 25, 2026 — with Claude

@richshaw richshaw left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: passed (round 2)

The only change since the review that passed at c8d00c0 is the merge from main. It resolves the TabsNav conflict with #1077 correctly: Build's badge keeps aria-hidden and its sr-only "N slots" words, and it gets this PR's phone sizes. CHANGELOG.md keeps both entries. The spec change hasn't moved since the last review.

Blocking (0)
Optional (0)
Earlier threads: none
Checks: CI green on 1f6ac7e, e2e included. The tophat passed on 1f6ac7e: all three tabs fit at 320 px in English, Swedish and German, two-digit counts included, and the desktop layout is unchanged.

Needs the owner because it's UX. The approval for c8d00c0 doesn't carry over: the merge resolved a conflict in runtime code. Card: https://claude.ai/artifact/EeRgZvFu43K5pa9SiykCJN

https://claude.ai/code/session_016YZ9SWSbhtCnF13yMBu7QU


Generated by Claude Code

@richshaw richshaw added pipeline:owner Passed; waits for the owner (UX or high-risk) and removed pipeline:review pipeline:working A session is working on it right now labels Nov 25, 2026 — with Claude
@richshaw richshaw added pipeline:merge and removed pipeline:owner Passed; waits for the owner (UX or high-risk) labels Nov 26, 2026
@richshaw richshaw added the pipeline:working A session is working on it right now label Nov 26, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Approved by the owner at 1f6ac7e.

https://claude.ai/code/session_016YZ9SSmSRHnrjyfJxikvNb


Generated by Claude Code

@richshaw
richshaw merged commit c98191a into main Nov 26, 2026
5 checks passed
@richshaw
richshaw deleted the claude/issue-1022-tabs-fit-320 branch November 26, 2026 19:52
@richshaw richshaw removed pipeline:merge pipeline:ux Changes what a person using OpenSignup sees or does pipeline:working A session is working on it right now labels Nov 26, 2026 — with Claude
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.

The Swedish signup tabs don't fit at 320 px, so Inställningar is half off-screen

2 participants