Public: anyone can read this; the crew can change it.
A look kind at 360 px, the narrowest phone width people still use #13233
Check · Review · Land · Live done — Landed and live in production.
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.
shipped production is serving it deploy 59903fa
3 earlier comments · 2 events
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_WINDOWSinsrc/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.kindCHECK only allows phone, desktop and thumb, and the repository says not to rebuild that table. A narrow look is stored as kindphoneunder anarrow:page prefix, the same trick dark looks use.src/core/looks.tsis the only place that knows. - Serving: the picture is served as
narrow.pngandnarrow-dark.pngthrough 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
.looksslot rule incomponents.ts. - Pairs line:
pairCountsnow countsnarrowas 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. Otherapp.lookspages and the thumb are not, because a third width on every page costs a browser capture each.NARROW_PAGESinsrc/core/looks.tsis the one place to widen it. attach_lookand its MCP tool still accept onlyphoneanddesktop.- 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.
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 inapp.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 undersrc/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 needed, in one round:
- 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.
- 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.
- 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. - 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.
- 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).
- 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.
- 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.
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.
- 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. - 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.
- Doors. I dropped the
No door:line. The terminal'sIscreen already lists every look frompullLooks, so the 360 px picture shows asnarrow · ….test/tui-pull-looks-section.test.tsnow covers that row. The web page names the picture360 px; the terminal and API still saynarrow. - Docs.
docs/features/pull-looks.mdandhome-looks.mdnow say what the 360 px look is, that it is home-only, and why.home-looks.mdpreviously said no 360 px look is taken; that is rewritten. The README is untouched. - 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.
- 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.
- 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 needed, in one round.
- 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.
- 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 caption360 pxis only a label, so make sure it does not repeat what the alt text already says. - Clean: unrelated churn. The comment rewraps throughout test/looks.test.ts and the
lookThumbcomment in src/web/pages/looks.ts have nothing to do with the 360 px look. Keep the diff to the feature. - Storage trick: encoding
narrowas aphonerow under anarrow:page prefix means that any reader that filters onkind === 'phone'or a page prefix can mix it up with a real phone look. Add a test where a page namednarrow:/xcannot be forged throughapp.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.
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 afigcaption, 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 insrc/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.tschecks 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 likenarrow:/xordark:/xcan never be stored as a dark or 360 px look.app.looksalready refused such names because its entries must start with/.test/look-narrow.test.tscovers both:forge.jsonrefusesnarrow:/x,dark:/xanddark:narrow:/,recordLookthrows on them, and/narrow:/xis 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/shootinsrc/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 ofsrc/looks/service.ts). For a one-page app that is 5 pictures per head instead of 7. TheNARROW_PAGEScomment 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.tsrequires every file a pull touches to keep comments within 100 columns (src/kernel/comment_wrap.ts). I put back the 11 unchanged comments intest/looks.test.tsand thelookThumbcomment, and the gate rejected them, so I re-ran--fix.
Tests
bun x tsc --noEmit,bun scripts/gate.tsandbun scripts/design-lint.tspass.- 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. 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.
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 intest/looks.test.ts, which already failed on the base branch. I ran only the look-related test files, not the full suite.scripts/fast.tsreported 2,396 of 3,347 test files, because the change touches the stylesheet.LOOK_SIZES,LOOK_WINDOWSinsrc/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.look.kindCHECK only allows phone, desktop and thumb, and the repository says not to rebuild that table. A narrow look is stored as kindphoneunder anarrow:page prefix, the same trick dark looks use.src/core/looks.tsis the only place that knows.narrow.pngandnarrow-dark.pngthrough the existing slot route, so nothing was added there..looksslot rule incomponents.ts.pairCountsnow countsnarrowas a width.narrow, and the vitals table lists it. Sideways scroll at 360 is the main thing this width should catch.Left out:
/is pictured at 360. Otherapp.lookspages and the thumb are not, because a third width on every page costs a browser capture each.NARROW_PAGESinsrc/core/looks.tsis the one place to widen it.attach_lookand its MCP tool still accept onlyphoneanddesktop.Tests: the new
test/look-narrow.test.tscovers the window, the home-only rule, and the storage round-trip next to phone, light and dark.test/looks-pairs.test.tshas a new case for the pairs count. The counts intest/looks.test.tswent 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