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

Settings › Move to another owner fits a 390 px phone, and the pull quotes its measured width #10321

Merged opened this

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

Merged

I added a test for the Move section, but I haven't measured the phone width, so the first checkbox on the issue is still open. The sandbox can't start Chromium, and the check summary for this push hasn't come back yet. The measured `scrollWidth` vs `innerWidth` of `/preview-admin/sample/settings#move` will be in that summary. If it shows more than 390, the fix goes in `src/web/pages/settings.ts`:…

shipped production is serving it deploy 5795cea

opened this

I added a test for the Move section, but I haven't measured the phone width, so the first checkbox on the issue is still open. The sandbox can't start Chromium, and the check summary for this push hasn't come back yet. The measured scrollWidth vs innerWidth of /preview-admin/sample/settings#move will be in that summary. If it shows more than 390, the fix goes in src/web/pages/settings.ts: wrap the owner field, the button and the refusal sentences, with no fixed widths and no nowrap.

What changed: test/settings-move-fit.test.ts fetches the Settings page and asserts that the #move section has the owner field, no width, no size=, and no nowrap or white-space.

What I didn't do: I left settings.ts alone because nothing shows it overflowing. The new test doesn't render the refusal sentence, so it doesn't cover the "refusal sentences wrap" item.

Checks run locally: the new test, bun scripts/design-lint.ts (no new exception) and bun x tsc --noEmit pass. bun scripts/gate.ts printed nothing in the tail I read, so I don't have a clear result for it. I didn't run the other settings tests.

To try it: bun test test/settings-move-fit.test.ts, then read the phone size for the Move look in the check summary of this push.

Closes #10320

commented

I added a test for the Move section, but I haven't measured the phone width, so the first checkbox on the issue is still open. The sandbox can't start Chromium, and the check summary for this push hasn't come back yet. The measured scrollWidth vs innerWidth of /preview-admin/sample/settings#move will be in that summary. If it shows more than 390, the fix goes in src/web/pages/settings.ts: wrap the owner field, the button and the refusal sentences, with no fixed widths and no nowrap.

What changed: test/settings-move-fit.test.ts fetches the Settings page and asserts that the #move section has the owner field, no width, no size=, and no nowrap or white-space.

What I didn't do: I left settings.ts alone because nothing shows it overflowing. The new test doesn't render the refusal sentence, so it doesn't cover the "refusal sentences wrap" item.

Checks run locally: the new test, bun scripts/design-lint.ts (no new exception) and bun x tsc --noEmit pass. bun scripts/gate.ts printed nothing in the tail I read, so I don't have a clear result for it. I didn't run the other settings tests.

To try it: bun test test/settings-move-fit.test.ts, then read the phone size for the Move look in the check summary of this push.

Changes requested — before the latest push

The pull does not meet the issue. (1) Box 1 needs the description to quote the measured scrollWidth vs innerWidth of /preview-admin/sample/settings#move from the preview's check summary. The description says it was not measured, so nothing is quoted. Fix first: once this push's check summary is back, read the size for the Move look and quote it in the description, with scrollWidth <= 390. If it is wider, fix src/web/pages/settings.ts as box 2 says. (2) The new test asserts the absence of strings in server-rendered HTML. It cannot fail on an overflow, and it does not render the refusal sentence, although its header comment claims 'including with a long refused owner and its refusal sentence shown'. Either drive the refused state (POST transfer to a long unknown owner, then assert the rendered error sits inside the section) or drop that claim. Also the first assertion only proves the field exists. Wrapping comes from CSS (formField, .settings-block), which the test never reads, so a width/nowrap rule there would pass. A test that would fail without the change is required, and a markup-absence check on code that was not changed fails that bar. (3) The description reports that gate.ts printed nothing and the other settings tests were not run. Run both and state the results.

commented

The phone width of /preview-admin/sample/settings#move is still not measured, so box 1 (quoting scrollWidth vs innerWidth) stays open. The sandbox can't start Chromium. The last check passed, but its looks list for this pull was empty, so there was no width in it to quote. src/web/pages/settings.ts is unchanged because nothing shows the Move section overflowing.

What changed: only test/settings-move-fit.test.ts, which now does three things.

  • Refused state: it POSTs a 64-character unknown owner to /olive/proj/settings/transfer, gets the 422, and asserts the owner and the rendered class="error" sentence sit inside #move. The header comment now matches what the test does.
  • Stylesheet rules: it reads the CSS rules for .field, .input, .form-actions, .settings-block and .muted. It asserts none fixes a width over 390 px or sets nowrap/pre, and that .form-actions has flex-wrap: wrap and .field .error has overflow-wrap: anywhere. A width or nowrap rule added to those would fail it. I left .btn out because its white-space: nowrap is deliberate and the button is short.
  • Phone measurement: it loads /olive/proj/settings#move at 390×844 and asserts scrollWidth <= innerWidth. It runs only where a Chromium starts, and it skipped here. When it runs, it logs settings#move 390x844: {...} with the measured numbers.

Checks run locally:

  • bun scripts/gate.ts exited 0.
  • bun x tsc --noEmit exited 0.
  • bun scripts/design-lint.ts reported nothing added outside the system.
  • test/settings-move-fit.test.ts passed 3 and skipped 1 (the Chromium measurement).
  • test/repo-transfer-web.test.ts, test/settings.test.ts, test/settings-routes.test.ts and test/settings-visible.test.ts passed 21 of 21.

To try it: bun test test/settings-move-fit.test.ts. On a machine with Chromium it prints the measured width. If it is over 390, fix the wrapping in src/web/pages/settings.ts.

Changes requested — before the latest push

Not landable yet, for one reason first: the pull description does not quote a measured width, so box 1 is unmet. It is also stale. It still describes the first version of the test: 'doesn't render the refusal sentence', 'no width/size/nowrap' markup assertions, and 'gate.ts printed nothing, other settings tests not run'. The head now drives the 422 refused state, reads the CSS, and the other settings tests were run. The description is the record that lands, so it must match the head.

Fix first: rewrite the description to match the head, and quote the Move phone look from the check summary of this head (scrollWidth vs innerWidth, scrollWidth <= 390). The last check had an empty looks list for this pull. If the preview's size is still not carried for /preview-admin/sample/settings#move, say so plainly and open an issue for that gap instead of leaving the box implied. If the number is over 390, fix src/web/pages/settings.ts as box 2 says (wrap, no fixed widths, no nowrap).

Second: the Chromium measurement is the only test that can fail on an actual overflow, and it is skipped wherever Chromium does not start, which includes this sandbox. If the forge's check machine skips it too, the pull has no gate on its own claim. State in the description whether it ran in the check (the logged settings#move 390x844: {...} line), and if it did not, say it did not.

Third: the stylesheet test selects rules by regex over the concatenated CSS ('rulesFor'). It skips @media blocks (the pattern excludes '@' in selectors, and nested rules inside a media block can be mismatched), so a fixed width added inside a media query would pass. Either read the rules from the real computed layout or note the limit in the comment.

Preview answers 200 at / and the diff is a test only: no security, TUI, docs or dependency concerns. design-lint and the settings tests were reported green.

commented

Settings › Move to another owner fits a 390 px phone. The forge's check measured it in headless Chromium for head a9b8b2d86 (run 01m70zbkv38nfvbx377mbrprrg):

settings#move served 390x844: {"scrollWidth":390,"innerWidth":390,"scoped":10,"error":false,"overflowing":[]}
settings#move refused 390x844: {"scrollWidth":390,"innerWidth":390,"scoped":11,"error":true,"overflowing":[]}

scrollWidth is 390, which is ≤ 390, and no element of the section reaches past the right edge. Because of that, src/web/pages/settings.ts is unchanged.

What the first box asked for is not there: the preview look of /preview-admin/sample/settings#move. The check summary has no phone look for that page: GET …/pulls/10321/checks returns "looks": [], and so does #10272, the pull that added the look. The numbers above come from this pull's own test running in the check, on the same section rendered by the test's app (/olive/proj/settings#move), not the preview's sample page. I filed the missing look as #10336.

What changed: only test/settings-move-fit.test.ts.

  • Refused state: it POSTs a 64-character unknown owner to /olive/proj/settings/transfer, gets 422, and asserts the owner as typed and the class="error" refusal sentence are inside #move.
  • Stylesheet rules: it reads the rules in base, components and content for .field, .input, .form-actions, .settings-block and .muted. Rules inside @media, @supports, @container and @layer are now unwrapped and read too, and a self-test proves a width: 480px inside a media block is caught. It asserts none of these rules sets a width over 390 px or white-space: nowrap/pre. It also asserts .form-actions has flex-wrap: wrap and .field .error has overflow-wrap: anywhere.

- The limit, also stated in the header comment: this reads the CSS source text, not the computed layout.

  • Measured at 390×844: the page is measured twice, once as served and once with the refused section swapped in. Each time it asserts scrollWidth <= innerWidth and that nothing in #move passes the viewport. These are the only tests that fail on a real overflow. They are skipped where no Chromium starts, as in my sandbox, but they ran in the forge's check (the lines above).

Checks run locally:

  • bun scripts/gate.ts exited 0.
  • bun x tsc --noEmit exited 0.
  • bun scripts/design-lint.ts reported nothing added outside the system.
  • test/settings-move-fit.test.ts: 4 passed, 2 skipped (the Chromium tests).
  • test/repo-transfer-web.test.ts, test/settings.test.ts, test/settings-routes.test.ts and test/settings-visible.test.ts: 21 of 21 passed.

To try it: bun test test/settings-move-fit.test.ts. On a machine where Chromium starts, it prints the two settings#move … 390x844 lines.

🤖 Generated with Claude Code

Approved

Earlier asks: (1) quote the measured width: met as far as it can be. The description quotes scrollWidth 390 / innerWidth 390 from the check run on a9b8b2d86, and the missing preview look is filed as #10336. (2) A test that fails on a real overflow and drives the refusal sentence: met. It POSTs a 64-character owner and asserts the 422 sentence is inside #move. It reads the CSS rules including those inside media blocks, with a self-test. Chromium measures served and refused states at 390x844. (3) Run gate.ts and the other settings tests: met, both reported. The change is test-only, which is right because nothing overflows. Next two things: (a) once #10336 lands, quote the preview look of /preview-admin/sample/settings#move; (b) Non-blocking: add .btn to the width scan, so a fixed width on the button is also caught.

commented

Left #10320 open: 1 unticked item remain (The pull's description quotes the phone look of /preview-admin/sample/settings#move as recorded by the preview's check summary (size: scrollWidth vs innerWidth, carried since #9320), and scrollWidth is at most 390.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs