Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
… ends Under a finger, a tap or a pan outside a menu that has drawn its whole entrance could do nothing. The input hold's shield stayed over the page until the main thread ran the motion's release: a timer after the curve's end, or a promise the next frame resolves. A busy main thread ran them late, and a press the browser dispatched first was held as if the menu still entered. The input hold now ends a layer's presenting holds in the first frame past the entrance's end, even when timers run late. A marker animation with no target waits out the entrance in its delay, so it asks for no frame before that end. Each look reads the end again, so a retargeted entrance keeps its hold to the new end, and a marker ends only the hold it was armed for. A press stamped after that end also ends them, before the press is judged. A press while the entrance runs is held, as before. The entrance end is read from the layer's animations. The motion animator records each run's curve end, and each handle's once its start is known, in motion/curveEnds.ts, which the input hold reads without the animator. The snap paging bundle test counts that module as the pager's motion. A pan whose first touch lands on such a shield, with no frame drawn since the entrance ended, still cannot scroll in that gesture: the browser takes the gesture's scrolling from the shield as the touch starts. The menu closes, and the next pan scrolls.
a253187 to
57b6adb
Compare
There was a problem hiding this comment.
Requesting changes. The fix keeps the touch-presentation rule that only an entering presentation holds input, and the release note now matches what the new tests prove, but one point needs an owner decision before approval:
packages/core/src/motion/curveEnds.tsis a new internal module thatLayer/inputHold.tsimports from outsidemotion/, and no current record names it (architecture:knowledge-contractsDEC-22), so it needs an engineering owner's API decision, including why the motion foundation's existingmotion/presentation.tsregistry is not the place for a curve-end entry.
The INV16 amendment in docs/architecture/layer-runtime.md that names the module is itself a record change waiting for the same decision: an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. One non-blocking wording suggestion for a comment in inputHold.ts is inline.
Claims and files checked
Review mode: full; reason: history
Claims:
- Release note, a tap or a pan outside a menu acts from the first frame drawn after the entrance ends, even when timers run late: verified in code (
inputHold.ts:670-719,:644-661) and matched by the new specs, which hold page timers while frames run (DropdownMenuEntranceHold.interaction.browser.spec.ts:418-491). - Release note, the hold no longer covers the page until those timers run: verified (
inputHold.ts:699-708). - The press lands on the hold's shield, which stays until a timer or a next-frame promise releases it: verified (
inputHold.ts:312-354,:595-596;animator.ts:2305;usePopoverSurfaceMotion.ts:105). - A presenting hold ends in the first frame past its entrance's end, through a marker animation with no target: verified (
inputHold.ts:699-708); that the marker asks for no frame before its end is engine scheduling that the tests do not show. - A press stamped after that end ends the hold before it is judged: verified (
inputHold.ts:1254-1256,:1318-1320). - The end comes from the hold's motion or the layer's animations: verified (
inputHold.ts:653-655,:688-690). - The animator records each run's curve end, and the curve-end map is shared under a versioned key: verified (
animator.ts:2304,:3366;curveEnds.ts:20-23). - INV16 names the module: verified (
layer-runtime.md:693-696), not yet approved. - A press during the entrance, or before it starts, is held as before: verified (
inputHold.ts:616-623,:656;inputHold.test.tsx:595,:606). - Known limit, a pan that starts on the shield before any frame past the end cannot scroll in that gesture: consistent with the shield's touch action (
inputHold.ts:332). - The pan spec is skipped outside Chromium, and its tap twin runs everywhere: verified (
DropdownMenuEntranceHold.interaction.browser.spec.ts:449-452,:418). - The pager bundle test counts the new module as the pager's motion: verified (
scripts/snap-paging-bundle.test.mjs:36). - The new module is internal and the public API is unchanged: verified from the package exports and the source diff.
- No new public API, default or interaction model under the fix label, and no internal context in public text: verified.
- The INV16 sentences carry no narration, status or change references: verified (
layer-runtime.md:693-696). - The coordination note about another open pull request that edits
inputHold.ts: a process note, not a code claim. - The stated pass and fail counts (red-first specs and unit cases, the unit, interaction and trace suites, and the busy-main-thread local spec): not reproduced; CI has not run on this draft.
Files:
.changeset/input-hold-entrance-end.md: clear.docs/architecture/layer-runtime.md: waits for an engineering owner's approval.packages/core/src/DropdownMenu/__tests__/DropdownMenuEntranceHold.interaction.browser.spec.ts: clear.packages/core/src/Layer/inputHold.test.tsx: clear.packages/core/src/Layer/inputHold.ts: clear, with one non-blocking comment suggestion.packages/core/src/motion/animator.ts: clear.packages/core/src/motion/curveEnds.ts: finding (needs an owner API decision).scripts/snap-paging-bundle.test.mjs: clear.
| * curves end once its start is known. An animation's effect runs on past that | ||
| * end, holding the end value, so its own timing does not tell. | ||
| */ | ||
| export const curveEnds = sharedWeakMap<object, number>( |
There was a problem hiding this comment.
Layer/inputHold.ts imports this module from outside motion/, so it is API between components, and no current record names it (architecture:knowledge-contracts DEC-22). It needs an engineering owner's decision: approving the INV16 amendment with /approve-spec <full head SHA>, or naming the existing module, such as motion/presentation.ts, that should carry the curve end instead.
| * at the end of the held tail after it. Null while none runs, or while any | ||
| * one has no end that can be read: one not started yet, one that repeats | ||
| * without end (a spinner in the menu), or one played backward. Then the hold | ||
| * waits for its own release. |
There was a problem hiding this comment.
Non-blocking: this is one sentence of more than 25 words with three topics. Suggested:
* at the end of the held tail after it. Null while no animation runs. Null
* also while an animation has no readable end: it has not started, it
* repeats without end (a spinner in the menu), or it plays backward. Then
* the hold waits for its own release.
User impact
Under a finger, a tap or a pan outside an open menu can do nothing after its entrance has drawn. It happens when the main thread is busy as the entrance ends. The tap leaves the menu open, and the pan does not scroll.
Problem and solution fit
Expected behavior and authority
spec:AST-094FR35: "A presentation takes no input while it enters." It holds "a tap or a drag that lands while a touch presentation is still entering".architecture:layer-runtimeINV16 gives that hold to the layer runtime. A press after the entrance ends is outside both.Smallest restoration
Layer/inputHold.ts: a presenting hold ends in the first frame past its entrance's end, even when timers run late. A marker animation with no target waits out the entrance, so it asks for no frame before then.motion/animator.tsrecords each run's curve end.motion/curveEnds.tsowns the shared curve-end map that the animator writes and the input hold reads (spec:AST-110FR3). INV16 names it.Known limit: a pan whose first touch lands on such a shield, with no frame drawn since the entrance ended, cannot scroll in that gesture. The browser takes its scrolling from the shield. The menu still closes, and the next pan scrolls.
Evidence
inputHoldunit cases fail without the change and pass with it (test).Scope
Components: motion animator, Layer input hold, INV16 of
architecture:layer-runtimeTesting
All runs are in Chromium unless named, with no retries.
pnpm test:interaction packages/core/src/DropdownMenu/__tests__/DropdownMenuEntranceHold.interaction.browser.spec.ts --project chromium -g "timers run late" --repeat-each=5: onmainwith only the new specs, 10 of 10 fail. With the change, 10 of 10 pass (test).pnpm exec vitest run --project ui packages/core/src/Layer/inputHold.test.tsx: onmainwith only the new cases, 4 of 7 new cases fail. With the change, all pass (test).main, the tap is held in 14 of 20 runs. With the change, it is held in 0 of 20 (test).scripts/snap-paging-bundle.test.mjscountsmotion/curveEnds.tsas the pager's motion, beside the animator that imports it.motion/curveEnds.tsis internal: nothing from it is exported from@astryxdesign/core. The repo's API report,scripts/api-report/cli.mjs, shows no change to its public API (test).Layer/inputHold.ts, as fix(DropdownMenu): a finger's touch outside only closes the menu #12216 does. Whichever lands second is merged onto the other, and its tests run again.pnpm preflight --browserread "ready to flip". Every check passed, the unit, accessibility and interaction suites included (test).main. None fails (test).main: 1,703 passed and 335 skipped (test).Owner decision
The record line naming
motion/curveEnds.ts, a new internal module that two others import, awaits an engineering owner's/approve-spec(architecture:knowledge-contractsDEC-22).Writing rubric results
Run over the two sentences this change adds to INV16 of
architecture:layer-runtime.