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

A look kind at 360 px, the narrowest phone width people still use #13233

Merged opened this

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

Merged

I added a 360 px look kind (narrow) for the home page, light and dark. The look lane takes it the same way it takes phone and desktop, and the pull's pairs line counts it. Nothing was captured in this sandbox.

Notes

shipped production is serving it deploy 59903fa

opened this

I added a 360 px look kind (narrow) for the home page, light and dark. The look lane takes it the same way it takes phone and desktop, and the pull's pairs line counts it. Nothing was captured in this sandbox. The tests I ran pass, except the real-Chromium capture test in test/looks.test.ts, which already failed on the base branch. I ran only the look-related test files, not the full suite. scripts/fast.ts reported 2,396 of 3,347 test files, because the change touches the stylesheet.

  • Size and capture: the window is 360×780 (LOOK_SIZES, LOOK_WINDOWS in src/core/looks.ts). The look lane captures it with the other home-page kinds, so a green deploy now gives the home page a 360 picture in both themes.
  • Storage: the look.kind CHECK only allows phone, desktop and thumb, and the repository says not to rebuild that table. A narrow look is stored as kind phone under a narrow: page prefix, the same trick dark looks use. src/core/looks.ts is the only place that knows.
  • Serving: the picture is served as narrow.png and narrow-dark.png through the existing slot route, so nothing was added there.
  • Pull page: the Look block shows the 360 picture beside the phone one, light and dark, with a .looks slot rule in components.ts.
  • Pairs line: pairCounts now counts narrow as a width.
  • Vitals: the "scrolls sideways" check now covers narrow, and the vitals table lists it. Sideways scroll at 360 is the main thing this width should catch.

Left out:

  • Only / is pictured at 360. Other app.looks pages and the thumb are not, because a third width on every page costs a browser capture each. NARROW_PAGES in src/core/looks.ts is the one place to widen it.
  • attach_look and its MCP tool still accept only phone and desktop.
  • Main's pictures taken before this change have no 360 version, so a pull's 360 picture shows alone until main is retaken.
  • The crew reviewer's pictures are still phone and desktop only.

Tests: the new test/look-narrow.test.ts covers the window, the home-only rule, and the storage round-trip next to phone, light and dark. test/looks-pairs.test.ts has a new case for the pairs count. The counts in test/looks.test.ts went up by one per home page (phone, desktop and thumb became four kinds, dark four became five).

To try it: open a pull whose preview is green. Its Look block shows 185 px-wide 360 pictures next to the phone ones, and "In the dark" has them too.

Closes #13229

3 earlier comments · 2 events
commented

I added a 360 px look kind (narrow) for the home page, light and dark. The look lane takes it the same way it takes phone and desktop, and the pull's pairs line counts it. Nothing was captured in this sandbox. The tests I ran pass, except the real-Chromium capture test in test/looks.test.ts, which already failed on the base branch. I ran only the look-related test files, not the full suite. scripts/fast.ts reported 2,396 of 3,347 test files, because the change touches the stylesheet.

  • Size and capture: the window is 360×780 (LOOK_SIZES, LOOK_WINDOWS in src/core/looks.ts). The look lane captures it with the other home-page kinds, so a green deploy now gives the home page a 360 picture in both themes.
  • Storage: the look.kind CHECK only allows phone, desktop and thumb, and the repository says not to rebuild that table. A narrow look is stored as kind phone under a narrow: page prefix, the same trick dark looks use. src/core/looks.ts is the only place that knows.
  • Serving: the picture is served as narrow.png and narrow-dark.png through the existing slot route, so nothing was added there.
  • Pull page: the Look block shows the 360 picture beside the phone one, light and dark, with a .looks slot rule in components.ts.
  • Pairs line: pairCounts now counts narrow as a width.
  • Vitals: the "scrolls sideways" check now covers narrow, and the vitals table lists it. Sideways scroll at 360 is the main thing this width should catch.

Left out:

  • Only / is pictured at 360. Other app.looks pages and the thumb are not, because a third width on every page costs a browser capture each. NARROW_PAGES in src/core/looks.ts is the one place to widen it.
  • attach_look and its MCP tool still accept only phone and desktop.
  • Main's pictures taken before this change have no 360 version, so a pull's 360 picture shows alone until main is retaken.
  • The crew reviewer's pictures are still phone and desktop only.

Tests: the new test/look-narrow.test.ts covers the window, the home-only rule, and the storage round-trip next to phone, light and dark. test/looks-pairs.test.ts has a new case for the pairs count. The counts in test/looks.test.ts went up by one per home page (phone, desktop and thumb became four kinds, dark four became five).

To try it: open a pull whose preview is green. Its Look block shows 185 px-wide 360 pictures next to the phone ones, and "In the dark" has them too.

commented

The two failing gate rules should now pass: I added the missing commit-message lines and pushed. No code changed. I did not run tsc or the tests, since the failing step was only the gate. bun scripts/gate.ts printed nothing, so I assume it passes locally, but I haven't seen the forge's check run.

The new commit, 31efed044, carries two lines:

  • Looks: /: names the home page, which is already in app.looks, so the forge takes the before/after pictures of it. The 360 px kind is one of those pictures.
  • No door:: says the edit only adds a 360 px picture label to the web Look block, and the terminal shows no pictures. Nothing under src/tui/ changed.

To try it, open the pull's preview at https://lab--13233--forge-trevato-apps.open-platform.sh and look in its Look block for the 360 px picture beside the phone one, light and dark.

Changes requested — before the latest push

Changes needed, in one round:

  1. Direction: this is a looks feature, not a pipeline item. It also adds a fourth browser capture per green deploy (home, light and dark), which makes every deploy slower and the look lane heavier. The repo says pipeline first, so this should wait, or say why it costs nothing.
  2. Preview: the preview answers 502 on / at this head, so I could not see the 360 px picture working. Get it up and confirm the Look block at 360 px with JavaScript off.
  3. Both doors: nothing in src/tui/ shows the 360 picture. A No door: line in the commit message does not meet the rule. Add the terminal screen, or show that the terminal shows no pictures at all.
  4. Docs: there is no docs/features update. docs/features/pull-looks.md and home-looks.md should say what the 360 px look is and that it is home-only. Do not put it in the README.
  5. Clean: unrelated churn. The comments in test/looks.test.ts were rewrapped, and the lookThumb comment in src/web/pages/looks.ts was rewrapped. Revert those hunks. Comments in the looks tests that say three looks are now stale (for example, a preview is pictured at three widths).
  6. Design: the fixed 185px slot in components.ts is a hand-rolled width and the third look sits in the 640px column rule. Check that two pictures plus a third do not scroll sideways at 360 px. A caption for the 360 picture, plain and without explaining itself twice, should name it.
  7. Tests: tests that need an unavailable browser may fail. The one real-Chromium test already failed on base, so say so plainly in the description.
commented

Pushed f90e5e23c. I have not seen it work: the preview still answers 502 on / (it was still 502 right after the push, so the new head may not have deployed yet). Nothing here shows whether the 502 comes from this pull or from the preview itself.

  1. Direction and cost. I'm keeping this, and I disagree with "wait". The 360 px look is taken for the home page only (NARROW_PAGES), so it adds two browser captures per green deploy, home in light and dark, not a fourth capture across every page. I did not measure how much slower that makes a deploy. Whether it should wait for pipeline work is yours to call.
  2. Preview. I couldn't get it up from here. I also can't look at it with JavaScript off. The Look block is server-rendered, so no script is involved, but that is not a check.
  3. Doors. I dropped the No door: line. The terminal's I screen already lists every look from pullLooks, so the 360 px picture shows as narrow · …. test/tui-pull-looks-section.test.ts now covers that row. The web page names the picture 360 px; the terminal and API still say narrow.
  4. Docs. docs/features/pull-looks.md and home-looks.md now say what the 360 px look is, that it is home-only, and why. home-looks.md previously said no 360 px look is taken; that is rewritten. The README is untouched.
  5. Churn.

- Stale comments: reverted by hand (restored from main) wherever the file allowed it. I fixed the "three looks" comments and counts that went stale. - Not reverted: the comment rewraps in test/looks.test.ts and the lookThumb comment in src/web/pages/looks.ts. The gate's "comments are wrapped at 100 columns" rule fails on any touched file with a long comment line, and gate --fix rewraps them. I'm keeping them to keep the gate green.

  1. Design.

- Width: the slot is now calc(200px * 360 / 390), the phone picture's scale, instead of a bare 185px. - Caption: the 360 picture sits in a <figure> with the caption 360 px, and the test checks it appears for the home page and not for /board. - Sideways scroll: not checked in a browser. The strip wraps, and below 640px it stacks in a column.

  1. Tests.

- Passing: tsc, the gate and design-lint are clean. test/looks.test.ts passes except for the real-Chromium test, which also fails on base. The narrow, pairs, pull-looks and terminal looks tests pass. - Not run: the full fast tier — fast.ts named 2396 of 3347 files, so I ran only the files that cover this change.

Changes requested — before the latest push

Changes needed, in one round.

  1. Direction (first): the repo says PIPELINE FIRST, and this is a looks feature that adds two more browser captures per green deploy (home, light and dark), so every deploy and the look lane get heavier. Nothing in the pull measures that cost or shows it is free. Hold it until the pipeline items land, or show the capture cost is negligible.
  2. Design: the 360 picture is a hand-rolled calc(200px * 360 / 390) slot with its own figure and caption markup. Use the existing figure/caption pattern in .looks, and no new width rule. Principle 1: the caption 360 px is only a label, so make sure it does not repeat what the alt text already says.
  3. Clean: unrelated churn. The comment rewraps throughout test/looks.test.ts and the lookThumb comment in src/web/pages/looks.ts have nothing to do with the 360 px look. Keep the diff to the feature.
  4. Storage trick: encoding narrow as a phone row under a narrow: page prefix means that any reader that filters on kind === 'phone' or a page prefix can mix it up with a real phone look. Add a test where a page named narrow:/x cannot be forged through app.looks, or reject that prefix at the boundary.

Preview answers 200 and the tests for the kind, pairs and terminal row are present. The real-Chromium test fails on base; say so plainly in the description.

commented

This adds a 360 px look kind for the home page, taken light and dark. The pairs line counts it, a narrow look that scrolls sideways is reported in the check summary like a phone look, and the terminal's pull view shows the 360 px row.

What changed after review

  • Markup: the 360 px picture is now a <figure data-slot="phone"> with a figcaption, the same pattern the attached looks use in .looks. It sits in the phone's slot and takes its 200 px rule, so there is no new CSS in src/web/style/components.ts. The alt text now reads "… on a narrow phone" and the caption "360 px", so neither repeats the other. test/looks.test.ts checks the slot, the caption, and that "360 px" appears nowhere in an alt.
  • Storage prefixes: recordLook (src/core/looks.ts) now refuses any page that is not a path, so a name like narrow:/x or dark:/x can never be stored as a dark or 360 px look. app.looks already refused such names because its entries must start with /. test/look-narrow.test.ts covers both: forge.json refuses narrow:/x, dark:/x and dark:narrow:/, recordLook throws on them, and /narrow:/x is stored as an ordinary phone look of that page.
  • Cost: this is two more captures per green head, light and dark, on / only. I could not time them: Chromium cannot start in the agent sandbox because it needs a unix socket. From the code, each capture borrows the host's already-running browser and opens a fresh context in it (borrow/shoot in src/looks/capture.ts). So the cost is two page loads with a 400 ms settle each, not two browser launches. Looks run after the deploy is serving and never block a check or a deploy (header of src/looks/service.ts). For a one-page app that is 5 pictures per head instead of 7. The NARROW_PAGES comment wrongly said "a browser launch each" and now says what actually happens. Holding this pull for the pipeline-first items is the owner's call to make.

Not done

  • The comment rewraps the review called churn are still in: bun scripts/gate.ts requires every file a pull touches to keep comments within 100 columns (src/kernel/comment_wrap.ts). I put back the 11 unchanged comments in test/looks.test.ts and the lookThumb comment, and the gate rejected them, so I re-ran --fix.

Tests

  • bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts pass.
  • The look-narrow, looks, pairs, language, terminal-section and manifest tests give 38 pass, 1 fail. The 15 other look suites (pull, main, owner, attach, preview, check-looks and others) all pass, 82 tests.
  • The one failure is the real-Chromium capture in test/looks.test.ts. It fails on base too, because Chromium cannot open its unix socket in the sandbox; the forge's check runs it.

To try it: open a pull whose preview is green; its Look block shows the 360 px picture beside the phone one, captioned "360 px".

🤖 Generated with Claude Code

Approved

Approved. Earlier asks: (2) design — met: the 360 px picture is a figure/figcaption in the phone slot, no new width rule, alt says "narrow phone" and the caption "360 px", so nothing repeats. (4) storage prefix — met: recordLook refuses non-path pages, app.looks refuses the prefixes, and look-narrow.test.ts covers both. (3) churn — the comment rewraps remain, but the gate requires them on touched files; accepted. (1) direction — the cost is two page loads on / only, reusing the warm browser, and never blocks a deploy; I accept it, though it is still not a pipeline item. The preview answers 200. The real-Chromium capture test fails on base too. Next two things: Non-blocking: widen NARROW_PAGES only if a 360 px overflow shows up on another page. Non-blocking: retake main's pictures so the 360 px look has a pair to compare against.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs