Repository navigation
Conversation
Lightbox no longer imports the pager statically: the pager is a runtime part it renders once the runtime has loaded. Until then the gallery's track rests on the current page by its insets, the buttons and the arrow keys page at once, and no drag pages. The looping index helpers move to hooks/pagerIndex.ts, so the date and time wheels read them without the pager. INV13 names the module and its gap line drops hooks/usePager.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 9b90405 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Lightbox's pager now comes with the shared touch runtime, matching INV13 and Lightbox FR7 as approved at this head. It relies on the loader and the AST-080 DEC-5 amendment from the pull requests it is stacked on, so it lands after them. Two non-blocking suggestions:
- Extend
.changeset/touch-runtime-after-first-paint.mdto mention Lightbox's before-load paging; changeset coverage asks for it once this targetsmain. - Drop the
export {mod, nearestLoopCopy}re-export inusePager.ts; nothing imports them from there any more.
Claims and files checked
- Claim: Lightbox no longer imports the pager statically and renders it once the runtime loads. Verified (
Lightbox.tsx, boundary test). - Claim: nothing changes after the load, and no API changes. Verified (the same slide in a browser; the generated API surface is unchanged).
- Claim: pages with a Lightbox ship less JavaScript in their first load, though the zoom code stays. Verified (four modules leave Lightbox's static graph).
- Claim: before the load, Next, Previous and the arrow keys page at once, with no drag or slide, as under a fine pointer today. Verified (new test, browser probe). The 2 s cap bounds when the load starts.
- Claim: once loaded, the pager takes the track from the page it rests on. Verified (browser probe; no jump).
- Claim: the track rests by logical insets, so right-to-left holds. Verified (right-to-left browser probe).
- Claim: the inset style and the pager's translate never stack. Verified (one render swaps them).
- Claim:
modandnearestLoopCopymove tohooks/pagerIndex.ts, andusePagerre-exports them. Verified; the re-export has no importer. - Claim: date and time fields no longer reach the pager. Verified (boundary test).
- Claim: both new tests fail on the base first. Verified.
- Claim: core typecheck and
check:knowledgepass. Verified. - Claim: the stack's suites pass. Verified for the suites this change touches; the stack-wide tally was not rerun.
- File
docs/architecture/react-component-runtime.md: clear - File
docs/specs/components/Lightbox/Lightbox.spec.md: clear - File
packages/core/src/DateInput/PickerWheel.tsx: clear - File
packages/core/src/Lightbox/Lightbox.test.tsx: clear - File
packages/core/src/Lightbox/Lightbox.tsx: clear - File
packages/core/src/hooks/pagerIndex.ts: clear - File
packages/core/src/hooks/usePager.ts: non-blocking (unused re-export) - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear - File
packages/core/src/utils/touchRuntimeModules.tsx: clear
| import {paging, registerPagingTable} from '../motion/uikit/paging'; | ||
| import {observeResize} from '../utils/sharedResizeObserver'; | ||
|
|
||
| export {mod, nearestLoopCopy}; |
There was a problem hiding this comment.
Non-blocking: nothing imports mod or nearestLoopCopy from usePager any more (PickerWheel now imports hooks/pagerIndex), and this statement sits between two imports. Consider deleting the re-export.
|
/approve-spec 2498ae9 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Lightbox's pager now comes with the shared touch runtime, matching INV13 and Lightbox FR7 as approved at this head. It relies on the loader and the AST-080 DEC-5 amendment from the pull requests it is stacked on, so it lands after them. Two non-blocking suggestions:
- Extend
.changeset/touch-runtime-after-first-paint.mdto mention Lightbox's before-load paging; changeset coverage asks for it once this targetsmain. - Drop the
export {mod, nearestLoopCopy}re-export inusePager.ts; nothing imports them from there any more.
Claims and files checked
- Claim: Lightbox no longer imports the pager statically and renders it once the runtime loads. Verified (
Lightbox.tsx, boundary test). - Claim: nothing changes after the load, and no API changes. Verified (the same slide in a browser; the generated API surface is unchanged).
- Claim: pages with a Lightbox ship less JavaScript in their first load, though the zoom code stays. Verified (four modules leave Lightbox's static graph).
- Claim: before the load, Next, Previous and the arrow keys page at once, with no drag or slide, as under a fine pointer today. Verified (new test, browser probe). The 2 s cap bounds when the load starts.
- Claim: once loaded, the pager takes the track from the page it rests on. Verified (browser probe; no jump).
- Claim: the track rests by logical insets, so right-to-left holds. Verified (right-to-left browser probe).
- Claim: the inset style and the pager's translate never stack. Verified (one render swaps them).
- Claim:
modandnearestLoopCopymove tohooks/pagerIndex.ts, andusePagerre-exports them. Verified; the re-export has no importer. - Claim: date and time fields no longer reach the pager. Verified (boundary test).
- Claim: both new tests fail on the base first. Verified.
- Claim: core typecheck and
check:knowledgepass. Verified. - Claim: the stack's suites pass. Verified for the suites this change touches; the stack-wide tally was not rerun.
- File
docs/architecture/react-component-runtime.md: clear - File
docs/specs/components/Lightbox/Lightbox.spec.md: clear - File
packages/core/src/DateInput/PickerWheel.tsx: clear - File
packages/core/src/Lightbox/Lightbox.test.tsx: clear - File
packages/core/src/Lightbox/Lightbox.tsx: clear - File
packages/core/src/hooks/pagerIndex.ts: clear - File
packages/core/src/hooks/usePager.ts: non-blocking (unused re-export) - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear - File
packages/core/src/utils/touchRuntimeModules.tsx: clear
|
/approve-spec 4f17dcb |
There was a problem hiding this comment.
Changes requested: one blocking issue in Lightbox's paging before the touch runtime loads. Every other delta matches INV13 and Lightbox FR7 as approved at this head.
- Miss: a photo zoomed and then left with Next, Previous or an arrow key before the touch runtime loads keeps its zoom off screen, because the
onSettlereset (Lightbox.tsx:1619-1629) now runs only onceLightboxPagermounts, so on a touch screen the first drag after the load slides that photo back in at 2×; run the same reset from the page-change callbacks while there is no pager, and add a test that holds the loader, zooms, presses Next, loads the runtime and expects the left photo's inlinetranslateandscalecleared.
This pull request builds on the loader and the AST-080 DEC-5 amendment from the pull requests it is stacked on, so it lands after them. Two optional cleanups: drop the unused export {mod, nearestLoopCopy} in usePager.ts (and point the wheelPhysics.ts:118 comment at hooks/pagerIndex.ts), and mention Lightbox's before-load paging in the touch-runtime changeset.
Claims and files checked
- Claim: Lightbox no longer imports the pager statically and renders it once the shared touch runtime loads. Verified (
Lightbox.tsx, boundary test fails on the base and passes here). - Claim: nothing changes after the load, and there is no API change. API verified unchanged (generated surface identical); "nothing changes after the load" is false for a photo zoomed and left before the load (the blocking finding).
- Claim: pages with a Lightbox download less JavaScript before first paint, while the zoom code stays. Verified for the pager (boundary test); the byte saving is not measured.
- Claim: before the load, Next, Previous and the arrow keys page at once, as under a fine pointer today, with no drag or slide. Verified (new test; touch browser capture).
- Claim: once loaded, the pager takes the track from the page it rests on. Verified (browser capture: no jump).
- Claim: the track rests by logical insets, so right-to-left holds. Verified (right-to-left browser capture matches the base).
- Claim: the inset style and the pager's translate never stack. Verified (one render swaps them).
- Claim:
modandnearestLoopCopymove tohooks/pagerIndex.tsandusePagerre-exports them. Verified; the re-export has no importer. - Claim: date and time fields no longer reach the pager, and no static path from the four entries reaches it. Verified (boundary test).
- Claim: both new tests fail first on the branch below. Verified (five cases fail on the base).
- Claim: the Lightbox suite loads the runtime before its tests. Verified (
Lightbox.test.tsx). - Claim: the touched suites pass. Verified (1,677 tests in 39 files); the stack-wide tally was not rerun.
- Claim: Core typecheck and the knowledge check pass. Verified.
- File
docs/architecture/react-component-runtime.md: clear - File
docs/specs/components/Lightbox/Lightbox.spec.md: clear - File
packages/core/src/DateInput/PickerWheel.tsx: clear - File
packages/core/src/Lightbox/Lightbox.test.tsx: clear (no test covers the zoom reset before the load) - File
packages/core/src/Lightbox/Lightbox.tsx: blocking (zoom reset for photos left before the load) - File
packages/core/src/hooks/pagerIndex.ts: clear - File
packages/core/src/hooks/usePager.ts: non-blocking (unused re-export) - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear - File
packages/core/src/utils/touchRuntimeModules.tsx: clear
| const pagerPart = | ||
| touchRuntime == null ? null : ( | ||
| <touchRuntime.LightboxPager {...pagerOptions} /> | ||
| ); |
There was a problem hiding this comment.
Blocking (missed in earlier reviews): the zoom reset in onSettle above (lines 1619-1629) now runs only once this part mounts, and a fresh pager reports no settle on attach. So on a touch screen, a photo zoomed and then left with Next before the runtime loads keeps translate/scale off screen, and the first drag after the load slides it back in still zoomed (it snaps to fit only when the drag settles). Run the same reset when the page changes without the pager, for example from goToPrev/goToNext and the arrow keys, or for the resting page when LightboxPager mounts, and add a test: zoom page 0, Next before the load, load the runtime, expect page 0's image to have no translate or scale.
|
/approve-spec cfc04c5 |
|
Decision: D-20261113-272 Records the owner's answer that the touch runtime loads once per page after first paint, never on demand, at cfc04c5. Until it loads, Lightbox pages by its buttons and arrow keys at once, with no drag or slide; this head adds only a test fix. It waives nothing. |
There was a problem hiding this comment.
Changes requested: one blocking issue in Lightbox's paging before the touch runtime loads. Every other change matches INV13 and Lightbox FR7 as approved at this head.
- Miss: a photo that is zoomed and then left with Next, Previous or an arrow key before the touch runtime loads keeps its zoom off screen, because the
onSettlereset (Lightbox.tsx:1619-1629) runs only onceLightboxPagermounts, so on a touch screen the first drag after the load slides that photo back in at 2×; while there is no pager, clear the left page'stranslateandscaleingoToPrevandgoToNext, and add a test that holds the loader, zooms, presses Next, loads the runtime and expects the left photo's inlinetranslateandscaleto be cleared.
There are also two non-blocking suggestions: delete or move the export {mod, nearestLoopCopy} re-export in usePager.ts, since nothing imports them from there and it sits between two imports, and mention Lightbox's paging before the load in .changeset/touch-runtime-after-first-paint.md before the stack reaches main.
Claims and files checked
- Claim: Lightbox no longer imports the pager statically. Verified: the import is type-only (
Lightbox.tsx:80), and a bundle of the Lightbox entry hasusePageronly in the runtime's dynamic chunk. - Claim: the pager renders as a touch-runtime part once the runtime has loaded. Verified (
Lightbox.tsx:1631-1634,touchRuntimeModules.tsx:153-161). - Claim: nothing changes after the load. False: see the blocking issue (a photo zoomed and left before the load comes back zoomed in Chromium).
- Claim: no API change. Verified: the API surface generator reports no added, changed or removed rows for Core or the themes.
- Claim: pages with a Lightbox download less JavaScript before first paint. Verified, but the saving is small: the zoom code still brings in the gesture recognizers and the animator.
- Claim: before the load, Previous, Next and the arrow keys page at once, with no drag and no slide. Verified: the new test fails on the base and passes here, and a Chromium probe shows the track resting by its insets.
- Claim: once the runtime loads, the pager takes the track from the page it rests on, and the inset style goes away in the same render. Verified (
Lightbox.tsx:2000; Chromium shows onlytranslateafter the load). - Claim: the pager renders after the content, so its nodes are attached first. Verified (
Lightbox.tsx:2215). - Claim: the resting insets are logical, so right-to-left holds. Verified (
Lightbox.tsx:610-618; a right-to-left probe rests where the base does). - Claim: the date and time fields no longer reach the pager. Verified: the four boundary tests fail on the base and pass here.
- Claim:
modandnearestLoopCopymove tohooks/pagerIndex.ts, andusePagerre-exports them. Verified. - Claim: INV13 names the new module and its gap line drops the pager. Verified.
- Claim: the Lightbox suite loads the runtime before its tests, and the touched suites, the core typecheck and the knowledge check pass. Verified.
- Changesets: this pull request adds none.
docs/architecture/react-component-runtime.md: clear.docs/specs/components/Lightbox/Lightbox.spec.md: clear.packages/core/src/DateInput/PickerWheel.tsx: clear.packages/core/src/Lightbox/Lightbox.test.tsx: clear (no case for a photo zoomed before the load).packages/core/src/Lightbox/Lightbox.tsx: blocking issue above.packages/core/src/hooks/pagerIndex.ts: clear.packages/core/src/hooks/usePager.ts: non-blocking suggestion above.packages/core/src/utils/touchRuntime.boundary.test.ts: clear.packages/core/src/utils/touchRuntimeModules.tsx: clear.scripts/snap-paging-bundle.test.mjs: clear.
# Conflicts: # packages/core/src/Lightbox/Lightbox.tsx
|
/approve-spec 32c05da |
There was a problem hiding this comment.
Changes requested: one blocking issue remains in Lightbox's paging before the touch runtime loads. An engineering owner has approved this head's record edits, which also settles the earlier point about hooks/pagerIndex.ts.
- Miss: a photo that is zoomed and then left with Next or Previous before the touch runtime loads keeps its 2× zoom off screen, so the first drag back after the load slides it in still zoomed (
Lightbox.tsx:1526-1536); while no pager is mounted, cleartranslateandscaleon the page being left ingoToPrev/goToNext, asonSettledoes, and add a test that zooms page 0, presses Next before the load, loads the runtime and expects page 0's photo to carry neither.
Non-blocking: the mod/nearestLoopCopy re-export in usePager.ts has no importer, a split build of a Lightbox-only page keeps its first-load gzip about flat (so the description could say the pager's code moves to the deferred chunk), and the stack's touch-runtime changeset does not mention Lightbox's paging before the load.
Claims and files checked
- Claim: Lightbox no longer imports the pager statically and renders it once the shared loader has loaded the touch runtime. Verified (
Lightbox.tsx:77-78,:1494-1541,:2084;touchRuntimeModules.tsx:158-168; boundary test). - Claim: nothing changes after the load. False: a photo zoomed and left before the load stays zoomed after it (unit probe).
- Claim: there is no API change. Verified (built API surfaces of Core and the themes: no rows).
- Claim: pages with a Lightbox download less JavaScript before first paint. Partly verified: the pager's code leaves Lightbox's first load, but the first-load gzip of a Lightbox-only split build stays flat.
- Claim: Lightbox still carries its zoom code until a later change. Verified (
useZoomCoreanduseZoomStagestay static; the architecture record's gap line lists them). - Claim: before the load, Next, Previous and the arrow keys page at once with no drag or slide, as under a fine pointer. Verified (new Lightbox test;
Lightbox.tsx:1505-1509apply only through the pager). - Claim: once the runtime loads, the pager takes the track from the page it rests on. Verified (probe: the track moves from insets to
translateat the same page). - Claim: the date and time fields no longer reach the pager. Verified (boundary tests for DateInput, TimeInput and DateTimeInput;
PickerWheel.tsx:47). - Claim: the pager part renders after the content, so its nodes are attached when it attaches. Verified (
Lightbox.tsx:2084). - Claim: the resting track uses logical insets with the pages' stride, so right-to-left holds, and the inset style goes away in the render that mounts the pager. Verified (
Lightbox.tsx:578-583,:1538-1541,:1886). - Claim: the index helpers hold no motion code, move to a small module, and the pager re-exports them. Verified (
pagerIndex.ts;usePager.ts:24,:54). - Claim: the architecture record drops the pager from its gap list and names the new module, under the runtime and stylesheet records as amended lower in the stack. Verified at this head, with an engineering owner's approval for this head.
- Claim: the new boundary and Lightbox tests fail before this change. Verified (5 fail on the base).
- Claim: the Lightbox suite loads the runtime before its tests. Verified (
Lightbox.test.tsx:28-30). - Claim: the named suites, Core typecheck and the knowledge check pass. Verified (40 files, 1,780 tests; typecheck and knowledge check exit 0).
- Claim: public text holds no internal context. Verified.
- File
docs/architecture/react-component-runtime.md: clear (approved at this head). - File
docs/specs/components/Lightbox/Lightbox.spec.md: clear (approved at this head). - File
packages/core/src/DateInput/PickerWheel.tsx: clear. - File
packages/core/src/Lightbox/Lightbox.test.tsx: clear. - File
packages/core/src/Lightbox/Lightbox.tsx: blocking zoom reset. - File
packages/core/src/hooks/pagerIndex.ts: clear (named by the approved record). - File
packages/core/src/hooks/usePager.ts: non-blocking unused re-export. - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File
packages/core/src/utils/touchRuntimeModules.tsx: clear. - File
scripts/snap-paging-bundle.test.mjs: clear.
# Conflicts: # docs/architecture/react-component-runtime.md
|
/approve-spec 24e8eb3 |
There was a problem hiding this comment.
Changes requested: one touch-only defect in Lightbox's paging before the touch runtime loads needs fixing.
- Miss: a photo that is zoomed and then left with Next or Previous before the touch runtime loads keeps its 2× zoom off screen, so the first drag back after the load slides it in still zoomed (
Lightbox.tsx:1526-1536); while no pager is mounted, cleartranslateandscaleon the page being left ingoToPrev/goToNext, asonSettledoes, and add a test that zooms page 0, presses Next before the load, loads the runtime and expects page 0's photo to carry neither.
The earlier finding about the smaller-download claim is withdrawn: measured the way the repository's size report measures an import, a Lightbox-only page's first-load JavaScript drops from 148,726 B to 148,308 B gzip. The architecture:react-component-runtime INV13 and component:Lightbox FR7 edits are approved by an engineering owner at this head, and that approval also names hooks/pagerIndex.ts, so no spec decision is pending. Non-blocking: the mod/nearestLoopCopy re-export in usePager.ts has no importer, and the stack's touch-runtime changeset does not mention Lightbox's paging before the load.
Claims and files checked
Review mode: same-head; reason: none
- Claim: Lightbox no longer imports the pager statically and renders it once the shared loader has loaded the touch runtime. Verified (
Lightbox.tsx:77-78,:1494-1541,:2084;touchRuntimeModules.tsx:153-168; boundary test). - Claim: the change is neither a bug fix nor a feature, and nothing changes after the load. False: a photo zoomed and left before the load stays zoomed after it (unit probe; phone-emulation capture).
- Claim: there is no API change. Verified (no new export, prop, data attribute or event; the built API surfaces show no rows).
- Claim: people loading a page with a Lightbox download less JavaScript before first paint. Verified: a Lightbox-only page's first-load JavaScript drops from 148,726 B to 148,308 B gzip under the repository's size-report measure.
- Claim: Lightbox still carries its zoom code until a later change. Verified (
useZoomCoreanduseZoomStagestay static; the architecture record's gap line lists them). - Claim: before the load, Next, Previous and the arrow keys page at once with no drag or slide, as under a fine pointer. Verified (new Lightbox test; phone-emulation receipt;
Lightbox.tsx:1505-1509apply only through the pager). - Claim: once the runtime loads, the pager takes the track from the page it rests on. Verified (capture receipt: the track moves from its inset to
translateat the same page). - Claim: the date and time fields no longer reach the pager. Verified (boundary tests for DateInput, TimeInput and DateTimeInput;
PickerWheel.tsx:47). - Claim: the pager part renders after the content, so its nodes are attached when it attaches. Verified (
Lightbox.tsx:2084). - Claim: the resting track uses logical insets with the pages' stride, so right-to-left holds, and the inset style goes away in the render that mounts the pager. Verified (
Lightbox.tsx:578-583,:1538-1541,:1886). - Claim: the index helpers hold no motion code, move to a small module, and the pager re-exports them. Verified (
pagerIndex.ts;usePager.ts:24,:54). - Claim: the architecture record drops the pager from its gap list and names the new module. Verified in the text; approved by an engineering owner at this head.
- Claim: no static path from the Lightbox, DateInput, TimeInput or DateTimeInput entries reaches the pager. Verified (boundary tests).
- Claim: the new boundary and Lightbox tests fail before this change. Verified (5 fail on the base).
- Claim: the Lightbox suite loads the runtime before its tests. Verified (
Lightbox.test.tsx:28-30). - Claim: the named suites, Core typecheck and the knowledge check pass. Verified (40 files, 1,779 tests; typecheck and the knowledge check pass).
- Claim: the record is written in the present tense. Verified (the INV13 and FR7 additions).
- Claim: public text holds no internal context. Verified.
- File
docs/architecture/react-component-runtime.md: clear (approved by an engineering owner at this head). - File
docs/specs/components/Lightbox/Lightbox.spec.md: clear (approved by an engineering owner at this head). - File
packages/core/src/DateInput/PickerWheel.tsx: clear. - File
packages/core/src/Lightbox/Lightbox.test.tsx: clear. - File
packages/core/src/Lightbox/Lightbox.tsx: blocking zoom reset. - File
packages/core/src/hooks/pagerIndex.ts: clear (the approved record names it). - File
packages/core/src/hooks/usePager.ts: non-blocking unused re-export. - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File
packages/core/src/utils/touchRuntimeModules.tsx: clear. - File
scripts/snap-paging-bundle.test.mjs: clear.
Primary intent
Performance, stacked on #11466 (then #11463 and #11450): Lightbox stops importing the pager (
hooks/usePager, which builds on the animator and the gesture host) statically. It renders the pager as a touch-runtime part once the shared loader has loaded the runtime. It is not a bug fix or a feature: nothing changes after the load, and there's no API change.User or maintainer impact
Problem and solution fit
Lightbox.tsxcalledusePager, so every page with a Lightbox shipped the pager, the animator and the gesture host.LightboxPager, which calls the unchanged hook. Lightbox renders it after its content, so the viewport's and track's nodes are attached when it attaches.insetInlineStart/insetInlineEnd, so RTL holds) set fromindex. That's the same stride the pages use (100% + the page gap). The pager moves the track bytranslateonce it mounts, and the inset style goes away in the same render, so the two never stack.modandnearestLoopCopyhold no motion code. They move tohooks/pagerIndex.ts(INV13 names why), andusePagerre-exports them.Authority
architecture:react-component-runtimeINV13 andspec:AST-080DEC-5, as amended in #11450 (with the per-component clarification). INV13's gap line dropshooks/usePager, and the record nameshooks/pagerIndex.ts.Change and evidence
Lightbox/Lightbox.tsx,hooks/pagerIndex.ts(new),hooks/usePager.ts,DateInput/PickerWheel.tsx,utils/touchRuntimeModules.tsx, plus INV13.hooks/usePager.Scope
Components: Lightbox, hooks/usePager, DateInput (PickerWheel import only)
Testing
Red first, each failing on #11466's head:
utils/touchRuntime.boundary.test.ts: the Lightbox, DateInput, TimeInput and DateTimeInput entries reach no pager statically.Lightbox.test.tsx: "pages at once by its button before the touch runtime loads, the track resting on the page".Also:
Lightbox.test.tsxloads the runtime inbeforeAll.check:knowledgepass.Writing rubric results
Owner and land path
Owner: the Astryx fix loop, lane 3. Lands after #8690 merges, in stack order (#11450, #11463, #11466, #11476, #11478, #11508, #11518, #11525, #11530, #11536, #11540, #11544), each after Specs, CodeBunny at its head and green CI; the drain merges.