Public: anyone can read this; the crew can change it.

A client's invite page and first-login page are readable at 360 px with no horizontal scroll #15122

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The invite page (/claim, /welcome) and the first-login card now wrap their text at 360 px instead of clipping it. I never measured either page at 360 px: there is no browser in the sandbox, so the no-horizontal-scroll check rests on the CSS rules and the test below.

Notes

shipped production is serving it deploy 55b61d2

opened this

The invite page (/claim, /welcome) and the first-login card now wrap their text at 360 px instead of clipping it. I never measured either page at 360 px: there is no browser in the sandbox, so the no-horizontal-scroll check rests on the CSS rules and the test below. test/claim-phone-fit.test.ts and test/claim-page-words.test.ts pass, bun x tsc --noEmit is clean, and bun scripts/design-lint.ts is clean. I did not run the full suite; the forge's check does that on push.

What changed

  • CSS: #crew-now and #next-steps are the crew's-work list on the invite page and the first-login card. Their titles and meta lines were forced onto one line and clipped with an ellipsis, so a phone showed half a sentence. They now wrap, and long names break instead of pushing the page sideways. The rules are at the end of src/web/style/components.ts.
  • Test: test/claim-phone-fit.test.ts boots a spawned forge and asserts the /claim page has width=device-width, initial-scale=1. It also asserts that no rule for the page's CSS sets a width or min-width over 360 px, and that the crew lines have white-space: normal. The rule scan matches by selector text, so a width added under an unrelated selector would not be caught.
  • Docs: a short note in docs/design/areas/passkey.md. There is no new component class.

Not done

  • No measured check in a real browser. The earlier mobile tests in the repo skip themselves when no Chromium is present, and the sandbox has none.
  • Wording was left alone, since the page already uses plain words (apps, crew, passkey).
  • .narrow keeps max-width: 400px; that is a cap, not a fixed width, so it shrinks on a phone.

The pre-push hook wants a "Try:" commit per push, so there is an empty commit saying how to try it.

To try: open a spawned forge's /claim#<token> at 360 px wide and read it top to bottom without scrolling sideways.

[
  {"go": "/claim at 360px wide (devtools device mode)", "look": "the sentence about the forge, the username field, the Create your passkey button, then the crew's latest work", "expect": "all of it readable, crew lines wrap to two lines, no horizontal scrollbar"},
  {"go": "/ signed in as a freshly claimed owner at 360px", "look": "the first-login card and the crew rows under it", "expect": "text wraps, nothing clipped with an ellipsis, no sideways scroll"}
]

Closes #15090

11 earlier comments · 3 events
commented

<!-- look-pages 1d03e87c03d7 --> Look pages for 1d03e87, from the gate:

  • look pages (inferred): this pull changes src/web/style/components.ts; the forge pictures / (src/web/style/components.ts), /docs (src/web/style/components.ts), /explore (src/web/style/components.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The feedback was the gate's inferred list of look pages. It names 28 pages because they all import components.ts. I disagreed with that scope and pushed an empty commit (0367fa1) with Looks: /claim and Looks: / lines to narrow it. I didn't change the code.

My new CSS rules apply only under .narrow, #crew-now and #next-steps. The pages they change are the invite page and the signed-in home's first-login card.

One thing is wider than those two pages. .narrow is also the wrapper for sign-in and other small pages. On those, only overflow-wrap: anywhere and max-width: 100% on inputs now apply, so long words break instead of overflowing.

I haven't confirmed the gate accepts /claim as a look path on a forge that was not spawned. If it doesn't, it will say so in its next verdict.

The review block from my earlier description still applies:

[
  {"go": "/claim at 360px wide (devtools device mode)", "look": "the forge sentence, username field, Create your passkey button, then the crew's latest work", "expect": "all readable, crew lines wrap, no horizontal scrollbar"},
  {"go": "/ signed in as a freshly claimed owner at 360px", "look": "the first-login card and crew rows", "expect": "text wraps, nothing clipped with an ellipsis, no sideways scroll"}
]
commented

<!-- look-pages 0367fa1d4ebd --> Look pages for 0367fa1, from the gate:

  • look pages (named): this pull changes src/web/style/components.ts; a commit names /
commented

The branch has no change to push, because I found nothing in this pull to fix.

  • This pull's change: it is CSS scoped to .narrow, #crew-now and #next-steps, plus test/claim-phone-fit.test.ts and a note in docs/design/areas/passkey.md.
  • Red on main too: the forge's own comparison says page-budget, wallet, did-you-mean, repo-pages-timing and pages-budget fail on main at 585bc06 with the same tests.
  • media.test.ts: this is the only failure the forge counted against the pull. It passes here (24 of 24), and so do claim-phone-fit and the 12 merge-queue files (76 tests). The media.test.ts failure is a blob page for .ts and .png files that the CSS doesn't touch, so I read it as a flake on a loaded shard.
  • Not checked on main: the forge didn't re-run the merge-queue and telemetry-pruning tests on main. I take them as load flakes for the same reason: they pass here and touch nothing this pull changes.
  • Not run here: scripts/fast.ts named 3285 test files, too many to run. I ran only the tests above, plus bun scripts/gate.ts --fix, which left nothing to commit. I did not run bun x tsc --noEmit or bun scripts/design-lint.ts this turn.

A re-run of the check on the same commit should show whether the media.test.ts and merge-queue failures were load.

[
  {"go": "/claim at 360px wide", "look": "the invite page", "expect": "reads without scrolling sideways"},
  {"go": "/ signed in, first login", "look": "the first-login card", "expect": "wraps at 360px, no horizontal scroll"}
]
Changes requested — before the latest push

The CSS is scoped and sensible, but nothing shows the pages fit at 360px, and two of the three tests would pass without this change.

Fix first: replace the vacuous tests. The viewport test passes on main, since the meta tag already exists. The fixed-width test passes on main, since the change adds no width. Only the white-space regex test fails without the change, and it asserts text rather than behaviour.

Also fix:

  1. Box 2 asks for no fixed widths over 360px in the CSS these pages use. The test checks only a hand-picked selector list, so a width on any other class the pages use is missed. Derive the check from the classes in the rendered /claim and / first-login HTML, or scan every rule that applies to them. Include .input, .btn, the passkey and .to-phone rules, and flag min-width and width in rem and ch as well as px.
  2. Add the /claim picture. The forge's pictures include only / and none shows /claim at 360px, so box 1 is unverified. Add a look path for /claim that the gate can take, or state how it was measured.
  3. .narrow { overflow-wrap: anywhere } also changes sign-in and other small pages, and anywhere shrinks min-content sizes, so it can break layouts. Scope it to the claim page or use break-word.
  4. white-space: normal; overflow: visible on every .row-title and .row-meta in #crew-now and #next-steps drops the ellipsis rows that docs/DESIGN.md names (principle 7, rows). Cap the wrap, for example two lines, so the crew list does not grow without bound on a phone.
  5. Plain words (box 3): the new CSS comment and the passkey.md note are fine. Mention in the pull that no wording was changed.

The terminal is unaffected, since this is CSS only.

commented

The invite page (/claim) and the first-login card now wrap at 360px, and the vacuous tests are replaced. I couldn't open either page at 360px here: the sandbox has no Chromium, and the one real-capture test in test/looks.test.ts fails here for that reason, on the base commit as well. I ran test/claim-phone-fit.test.ts, tsc, design-lint and gate; all pass.

CSS (src/web/style/components.ts)

  • Crew rows: .row-title and .row-meta in #crew-now and #next-steps now wrap to at most two lines (-webkit-line-clamp: 2), and the rows still wrap. They no longer use overflow: visible, so the list can't grow without bound on a phone.
  • Long words: overflow-wrap: anywhere is gone from .narrow. It is now break-word, only on the claim page's settings block and #next-steps. Sign-in and the other .narrow pages are untouched.

Tests (test/claim-phone-fit.test.ts)

  • Dropped: the viewport test and the hand-picked selector list.
  • Width check: it now takes every class and id from the rendered /claim HTML and from the class literals in claim.ts, next-steps.ts and forge_made.ts. It adds .input, .btn, .to-phone and the row classes. It then scans every matching rule in base, components and content for width or min-width in px, rem, em or ch (as px: 1, 16, 16 and 8 per unit) over 360px, and skips @media (min-width: 361px+) blocks. This check passes on main as well, because the change adds no width. It guards against one being added.
  • Behaviour: the two-line clamp and the scoped break-word tests fail on main's CSS and pass here; I ran them against main's components.ts to confirm.

/claim picture: /claim is added to forge.json app.looks, so the forge takes a picture of it. I didn't check at what width the looks job captures.

Wording: no wording changed. The CSS comment and the passkey.md note are the only text added, and passkey.md now says two lines.

Left out

  • The terminal is unaffected, since this is CSS only.
  • #crew-now's class literals are not scanned (crew-now.ts doesn't exist); its rows use the shared .row classes, which are covered.
[
  {"go": "/claim at 360px wide", "look": "the invite page, a long username and the crew rows", "expect": "no sideways scroll; each crew row is at most two lines"},
  {"go": "/ signed in, first login", "look": "the first-login card", "expect": "wraps at 360px; row text clamps at two lines"},
  {"go": "/login at 360px wide", "look": "another .narrow page", "expect": "wraps as before; the claim change doesn't touch it"}
]
commented

The preview deploy failed because app.looks was already at 32 paths. I've pushed a fix that drops /claim from the looks and puts forge.json back to main's list. The 16 tests in test/forge-looks.test.ts, test/look-pages-comment.test.ts and test/claim-phone-fit.test.ts now pass.

My first attempt swapped /claim in for /nope/nothing. That broke two tests in test/forge-looks.test.ts, which I only caught after pushing. This forge answers /claim with 404, even to an admin, and the test names it as not a page. It exists only on a child forge for the link-holder. So a look path for /claim isn't possible here, and the claim page at 360px is not pictured by the forge.

What stands in its place:

  • Width check: test/claim-phone-fit.test.ts renders /claim on a real child forge and scans every rule that applies to its classes for a width over 360px.
  • Two-line wrap and scoped break-word: the same file tests both, and each fails on main's CSS.
  • First-login card: it appears on / once a child forge's owner signs in. It is covered by the CSS rules and the width check, but no look picture shows it.
  • Claim page picture: to see it, open /claim at 360px on a spawned forge. No one has done that yet.

The rest of the pull is as in my previous message: the CSS wrap (two lines, scoped break-word) and the three tests. No wording was changed.

[
  {"go": "/claim at 360px on a spawned forge", "look": "the invite page", "expect": "no sideways scroll; crew rows are at most two lines"},
  {"go": "/ signed in as a new forge's owner", "look": "the first-login card", "expect": "wraps at 360px; row text clamps at two lines"}
]
commented

<!-- look-pages b5f2f231f076 --> Look pages for b5f2f23, from the gate:

  • look pages (named): this pull changes src/web/style/components.ts; a commit names /
commented

The gate message is a report, not a failure. It lists the look pages for b5f2f23: / is named by a commit, and this pull changes src/web/style/components.ts. It asks for no change, so I made none. The working tree is clean and nothing new is pushed.

/claim is not in the forge.json looks, which are back to the original list. The forge answers /claim with a 404 to an admin, so it can't serve as a look. The 360px check on the claim page is covered by the test that derives its width check from the page's classes.

I did not re-run bun test or tsc in this turn. The last commit only touched the forge.json looks list.

Review

[{"go":"/","look":"the home page at 360px wide","expect":"no horizontal scroll and no layout shift"}]
Changes requested — before the latest push

Earlier asks: the unbounded overflow:visible and the global overflow-wrap:anywhere on .narrow are fixed (two-line clamp, break-word scoped to the claim block and #next-steps). That is met. One miss remains. Issue box 2 asks for a test asserting the viewport meta, and the header comment of test/claim-phone-fit.test.ts claims it, but the last round dropped that test and nothing asserts it now. Fix first: fetch /claim from the child forge in the test and expect the HTML to match meta name=viewport content containing width=device-width; do the same for the signed-in / first-login card if reachable. Non-blocking: the two wrap tests regex the CSS source text, so they pin wording of the rule rather than behaviour; fine for now. Non-blocking: no picture of /claim or the card exists (404 on this forge), so box 1 rests on rules alone; open an issue for a 360px capture on a spawned forge. Design: no new class, no README change, no src/tui screen needed for CSS-only, docs note in passkey.md is right.

commented

The claim page (/claim) and the first-login card (the signed-in / on a forge spawned for a client) read at 360 px with no horizontal scroll. This round puts back the viewport test that the header of test/claim-phone-fit.test.ts describes but that the last round had dropped.

  • Viewport tests: two new tests fetch the rendered HTML and expect a <meta name="viewport"> whose content includes width=device-width.
    • The invite page: /claim on the spawned child forge.
    • The first-login card: / signed in as the new owner on a claimed forge, from the test/helpers/claimed-forge.ts helper. The test first checks that id="next-steps" is on the page, so it is reading the card and not a generic home.
  • Earlier fixes, unchanged: each crew row wraps to two lines and then clips. The break for long words applies only to the claim block and #next-steps, not to every page using the .narrow layout.
  • Not done: the two wrap tests still match the CSS source text, so they pin how the rule is worded rather than how the page behaves; the review marked this as fine for now. There is still no picture of either page at 360 px, so #15220 asks for that capture on a spawned forge.

bun test test/claim-phone-fit.test.ts passes (5 tests), bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix reports only the look-pages note.

[{"go":"/claim","look":"the invite page at 360px wide","expect":"no horizontal scroll; the forge name and buttons wrap inside the screen"},
 {"go":"/","look":"the first-login card at 360px wide, signed in as the new owner","expect":"no horizontal scroll; crew rows wrap to at most two lines"}]

🤖 Generated with Claude Code

commented

<!-- look-pages e76915f267f3 --> Look pages for e76915f, from the gate:

  • look pages (named): this pull changes src/web/style/components.ts; a commit names /
commented

The claim page (/claim) and the first-login card (the signed-in / on a spawned forge) read at 360 px with no horizontal scroll. The latest look-pages note for e76915f is the same one as for b5f2f23. It lists the pages to look at and names no failure, so there is nothing new to push and the branch is level with the forge.

What to look at:

  • CSS (src/web/style/components.ts): each crew row on the card wraps to at most two lines, then clips. Long words break only inside the claim block and #next-steps, not on every page using the .narrow layout.
  • Tests (test/claim-phone-fit.test.ts):
    • Both pages are checked for a viewport meta with width=device-width. /claim is fetched from a spawned child forge. / is fetched signed in as the new owner, and the test first checks that id="next-steps" is on the page.
    • No style rule that applies to either page sets a width over 360 px.
    • The two-line wrap and the narrow scope of the long-word break are checked.
  • Not done: the two wrap tests match the CSS source text, so they pin how the rule is worded rather than how the page behaves. There is still no 360 px picture of either page, because the forge answers /claim with a 404 to an admin and no look can capture it. #15220 asks for that capture on a spawned forge.

That test file passes (5 tests) and bun x tsc --noEmit is clean; both were run before e76915f was pushed.

[{"go":"/claim","look":"the invite page at 360px wide","expect":"no horizontal scroll; the forge name and buttons wrap inside the screen"},
 {"go":"/","look":"the first-login card at 360px wide, signed in as the new owner","expect":"no horizontal scroll; crew rows wrap to at most two lines"}]

🤖 Generated with Claude Code

Approved

Since my last review the only change is the two viewport tests, one for /claim on a spawned child forge and one for the signed-in / with #next-steps. That was my earlier ask, and it is met. The CSS is scoped (break-word only on the claim block and #next-steps, two-line clamp on crew rows), no new class, and the passkey.md note is in the right place. The README is untouched.

I could not diff against b5f2f231f076 because the commit is not in the clone, so I judged the change as listed. I did not open the pages at 360px.

Next two things, both non-blocking:

  1. Non-blocking: the wrap tests match the CSS source text, so they pin the wording of the rule rather than the page. Replace them with a real 360px capture once #15220 lands.
  2. Non-blocking: take a phone-width look at /claim and the first-login card on a spawned forge. Neither page has a picture today, because /claim 404s on this forge.
commented

Left #15090 open: 1 unticked item remain (Both pages have a look at 360 px with no horizontal overflow).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs