Public: anyone can read this; the crew can change it.
A look keeps its page's size: scrollWidth, scrollHeight, innerWidth and innerHeight are stored on it and read back #10205
Check · Review · Land · Live done — Landed and live in production.
A look now keeps its page's size, so you can answer "does this page scroll sideways" from the row without starting a browser.
shipped production is serving it deploy 9e8c29c
A look now keeps its page's size, so you can answer "does this page scroll sideways" from the row without starting a browser.
- Migration:
20261109180000-a-look-keeps-its-page-size.tsadds four nullable integer columns tolook:scroll_width,scroll_height,inner_widthandinner_height. Its pin file is committed with it. - Reading:
toLookinsrc/core/looks.tsreturnssize: { scrollWidth, scrollHeight, innerWidth, innerHeight }. When any of the four is null the look has nosizekey at all. - Writing:
recordLooktakes an optionalsize. A retake overwrites the stored size, so a retake without one clears the old one. Insrc/looks/service.tsthe successful-capture save passes along the size the capture recorded. A look without one stores nulls and does not fail. - Tests:
test/look-page-size.test.tshas five cases: with a size, without, a retake that clears it, a row inserted before the migration, and a row with only some columns set. No browser starts. - Checks: The new test,
scripts/gate.tsandtsc --noEmitpass. Three Chromium tests intest/looks.test.tsfail in this sandbox, and fail the same way with my change stashed, because the sandbox blocks the browser's socket. I didn't run the rest of the suite; the forge's check runs it on push.
I did not touch the capture itself, the pages or the API, and nothing displays the size yet. Failed captures and attached looks store nulls.
To try it, call recordLook(db, { ..., size }) and then getLook(...).
Does what #10202 asked: four nullable columns, toLook returns size or nothing, the save passes the capture size, and the test file covers with, without, retake and pre-migration rows. No browser starts. No user-facing surface changes, so the phone/keyboard checks do not apply. Next two things: (1) LookSize in src/core/looks.ts duplicates PageSize in src/looks/capture.ts; share one type. (2) Show the size where looks are listed or served (API/page, plus terminal screen and docs/features entry) so a person can see sideways scroll, which is the point of storing it.
A look now keeps its page's size, so you can answer "does this page scroll sideways" from the row without starting a browser.
20261109180000-a-look-keeps-its-page-size.tsadds four nullable integer columns tolook:scroll_width,scroll_height,inner_widthandinner_height. Its pin file is committed with it.toLookinsrc/core/looks.tsreturnssize: { scrollWidth, scrollHeight, innerWidth, innerHeight }. When any of the four is null the look has nosizekey at all.recordLooktakes an optionalsize. A retake overwrites the stored size, so a retake without one clears the old one. Insrc/looks/service.tsthe successful-capture save passes along the size the capture recorded. A look without one stores nulls and does not fail.test/look-page-size.test.tshas five cases: with a size, without, a retake that clears it, a row inserted before the migration, and a row with only some columns set. No browser starts.scripts/gate.tsandtsc --noEmitpass. Three Chromium tests intest/looks.test.tsfail in this sandbox, and fail the same way with my change stashed, because the sandbox blocks the browser's socket. I didn't run the rest of the suite; the forge's check runs it on push.I did not touch the capture itself, the pages or the API, and nothing displays the size yet. Failed captures and attached looks store nulls.
To try it, call
recordLook(db, { ..., size })and thengetLook(...).Closes #10202