Skip to content

fix(core): a resize during a pager's settle keeps where it was heading - #10592

Merged
cixzhang merged 11 commits into
meta:mainfrom
vjeux:pager-settle-resize-retarget
Nov 12, 2026
Merged

cixzhang merged 11 commits into
meta:mainfrom
vjeux:pager-settle-resize-retarget

Conversation

@vjeux

@vjeux vjeux commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #10592 → #10927

User impact

A pager resized mid-settle jumps or rests off its page. Narrowed 100 px, a three-per-view Carousel row ran back to the view it left. A partial last page rested 60 px short.

Problem and solution fit

  • Why? A resize stops the settle and sets the track on its index's new offset, which a renumbering makes another page.
  • Why does it harm the task? The row jumps, reverses, or stops short.
  • Why does it matter? A paging scroll view keeps heading where it was sent.

The settle now retargets, keeping its velocity.

Expected behavior and authority

spec:AST-094 FR6: "A new target MUST keep the current velocity". Amended here: "A resize during a settle retargets it. When the spacings between pages all scale by one ratio, the settle keeps its page and its fraction of a page. Otherwise a settle toward the last page ends on the last page. Any other ends on the page nearest its target's offset, a tie going the way it moves. A settle that began before the viewport had a width lands on its target at once when the viewport gets one". A resize row and a gap bullet cover the settles that land at once. component:Carousel FR7: "the last page rests where the row ends".

UIKit decays toward the old target (iOS 26.2 simulator); FR6 and FR7 require the new pages.

Smallest restoration

  • Pages whose spacings all scale by one ratio keep their numbers, and the settle its fraction of a page.
  • Otherwise measure() maps a settle's target and the page last at rest by offset. The last page stays last; a tie goes the way the settle moves.
  • A resize mid-settle replays it from the track's value and velocity, read before measuring. A new writing direction, a track left past the new last page, or a settle begun with no width still re-places at once.
  • A renumbered page is not reported back; a release's waiting report and a finger's waiting catch carry over. A finished settle rests on its curve's end.

Evidence

  • Reproduction before the change: NOT-FOR-LANDING arms run these tests on main (e4339dc) and without SnapPaging's held-stop fix (1bd244f); both fail.
  • Result after the change: every case passes.
  • Unchanged path: settles with no resize are frame-identical to main's.
  • Mutation-sensitive proof: twenty-three NOT-FOR-LANDING commits (Testing).

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • This head (d8497d4) merges main (4ae4d23) into b2c11d6, with no conflict. Main's new spec:AST-094 lines sit apart from this change's, which are as they were. On it, LightboxDismiss's reopening case passes 10 of 10 in Chromium, and the widening case 10 of 10 in WebKit through the CI job's container. Every Lightbox, Carousel, SnapPaging, DateInput and TimeInput interaction spec passes in both engines at 1 worker. Chromium passes Lightbox 103, Carousel 8, SnapPaging's set 80 and the wheels 32. WebKit passes 98, 7, 84 and 27. Their units pass, 26 files and 1,122 tests. Core tsc, strict ESLint and check:knowledge are clean.
  • b2c11d6 merged main (d084760) into 8d84381, with no conflict.
  • 8d84381 changes only the widening case, on b01724f. A CI run (43121987614) failed it in WebKit: 14 frames from the widening to the rest.
    • The case flicked the row a page back and widened it two frames into the settle. On a slow frame the row had already reached where the widened row ends.
    • The pager then read the row inside the new range, so FR6's other branch played the settle on at its velocity. The product was right; the case's setup was not.
    • A short drag held still now settles the row back onto its last page. The widening then leaves it 101 to 112 px past the new last page.
    • The case also waits for a frame at rest before it reads the frames, with the file's 5 s poll. No bound changes.
  • WebKit ran through the CI job's container, at 4 CPUs and 1 worker. Before the fix, the case failed 4 of 100, and 59 of 100 with two busy loops on its CPUs. With the fix it passes 100 of 100 in both.
  • An arm that always plays the settle on (a66540c) fails the fixed case: WebKit 0 of 5, Chromium 0 of 3.
  • The narrowing case, "a narrowing while the row settles toward the last view…", still covers FR6's other branch. There the settle heads on at its velocity.
  • b01724f merged main (a709f9a) into 6e069a3, with no conflict.
  • 6e069a3 merged main (1ab2116) into e1f66f1. One hunk conflicted: main now exports mod, and the pager's new helpers stay above it.
  • e1f66f1 merged main (18af3dc) into bb6aec9, with no conflict. Repository CI passed every job at it.
  • bb6aec9 words a settle begun with no width into FR6's text, its gap bullet, the resize row, the changeset and a comment. The pager's doc now names the silent renumber under a controlled index. It changes no code line. On it, usePager's units pass 161 of 161. Core tsc, strict ESLint, Prettier, check:knowledge and check:changesets are clean.
  • Its parent, bce5f05, is a fix on a merge of main (2569989) into 33f98f6, which the rest of this list names. The merge leaves this change's own diff as it was. The runs below ran on the parent.
  • The fix: a gallery opens with an animated move to the tapped photo, begun before its viewport has a width. Its first layout then resized the pager mid-settle, and this change played the settle on from the first photo. The pager was still settling when a pull-down came, so its catch took the touch. LightboxDismiss's reopening case ran at 1 worker in Chromium, with builds alternating. Main passes 20 of 20, the merge without the fix 12 of 20, and this head 20 of 20. In WebKit main and this head pass 10 of 10.
  • On the parent, core tsc reports 0, and the full ui unit project passes: 975 files, 24,075 tests. At 1 worker, every Lightbox interaction spec passes in both engines, as on main: Chromium 103, WebKit 98. Carousel passes too: Chromium 8, WebKit 7. SnapPaging, its settle and the pager ×3: Chromium 240 passed, WebKit 252. The row-sized case passes 30 of 30 in WebKit. Strict ESLint reports 0.
  • core tsc 0; strict ESLint 0 and Prettier clean on the changed files; comment sentence lengths 0 over on the changed lines; check:changesets passes; check:knowledge reports the records aligned.
  • On this head (6b0a3f2), usePager.test.ts passes 160 of 160. On main 16 of the 22 new cases fail. The other six guard this change's earlier heads, or keep main's behavior: the two writing-direction cases and the past-end case. The unit suites of Carousel, SnapPaging, Lightbox, hooks, gestures and motion: 138 files, 3,208 tests pass.
  • The browser runs ran at 1 worker: Chromium on two pinned cores, WebKit on the CI WebKit job's command. The pager code of d167b64 differs from this head's only in two comments. Its build passes the split, three-up, row-sized and past-end cases, 5 of 5 per case in each engine. The full set below ran on builds of 00ed0cf and its mutants, before the rebase onto main. Their pager and SnapPaging code matches this head's except those two comments, and the merge touched none of their imports.
  • Pages sized to the row (four child pages as wide as the viewport): a widening (300 to 450 px) and a narrowing (400 to 300 px) during a settle toward page 2 end on page 2 at its new offset. One frame on, the row moves at most 1.5 times the step before, in pages. Mapped by offset, the settle rested on page 1 and on page 3; main jumps to page 2 at once (0.85 pages against 0.09).
  • Stops read from a moving row can share a shift (0.56 px seen in Chromium). The scale is fitted on the spacings between pages. So offsets [0, 300, 600, 900, 1200] widened to [0.56, 450.56, 900.56, 1350.08, 1800] keep page 2; a fit on the offsets themselves rests on page 1.
  • A still finger on a release's settle still catches it 85 ms after it lands when a resize retargets the settle in between; with the catch dropped, the new settle slides on under the finger.
  • A writing-direction change during a settle stops it and re-places the track on its target, as on main: a uniform pager 124 ms into a settle toward page 2 sits on +800 px at once. Retargeted instead, the track ran on and then swept 1,165 px across the row. A settle back to the page it left still ends there, and its onSettle fires once.
  • A measurement that re-places the track mid-settle, as a held row's re-placement does, leaves the retarget its velocity: the track is read before the pages. Read after them, the new settle starts from rest.
  • A settle whose engine finishes a frame before the pager's clock reaches the curve's end rests exactly on that end, −800 px; without the last step it rests at −794.33 px, as main does.
  • A widening that leaves a settling track past its new last page lands it on its target at once, as at rest (the FR6 gap).
  • Gapped pages: a rotation from 390 to 844 px with 8 px gaps, during a settle toward page 2, ends on page 2 under the same bound. A ratio from the row's width calls these pages new and rests on page 1.
  • Fixed-width views that regroup at the same count (300 to 400 px: stops 0/308/616 to 0/411/516) keep the pixels and rest on 411; the page-fraction remap stepped 40 px in one frame, main 365 px.
  • A target within half a pixel of halfway between two pages goes on the way the settle moves: narrowed to 205.34/410.67, a settle toward 308 rests on 410.67; main and the rounding rest on 205.34.
  • On pages sized to the row, a widening (300 to 700 px) during a drag keeps the page the drag began on, and a release easing back from past half of it settles there. Mapped by offset, the drag began on page 0, and main and the offset mapping both settle there.
  • Uniform pages: a narrowing (400 to 200 px) and a widening (400 to 800 px) during a settle toward page 2 hold the same 1.5-step bound and end on page 2. Main lands on page 2 at once, and a retarget from the old pixels misses: both fail (1.10–1.20 and 0.36 pages against 0.26).
  • A release's report that still waits at the resize goes out two frames after the new settle starts, also when the resize comes in the old settle's first frames; main sends it at the resize.
  • The frame oracle, in the three-up narrowing case. From the lift to the hand-back, the page records each frame: where the row shows, when the read ran, and each settle's own animation clock. The settle before the resize fits the paging integrator's curve through its keyframes, to 0.00 px at every keyframe. Each frame after the resize must sit on the integrator's curve to the new settle's last keyframe, from where the settle before stands at the new settle's own start, at its velocity then. Chromium must hold 0.5 px at the frame's clock; WebKit must hold 1 px over the read's span. WebKit shows a frame at the time of the read, not the rAF stamp: taking out each read's delay collapses the clock spread of the frames before the resize from 1.1–2.8 ms to 0.1–0.2 ms, and WebKit reads its clocks to the millisecond (±0.5 ms). A control holds each moving frame before the resize to 1 px on its own settle. The first frame after the resize may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame (FR6). Once the new settle ends, a held frame must show its end.
  • These builds: the three-up and split cases pass every run, 5 per case in Chromium and 10 in WebKit. The hand-back runs hold every frame within 0.06 px in Chromium (20 of 20 with two busy loops, 20 of 20 at the host's load) and 0.01 px in WebKit (50 of 50). On main, 5 runs per engine: the row of three runs back to 308, and the split end rests at 411, not 471.
  • A row of items as wide as itself is widened by half about 100 ms into a flick's settle. It ends on the item it was heading to, 5 of 5 per engine. Without SnapPaging's held-stop fix it rests on the item it left: Chromium 5 of 5, WebKit 3 of 5.
  • A widening that leaves a settling three-per-view row past its new last page: the row lands on that page within a frame and stays, 5 of 5 per engine, as on main (5 of 5). Retargeted instead, it lands 14 to 22 frames later and steps at the hand-back, every run in both engines.
  • Mutation-sensitive proof, each a NOT-FOR-LANDING commit removing one rule; units on this head's tests, and 5 browser runs per engine where named:
    • a settle toward the last page by offset too (45c7742): the split end rests at 411 in both engines; 2 units fail.
    • the page last at rest keeping its old index (698907f): its unit fails.
    • no re-sync of the last report (f6e926e): its unit fails.
    • a resize ending the settle at once (8a7d157): the three-up case fails in both engines, with no settle after the resize; 9 units fail.
    • the velocity dropped at the retarget (bfe4ef5): the three-up case misses by 11.1 px in Chromium and 9.4 px in WebKit; 2 units fail.
    • the retarget starting from the old settle's end (6f02490): misses of 252–260 px in both engines; 8 units fail.
    • the read and the play at two times (164ff91): the stall unit fails, and Chromium misses by 0.65 px.
    • a uniform pager's retarget from the old pixels (97c4913): both uniform-page units fail.
    • the waiting report sent at the resize (b235c4c): both report units fail.
    • the old settle's report timer left live (58f8f0c): the first-frames report unit fails.
    • scaled pages renumbering too (8c67941): 6 units fail, the row-sized, gapped, shared-shift, measurement and drag ones.
    • the same pages replaying from the old pixels (d40eb1d): 4 units fail.
    • the old layout's velocity kept (fa131dd): the uniform narrowing fails.
    • a tie that rounds (7cee431): the tie unit fails.
    • as many pages as before counting as the same pages (9549bb5): the regroup unit fails.
    • the row's width ratio as the scale (02c4e35): the gapped and shared-shift units fail.
    • a fit on the offsets, not the spacings (32046f0): the shared-shift unit fails.
    • the retarget dropping a finger's waiting catch (740fe9f): the catch unit fails.
    • a writing-direction change retargeting too (041125a): both writing-direction units fail.
    • a settle cut short on the page it left not ending (545ccdb): the spring-back unit fails.
    • the track read after the pages are measured (40af925): the measurement unit fails.
    • a finished settle left where the clock last showed it (b6960e3): the curve-end unit fails, every run.
    • a track left past its new last page retargeting too (7cff334): the past-end unit fails, and the browser case fails 5 of 5 per engine.
  • A 75 ms stall between the read and the play, from a NOT-FOR-LANDING hook: on the two-times mutant (a8cbb12) Chromium misses by 23.1–23.9 px, 5 of 5; on this head (85db2d7), 5 of 5 pass.
  • Settles with no resize are unchanged: a still lift and a flick on main and on 6f396fd, an earlier head of this change, fit the same integrator curve in Chromium (still: from 487.08 px at −7 px/s; flick: from 373.10 px at 824 px/s), every frame within 0.12 px of it, 5 runs each. The edits since touch only resizes.
  • Hand-back: the frame check stops where the row goes back to native scrolling, and the rest is checked on its own (716). The held settle ends on the native rest in all 40 Chromium runs and all 50 WebKit runs.
  • Interaction specs of SnapPaging, Carousel and the pager on d167b64's build, ×1 per engine, no retries: Chromium 82 passed, 0 failed; WebKit 85 passed, 0 failed.
  • Lightbox's interaction specs, ×1 per engine: WebKit 98 passed, 0 failed. Chromium 102 passed; LightboxDismiss's reopening case missed its 5 s close again, a timeout logged for its own fix.

Follow-ups

Follow-up When
The FR6 gap: a resize that leaves a held row past its new last page keeps its velocity once SnapPaging's held offset and travel follow the browser's later clamp Not scheduled
The held row's interaction case under a retarget #10927, right after this one
A key press between a resize and the paging's next frame Not scheduled
A controlled index whose page a resize renumbers Not scheduled

Writing rubric results

R1 narration: none; the FR6 sentences, its row and its gap bullet state the system in the present tense. The no-width sentence, the row's no-width case and the gap bullet's no-width case are new at this head, for the record owners' approval.
R2 research: none in the record.
R3 evidence: the verification row names the tests and their cases, not a change.
R4 rejected alternatives: none added.
R5 change references: none.
R6 open questions: none added.

@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 12, 2026 4:31am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 7, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 7, 2026
@astracat-bot

astracat-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 12, 2026, 4:48 AM UTC

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · d8497d4

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
lab/CommentThread 352.8 kB (+802 B) · 2.4 kB CSS (0) —
lab/Comments 359.6 kB (+783 B) · 2.5 kB CSS (0) —
Lightbox 126.7 kB (+679 B) · 10.6 kB CSS (0) —
4 more components
Component Size LoC
DateInput 192.8 kB (+19 B) · 17.0 kB CSS (0) —
PowerSearch 299.3 kB (0) · 24.7 kB CSS (0) —
TimeInput 167.6 kB (−2 B) · 16.0 kB CSS (0) —
DateTimeInput 215.4 kB (−5 B) · 18.7 kB CSS (0) —

Package size: @astryxdesign/core 7.37 MB packed (+4.7 kB); no new dependencies.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 3d0c0b7

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 7, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: the resize retarget and the split end behave as described in Chromium, and an engineering owner approved both record changes for this head, but three fixes remain.

  • After items are added or removed without the row resizing, the item whose stop the end page took keeps scroll-snap-align: none even once its stop sits more than half a step from the end, so keyboard and wheel scrolling skip a stop that a flick counts as a page (SnapPaging.ts:458-463); re-measure the paging when the row's children change.
  • The new spec:AST-094 FR6 sentence says a resize "retargets" the settle, but measure() ends it at once on the new page (a 218 px jump in Chromium), which FR6's own "A new target MUST keep the current velocity" rules out; reword the sentence to say the settle ends at once, or keep the velocity in code.
  • component:Carousel FR5 ("native snap's per-item stops") and FR7 ("each direct child's start edge") still say every item is a stop, which contradicts the new "Split end" state; amend them to name that exception.

Non-blocking suggestions are inline.

[Automated review]

Comment thread packages/core/src/hooks/usePager.ts Resolved
// The same page, renumbered: the owner hears it only through a
// release's report still waiting.
if (pendingReport == null) {
report('controlled');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: with a controlled index, this silent sync leaves the owner's index naming another page, and usePager's controlled sync never re-runs because no onIndexChange fires; a later index equal to the new number then moves nothing. No caller passes a controlled index with child pages today, but the module doc's "A controlled index wins" no longer holds here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left as is: no caller passes a controlled index with child pages. A caller that does would need its own sync, in a separate change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pager's module doc names it at bb6aec9. A resize that renumbers the pages keeps the settle's page under its new number, without a report. A controlled index then names the old number. Reporting it is a follow-up row in the description.

@vjeux
vjeux force-pushed the pager-settle-resize-retarget branch from 3d0c0b7 to 6f396fd Compare November 9, 2026 08:08
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 9, 2026
@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 6f396fd

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 9, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. The Carousel fix works, and an engineering owner approved the spec:AST-094 FR6 change for this head, but one blocking issue remains.

  • retargetSettle() in usePager.ts restarts a uniform pager's settle from the old layout's pixel offset, so a Lightbox gallery resized or rotated mid-settle first shows an earlier photo (when the stage widens) or empty space past the last photo (when it narrows near the end) and then slides, where the base shows the target photo at once; keep the shown page fraction for uniform pages by scaling the offset and velocity by the new stride over the old one (or keep the immediate landing there), and add a widen and a narrow uniform-pager test.

Two smaller notes are non-blocking: the comment above the renumbering block restates the branches below it, and the silent renumber leaves a controlled index naming the old number.

[Automated review]

Comment thread packages/core/src/hooks/usePager.ts Resolved
Comment thread packages/core/src/hooks/usePager.ts Resolved

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. Last round's two findings are fixed (uniform pages now keep their fraction of a page through a resize, and a release's report keeps its two-frame wait), and the spec:AST-094 FR6 change carries spec-owner approval at this head, but one blocking issue remains.

  • Miss: measure() remaps a renumbered settle to the page nearest its old pixel offset and replays child pages from the old pixels (usePager.ts:996-1011, :1036-1037), so a Carousel snap-paging row whose items follow the row or viewport width (cqi, vw) rests on the item the person left when it widens mid-swipe, and skips an item when it narrows, where the base rests on the swiped-to item; map the target and the shown position through the item they sit on (for example, keep the index and scale by the page fraction when the page count is unchanged, as the uniform branch does) and add a widen and a narrow case with viewport-relative items.

The silent renumber under a controlled index and the repeated animated-scroll solve stay non-blocking.

[Automated review]

Comment thread packages/core/src/hooks/usePager.ts Resolved
@vjeux
vjeux force-pushed the pager-settle-resize-retarget branch from 95aa8c8 to c4319b4 Compare November 9, 2026 13:03
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 9, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering-owner decision on the spec:AST-094 FR6 change, and two fixes are needed either way.

Spec decision: this head adds a new FR6 requirement, "A resize during a settle retargets it. With as many pages as before, the settle keeps its page and its fraction of a page. With another count, a settle toward the last page ends on the last page, and any other on the page nearest its target's offset", with its "FR6 resize" verification row. The earlier /approve-spec comments name earlier heads, and the same-count sentence is new here. An engineering owner records the decision by commenting /approve-spec c4319b445d09484836f1d5f737952e75ef16ff61; the author may do so as an engineering owner.

Blocking:

  • In usePager.ts (lines 1013-1026), a resize that keeps the page count maps the shown position by its page fraction, so a fixed-width view-paging Carousel whose views regroup (the three-per-view story widened from 300 to 400 px) jumps 94 px in one frame mid-settle, which FR6's retarget rule and its "a jump … fails" verification row forbid; decide "same pages" from the items (or from offsets that scaled with the row), keep the pixels otherwise, and add a fixed-width unit case.
  • The changeset says the row "no longer jumps", but the fixed-width same-count case above still jumps, so fix the jump or narrow the sentence to the cases the tests cover.

The twelve new unit cases and the two new browser cases fail on main and pass on this head in Chromium.

[Automated review]

Comment thread packages/core/src/hooks/usePager.ts Resolved
Comment thread packages/core/src/hooks/usePager.ts Resolved
@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec c4319b4

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 9, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for two fixes. An engineering owner approved the spec:AST-094 FR6 resize change for this head, and in Chromium the pager does what that sentence says; the record change can stay as it is.

Blocking:

  • Miss: a still finger that lands on a release's settle no longer stops it when the row resizes inside the 85 ms catch window, because retargetSettle() in usePager.ts calls stopSettle(), which clears the armed catch, so the settle slides on under the finger against FR6's "A finger MUST be able to catch any animation mid-flight"; keep the pending catch across the retarget and add a unit case for it.
  • The changeset (.changeset/pager-resize-settle-retarget.md, line 5) says a resized row "no longer jumps" and plays on "from where it shows", but a fixed-width three-per-view row widened from 300 to 400 px mid-settle keeps its page count and still steps 94 px in one frame, so narrow it, for example to "no longer stops at once or runs back to an earlier page. The settle plays on at its speed, to the last page when it was heading there, and otherwise to the page nearest where it was heading."

The earlier comment on the same-count step in usePager.ts is settled by the approved FR6 sentence. The new unit and browser tests fail on main and pass on this head in Chromium.

[Automated review]

Comment thread packages/core/src/hooks/usePager.ts Resolved
@vjeux
vjeux force-pushed the pager-settle-resize-retarget branch from c4319b4 to c081881 Compare November 9, 2026 15:24
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 9, 2026
@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec c081881

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 11, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, because the pull request is still a draft; its required checks run once it is marked ready for review.

The resize retarget in the shared pager does what the amended spec:AST-094 FR6 says, and an engineering owner approved that record change for this head. The new unit cases fail on main and pass here, and the new browser cases show the Carousel row ending on its last page instead of running back.

  • Non-blocking: a resize that renumbers child pages mid-settle moves the pager's index to the page's new number without onIndexChange (usePager.ts:1123-1129). No current caller passes a controlled index with child pages, and the description already lists it as a follow-up.

Automated review (maintainer link)

@vjeux
vjeux marked this pull request as ready for review November 11, 2026 11:43
@vjeux
vjeux marked this pull request as draft November 11, 2026 22:29
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 11, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec b01724f

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 11, 2026
@vjeux
vjeux marked this pull request as ready for review November 11, 2026 22:40

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: some required checks are still running on this head, and the WebKit interaction job needs a rerun after it failed one existing SnapPaging case (SnapPaging.interaction.browser.spec.ts:1873) on a touch-pacing fault in its setup swipes, before any resize, a case that passes in Chromium.

The resize retarget in the shared pager does what the amended spec:AST-094 FR6 says, and an engineering owner approved that record change for this head. The new unit and browser cases cover each state of the FR6 resize row and pass in CI on this head, and the key unit cases fail on main, where the track re-places on the old page index's offset.

  • Non-blocking: main now gives each document's gesture host its own window clock. For a pager in a same-origin iframe or a Picture-in-Picture window, the retarget's start time (usePager.ts:1189, clock set at :1602) therefore no longer matches the animator's clock, and taking that time from the animator's clock keeps the replacement settle on its curve there.
Claims and files checked
  • Changeset: a row resized mid-settle plays on to the last page or to the page nearest its target, and a resize past the new last page or one that gives the first width still lands at once. Verified: usePager.ts:1151-1180.
  • Description: before the change, a resize stops the settle and sets the track on its index's new offset, so a narrowed row runs back. Verified on the base measure(); the cases at usePager.test.ts:1275 and :1343 fail there.
  • Description: pages whose spacings scale keep their page and fraction of a page; others keep the last page or the nearest page by offset, with a tie going the way the settle moves. Verified: usePager.ts:326-351, :1078-1135, :651-670.
  • Description: the settle replays from the track's value and velocity, read before measuring, and a direction change, a past-end track or a settle begun with no width re-places at once. Verified: usePager.ts:1062-1067, :1151-1180.
  • Description: a renumbered page is not reported, the waiting report and an armed catch carry over, and a finished settle rests on its curve's end. Verified: usePager.ts:1125-1129, :1216-1228, :1015-1017.
  • Description: settles with no resize keep main's path. Verified: outside a resize, only the curve-end set at usePager.ts:1015-1017 is new.
  • Description: the per-case results (row-sized, shared shift, still finger, direction change, measurement, curve end, past end, gapped rotation, regroup, tie, drag, uniform pages, report timing, frame oracle, row-wide widening, past-end landing). Verified: each named case asserts that outcome (usePager.test.ts:1532-2188; SnapPaging.interaction.browser.spec.ts:417, :864-1442).
  • Description: the mutation arms. Verified: each removed rule is asserted by the case the arm names.
  • Description: this head merges main with no conflict, and main's new record lines sit apart from this change's. Verified: the patch is unchanged, and main's AST-094 lines are a DEC-27 amendment.
  • .changeset/pager-resize-settle-retarget.md: clear.
  • docs/specs/AST-094-touch-presentations/spec.md: clear (owner-approved for this head).
  • packages/core/src/hooks/usePager.ts: non-blocking notes only.
  • packages/core/src/hooks/usePager.test.ts: clear.
  • packages/core/src/SnapPaging/__tests__/SnapPaging.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

* starts the retargeted curve, so a stall cannot leave it behind.
*/
function readSeed(running: PagerAnimator): Seed {
const at = clock();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (a regression since main's per-document gesture clock): clock() is the gesture host's arena clock (:1602). For a viewport in a same-origin iframe or a Picture-in-Picture window, that host now reads that window's performance (GestureHost.ts:684-693). The animator from animatorFor(track) still reads the page's motionNow(). So get('x', at) and play({at}) sample and start the replacement settle on another clock, off by the gap between the two windows' time origins. The settle can start part-way through its curve or already finished. Taking at from the animator's own clock keeps the read and the play together, and makes the comment at :611 hold in every document.

retargetSettle(animator, remap, seed);
return;
}
// A mirrored track has no settle to carry on, so it stops and re-places.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (comment): past-end and no-width settles also take this branch, not only a mirrored track. Suggested: "Otherwise the settle stops, and the track re-places on its target."

@vjeux
vjeux marked this pull request as draft November 11, 2026 23:28
@vjeux
vjeux marked this pull request as ready for review November 11, 2026 23:43
@vjeux
vjeux marked this pull request as draft November 12, 2026 00:16
The widening case flicked the row a page back and widened it two frames
into the settle. On a slow frame the row had already crossed where the
widened row ends, so the settle rightly played on. A short drag held
still now settles the row back onto its last page, away from that end,
so the widening always leaves it past the new last page. The case also
waits for the page to draw a frame at rest before it reads the frames.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 12, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec b2c11d6

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 12, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the required checks are still running on this head, which left draft after the first CI run skipped it.

The resize retarget in the shared pager does what the amended spec:AST-094 FR6 says, and an engineering owner approved that record change for this head. Since the last review only the browser case for a widening that leaves the row past its new last page changed: it now starts from a held drag back from the end, so it always reaches the branch it tests, which targets the one WebKit failure on the previous head.

  • Non-blocking: main gives each document's gesture host its own window clock, so for a pager in a same-origin iframe or a Picture-in-Picture window the retarget's start time (usePager.ts:1189, clock set at :1602) no longer matches the animator's clock; taking that time from the animator's clock keeps the replacement settle on its curve there.
Claims and files checked
  • Changeset: a row resized mid-settle no longer stops at once or runs back; it plays on to the last page or the page nearest its target, ends with no step at the hand-back, and a resize past the new last page or one that gives the first width still lands at once. Verified: usePager.ts:1017, :1104-1123, :1157-1179, :1203-1256.
  • Description: before the change, a resize stops the settle and sets the track on its index's new offset, so a narrowed row runs back or a partial last page rests short. Verified on the base measure(); the cases at usePager.test.ts:1343 and SnapPaging.interaction.browser.spec.ts:417 encode the fixed outcome.
  • Description: pages whose spacings scale keep their page and fraction of a page; others keep the last page or the nearest page by offset, a tie going the way the settle moves. Verified: usePager.ts:326-351, :656-670, :1078-1123.
  • Description: the settle replays from the track's value and velocity, read before measuring; a direction change, a past-end track or a settle begun with no width re-places at once. Verified: usePager.ts:1062-1063, :1157-1179.
  • Description: a renumbered page is not reported, the waiting report and an armed catch carry over, and a finished settle rests on its curve's end. Verified: usePager.ts:1124-1129, :1219-1228, :1017.
  • Description: the quoted record text and Carousel's last-page rule. Verified: the current FR6 and Carousel FR7, and the amended FR6 sentence, gap bullet and row in this head's record.
  • Description: this head merges main with no conflict onto a commit that changes only the widening case, and main's new record lines sit apart. Verified: the patch differs from the previous head only in that case, and main's record change is a separate decision amendment.
  • Description: the widening case failed in WebKit on the previous head, and now settles a held short drag back onto the last page and waits for a frame at rest with no bound changed. Verified: that run's WebKit failure names the case; SnapPaging.interaction.browser.spec.ts:993-1030, bounds at :1042-1057.
  • Description: per-case and per-engine run results, the reproduction and mutation arms, and the platform comparison. Stated results: each names a case that asserts that outcome (usePager.test.ts:1275-2188; SnapPaging.interaction.browser.spec.ts:417, :864, :936, :1060); not rerun on this head.
  • .changeset/pager-resize-settle-retarget.md: clear.
  • docs/specs/AST-094-touch-presentations/spec.md: clear (owner-approved for this head).
  • packages/core/src/hooks/usePager.ts: non-blocking notes only.
  • packages/core/src/hooks/usePager.test.ts: clear.
  • packages/core/src/SnapPaging/__tests__/SnapPaging.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

@vjeux
vjeux marked this pull request as ready for review November 12, 2026 01:43
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec d8497d4

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the required checks are still running on this head, which left draft after its first CI run skipped every job.

The resize retarget in the shared pager does what the amended spec:AST-094 FR6 says, and an engineering owner approved that record change for this head. Since the last review this head only merges main, which changes no pager code, so the earlier findings stand as they were.

  • Non-blocking: for a pager in a same-origin iframe or a Picture-in-Picture window, the retarget's start time comes from that window's gesture clock (usePager.ts:1189, clock set at :1602) while the animator reads the page's clock; taking that time from the animator's clock keeps the replacement settle on its curve there.
Claims and files checked
  • Changeset: a row resized mid-settle no longer stops at once or runs back; it plays on to the last page or the page nearest its target, ends with no step at the hand-back, and a resize past the new last page or one that gives the first width still lands at once. Verified: usePager.ts:1015-1017, :1104-1123, :1155-1179, :1203-1256.
  • Description: before the change, a resize stops the settle and sets the track on its index's new offset, so a narrowed row runs back or a partial last page rests short. Verified on the base measure(); the cases at usePager.test.ts:1343 and SnapPaging.interaction.browser.spec.ts:417 encode the fixed outcome.
  • Description: pages whose spacings scale keep their page and fraction of a page; others keep the last page or the nearest page by offset, a tie going the way the settle moves. Verified: usePager.ts:326-351, :656-670, :1078-1123.
  • Description: the settle replays from the track's value and velocity, read before measuring; a direction change, a past-end track or a settle begun with no width re-places at once. Verified: usePager.ts:1062-1063, :1155-1179.
  • Description: a renumbered page is not reported, the waiting report and an armed catch carry over, and a finished settle rests on its curve's end. Verified: usePager.ts:1124-1129, :1219-1226, :1015-1017.
  • Description: the quoted record text and Carousel's last-page rule. Verified: the current FR6 and Carousel FR7, and the amended FR6 sentence, gap bullet and row in this head's record.
  • Description: this head merges main with no conflict, and main's new record lines sit apart from this change's, which are as they were. Verified: the merged tree is the clean merge of the two parents; the patch equals the previous head's; main's record change is a BottomSheet sentence under FR36.
  • Description: per-case and per-engine run results, the reproduction and mutation arms, and the platform comparison. Stated results: each names a case that asserts that outcome (usePager.test.ts:1275-2188; SnapPaging.interaction.browser.spec.ts:417, :864, :936, :1060); not rerun on this head.
  • .changeset/pager-resize-settle-retarget.md: clear.
  • docs/specs/AST-094-touch-presentations/spec.md: clear (owner-approved for this head).
  • packages/core/src/hooks/usePager.ts: non-blocking notes only.
  • packages/core/src/hooks/usePager.test.ts: clear.
  • packages/core/src/SnapPaging/__tests__/SnapPaging.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — d8497d4e Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants