Repository navigation
Conversation
progressCurve, mapProgress, mapRange and presentedProgressVelocity in motion/progress.ts, internal, one velocity unit (progress per second). Rebuilt on main from the pull request's own change, without the open dependency chain it no longer needs. Co-authored-by: Cindy Zhang <cindyxz@meta.com>
…ressCurve CodeBunny on #9755: springProgress solved the same spring as progressCurve. It now reads progressCurve (remaining = 1 - progress), so one implementation remains. Same curve, same settle epsilon (0.001) and duration.
…shows at each progress lerpPath, edgeGrowPath, each path's restartFrom and morphCurves in motion/morphPath.ts, internal. Pure geometry over a progress curve: the caller chooses the timing. Rebuilt on the progress module from the pull request's own change, without the open chain it no longer needs. Co-authored-by: Cindy Zhang <cindyxz@meta.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This looks ready to approve. The new internal motion/morphPath.ts is the shared rectangle morph that the layer-runtime architecture calls for. It stays unexported, and its tests, typecheck and lint pass. It can land once #9755 merges and this pull request retargets to main.
- Optional: trim the
morphPath.tsfile header (lines 5–36) to@file,@input,@output,@positionandSYNC:. Its two prose paragraphs repeat the exported JSDoc. - Optional: the description says comments no longer cite files missing from
main. The test models still namepopoverSurfaceMotion.tsand four other files that exist only in open pull requests.
[Automated review]
# Conflicts: # packages/core/src/motion/README.md
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
This looks ready to approve. The new internal motion/morphPath.ts is the shared rectangle morph that the layer-runtime architecture calls for; it stays unexported, and its tests, typecheck and lint pass.
- Optional: trim the
morphPath.tsfile header (lines 5–36) to@file,@input,@output,@positionandSYNC:; its two prose paragraphs repeat the exported JSDoc. - Optional: the description says comments no longer cite files missing from
main, but the test models still namepopoverSurfaceMotion.tsand four other files that exist only in open pull requests.
[Automated review]
There was a problem hiding this comment.
Changes requested: one blocking item, caused by a change that merged to main after the earlier approval.
- Regression: Popover's touch growth now on
mainplays the same edge-growth law itself (popoverFrameandframeOfinPopover/popoverSurfaceFrame.ts,surfaceCurvesandreadStateinPopover/popoverSurfaceMotion.ts), sogrowPathinmorphPath.ts(lines 134–178) is a second copy that will drift; please move Popover's touch presentation ontoedgeGrowPathandmorphCurveshere, or say in the description why it cannot move yet and have the popover tests import the livepopoverCollapsedStateandpopoverFrameinstead of the copy inmorphPath.test.ts(lines 152–210).
The test copy already differs from the live code: for a popover that overlaps its source it grows from the left edge, where Popover grows from the top. The description's "Before: none of this exists on main" also no longer holds for the popover. Optional: trim the morphPath.ts file header (lines 5–36) to @file, @input, @output, @position and SYNC:.
[Automated review]
The morph's popover proofs played a copy of Popover's growth that had drifted: it lacked the overlap rule, so an overlapping popover grew from its left edge where Popover grows from its top. The proofs now import popoverCollapsedState, popoverFrame and frameOf from Popover. A new overlapping case, which the deleted copy fails, pins the growth from the top edge.
There was a problem hiding this comment.
Changes requested: the one blocking item from the last review still stands, though the test change narrows it.
- Regression: Popover's touch growth on
mainstill plays the same edge-growth law itself (popoverFrameandframeOfinPopover/popoverSurfaceFrame.ts,surfaceCurvesandreadStateinPopover/popoverSurfaceMotion.ts), sogrowPathinmorphPath.ts(lines 134–178) remains a second copy; please move Popover's touch presentation ontoedgeGrowPath,restartFromandmorphCurves, or say in the description why it cannot move yet and drop "Before: none of this exists onmain".
The popover growth proofs now read Popover's live geometry, so a change to Popover's growth fails morphPath.test.ts, and the overlap case is covered. The turn-around case (morphPath.test.ts lines 341–355) still compares restartFrom with lines written in the test, so a change to Popover's readState or surfaceCurves leaves it green; reading Popover's live turn-around there would close that gap. Optional: trim the morphPath.ts file header (lines 5–36) to @file, @input, @output, @position and SYNC:.
[Automated review]
The morph's turn-around proof compared restartFrom with lines written in the test, so a change to Popover's readState or surfaceCurves left it green. Popover exports both for the proofs, which now replay its own turn-around. morphPath.ts's header keeps only its tags: the paths' own JSDoc says the rest.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft, and marking it ready for review starts it.
The earlier blocking item is resolved: the description now explains why Popover keeps its own edge growth until the player in #9769, and both popover proofs in morphPath.test.ts replay Popover's live growth and turn-around, so a change to either side fails the test.
- The
Stack: #9764 → #9769 → #8485line does not hold yet: #8485's head does not contain #9769's head, so this pull request is judged on its own.
Optional: the description says comments no longer cite files missing from main, but four model comments in morphPath.test.ts still name menuSurfaceMotion.ts, ContextMenuLift.tsx, zoomTransition.ts and menuDrillInMotion.ts.
[Automated review]
Popover's surface curves now stop their opacity at 0 or a floor above it. Past its end, a turn-around toward the source takes the popover path's opacity below 0, where Popover's stops at 0. An opacity draws clamped to 0 through 1, so both draw 0. The proof now compares the two as drawn, which holds with Popover's curves before and after the floor.
A popover's grow path read its opacity on a straight line, so before its start and past its end it went below 0: a turn-around toward the source read -0.025 at 1.05. An opacity below 0 draws as 0, so opacityAt now stops at 0. The popover proofs compare opacities as drawn, since Popover's own model still reads below 0 there.
|
/approve-spec 6354fa3 |
There was a problem hiding this comment.
Approved pending CI: the heavy test suites have not run on this head yet; they run before merge.
The new internal motion/morphPath.ts gives the shared rectangle morph its geometry (lerpPath, edgeGrowPath with its restartFrom, and morphCurves), stays unexported, and no component uses it yet; its tests, typecheck and lint pass. Popover keeps its own edge-growth module for now, and the popover proofs pin the two together against Popover's live code.
Two small points, neither blocking:
- The Testing section's counts are stale:
morphPath.test.tshas 11 tests at this head, so the run is 23, not 22. - The
Stack: #9764 → #9769 → #8485line doesn't hold right now: #8485's branch doesn't contain #9769's current head.
[Automated review]
|
/approve-spec 6176b9d |
There was a problem hiding this comment.
Changes requested: two claims in the description don't match the code at this head. Both are quick edits.
Otherwise the new internal motion/morphPath.ts checks out: it stays unexported, nothing calls it yet, and the spec:AST-094 FR31 sentence has an engineering owner's approval for this head.
- Newly live check: the description says the morph-path tests are 10 and the run is 22, but
morphPath.test.tshas 11 tests at this head, so the run is 23. - Newly live check: the description says comments no longer cite a file that isn't on
main, but the JSDoc atmorphPath.test.tslines 196, 217, 240 and 270 citesmenuSurfaceMotion.ts,ContextMenuLift.tsx,zoomTransition.tsandmenuDrillInMotion.ts, none of which is onmain; narrow the claim tomorphPath.tsor drop those file names.
Claims and files checked
- Claim: the module commit keeps @vjeux as its author: verified (the commit that adds
morphPath.ts). - Claim: the module needs only
mapProgressand the animator's curve types already onmain: verified (morphPath.tsimports). - Claim: no behavior change; the module is internal and no component imports it: verified (only its test imports it; no
exportsentry reaches it). - Claim: pure geometry over a caller-supplied progress curve, so it sets no timing: verified (
morphCurvestakes the curve). - Claim: it fits the shared rectangle morph the layer-runtime record describes: verified (INV15).
- Claim: Popover keeps its own module, and its move would change its animated properties to translate and scale about 0 0: verified (
morphCurvesassumestransform-origin: 0 0; Popover scales about its edge point). - Claim: the popover proofs import Popover's live geometry: verified (test imports
popoverCollapsedState,popoverFrame,frameOf,readState,surfaceCurves). - Claim:
lerpPathandedgeGrowPathfollow the stated laws, with opacity p: verified (morphPath.tslines 78-106 and 118-164). - Claim: each path continues an interrupted motion in its own law: verified (
edgeGrowPath'srestartFrom; a path without one, likelerpPath, continues on a straight line by theMorphPathcontract). - Claim:
morphCurvesmoves only translate, scale and opacity: verified (lines 238-247). - Claim: comments no longer cite a file that isn't on
main: false (morphPath.test.tslines 196, 217, 240, 270). - Claim: Popover on
mainalready plays the edge-growth law in its own module: verified (popoverFrame,frameOf). - Claim: typecheck clean and the tests pass: the source is unchanged from the previous head, where typecheck and lint passed in CI; not rerun here.
- Claim: the tests are 10 plus 12, 22 in all: false (11 plus 12, 23).
- Claim: no public API, product behavior or visual change: verified; the description does not mention the FR31 edit.
- Claim: no internal context in public text: verified.
- Changeset: an internal
[chore]patch for core; the two paths name the rect at each progress and how an interrupted motion continues;morphCurvesmakes compositor curves; not exported and unused: verified. - File
.changeset/motion-morph-path.md: clear. - File
docs/specs/AST-094-touch-presentations/spec.md: owner-approved at this head; themotion/rectMorph.tsclause names a file not yet onmain(non-blocking). - File
packages/core/src/Popover/popoverSurfaceMotion.ts: clear (module exports only; not package surface). - File
packages/core/src/motion/README.md: clear. - File
packages/core/src/motion/morphPath.test.ts: four comments cite files not onmain(blocking only through the description claim). - File
packages/core/src/motion/morphPath.ts: clear.
| follows the sheet instead. | ||
| follows the sheet instead. `motion/morphPath.ts` gives the rect a grow-out | ||
| presentation shows at each progress (a straight line, or a popover's edge | ||
| grow); `motion/rectMorph.ts` imports it; no other motion module maps a |
|
/approve-spec 6176b9d |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft, and marking it ready for review starts it.
The new internal motion/morphPath.ts gives the shared rectangle morph its geometry, stays unexported, and nothing calls it yet; the spec:AST-094 FR31 sentence has an engineering owner's approval for this head. The two description points from the last review are fixed: the test counts now read 11 and 23, and the comment claim is scoped to morphPath.ts.
- Miss (optional): the header of
Popover/popoverSurfaceMotion.ts(@output, lines 10-12, andSYNC:, lines 16-19) does not mention the newsurfaceCurvesandreadStateexports ormotion/morphPath.test.ts, which now reads them.
Claims and files checked
- Claim: the module's commit keeps its original author: verified (the commit that adds
morphPath.ts). - Claim: it builds on the merged progress module and needs only
mapProgressand the animator's curve types: verified (morphPath.ts:22-23). - Claim: the superseded branch carries about 28,000 lines of an open chain: verified (28,036 added lines).
- Claim: the two lower stack entries named as merged have merged: verified.
- Claim: five touch presentations need the same geometry: verified as context (the test models all five).
- Claim: no behavior change; the module is internal and no component imports it: verified (only its test imports it; no
exportsentry reaches it). - Claim: pure geometry over a caller-supplied progress curve, so it sets no timing, and theme tokens or a gesture's velocity can drive it: verified (
morphCurvestakes any curve,morphPath.ts:231-249). - Claim: it fits the shared rectangle morph the layer-runtime record describes: verified (INV15).
- Claim: Popover keeps its own module, and moving it changes its animated properties to translate and scale about 0 0: verified (
morphCurvesassumestransform-origin: 0 0; Popover scales about its edge point,popoverSurfaceMotion.ts:319-320). - Claim: the popover proofs import Popover's live geometry: verified (
morphPath.test.ts:24-31). - Claim:
lerpPathis a straight line with an optional companion opacity: verified (morphPath.ts:78-106). - Claim:
edgeGrowPathfollows the stated scale, length and opacity law: verified (morphPath.ts:118-199). - Claim: each path continues an interrupted motion in its own law: verified (
edgeGrowPath'srestartFrom; a path without one continues on a straight line by theMorphPathcontract). - Claim:
morphCurvesmoves only translate, scale and opacity: verified (morphPath.ts:238-247). - Claim: FR31 ends with one sentence naming the module, its importer and that no other motion module maps a progress to a rect: verified (
spec.md:634-637). - Claim:
morphPath.ts's own comments cite no file missing frommainand no undefined law: verified. - Claim: Popover on
mainalready plays this edge-growth law in its own module: verified for the geometry;mainalso starts Popover's fade at a small opacity floor that the new path does not model. - Claim: typecheck is clean: not rerun here; typecheck passed in CI on an identical package tree.
- Claim: the tests number 11 plus 12, 23 in all: verified by count (
morphPath.test.ts,progress.test.ts); not rerun here. - Claim: lint, knowledge and changeset checks and the pre-review script pass: lint passed in CI on an identical package tree; the others were not rerun here.
- Claim: no public API, product behavior or visual change, and product changes found during the work were removed: verified.
- Claim: public text carries no internal context: verified.
- Claim: the FR31 sentence passes writing rubric items R1 to R6: verified; its importer clause names a file that lands with #9769.
- Changeset: an internal patch for core; the two paths name the rect at each progress and how an interrupted motion continues,
morphCurvesmakes compositor curves, nothing is exported and no component uses them: verified. - File
.changeset/motion-morph-path.md: clear. - File
docs/specs/AST-094-touch-presentations/spec.md: clear (owner-approved; the importer clause names a file not here yet). - File
packages/core/src/Popover/popoverSurfaceMotion.ts: the header note above; otherwise clear. - File
packages/core/src/motion/README.md: clear. - File
packages/core/src/motion/morphPath.test.ts: clear. - File
packages/core/src/motion/morphPath.ts: clear.
| * package. | ||
| */ | ||
| function surfaceCurves( | ||
| export function surfaceCurves( |
There was a problem hiding this comment.
Miss, non-blocking: this file's header still lists only popoverCollapsedState, popoverFrame and createPopoverSurfaceMotion under @output (lines 10-12), and its SYNC: list (lines 16-19) does not name motion/morphPath.test.ts, which now imports surfaceCurves and readState. Adding both exports to @output and the test to SYNC: reminds whoever edits these two functions that the morph's proofs replay them.
Supersedes #8909 by @vjeux, who stays the author of this commit. Builds on #9755 (the progress module, merged), which superseded #8497. #8909's branch carries the open chain under #8340 and #8360, about 28,000 lines. This module needs only #9755's
mapProgressand theMotionCurve/MotionPropertytypes already onmain, so this pull request is #8909's own change alone.Stack: #9764 → #9769 → #8485 and #8080 (#8078 and #8508 have merged).
Maintainer impact
Five touch presentations grow a surface out of what the finger touched and shrink it back: menus, Popover, the lifted preview, Lightbox's zoom, and a sub-menu's parent card. Each needs the same geometry: the rect the surface shows at each point of its motion, and how an interrupted motion continues. The shared rect morph builds on this.
Intended invariant
No behavior change. The module is internal, and no component imports it yet. It's pure geometry over a progress curve that the caller supplies, so it sets no timing. A tap-opened presentation can drive it with the theme's motion tokens, and a gesture can drive it from its velocity. It fits the shared rectangle morph that
architecture:layer-runtimeINV15 describes.edgeGrowPathandmorphCurvesrides feat(core): one rect morph for touch presentations that grow out of a source rect #9769's player, which owns the exit copy and the timing, and it changes Popover's animated properties (translateandscaleabout 0 0, notscaleabout its edge point). So it lands later as its own migration, with its records. The popover proofs here import Popover's livepopoverCollapsedState,popoverFrameandframeOf, so the two can't drift apart unnoticed.Change
motion/morphPath.ts, internal, with its unit test, a README row and a[chore]changeset:lerpPath: a straight line between two rects, with an optional companion opacity.edgeGrowPath: a popover's growth out of a point on its edge facing the source. At progress p, its scale across the axis away from the source is s = s₀ + (1 − s₀)·p, its scale along that axis is s·(L₀ + (1 − L₀)·p), and its opacity is p.restartFrom: the path from the rect on screen to either end, in that path's own law.morphCurves: thex,y,scaleX,scaleYand opacity curves that put the element on the path's rect as a progress curve moves. Onlytranslate,scaleandopacitymove, so the motion runs on the compositor.spec:AST-094FR31 ends with one sentence:motion/morphPath.tsgives the rect a grow-out presentation shows at each progress,motion/rectMorph.tsimports it, and no other motion module maps a progress to a rect.morphPath.ts's own comments no longer cite a file that isn't onmainyet or an undefined "law M1".Evidence
mainplays this edge-growth law in its own module (popoverSurfaceFrame.ts,popoverSurfaceMotion.ts). The rest does not exist onmain, and feat(core): the rect morph's paths, the rect a grow-out presentation shows at each progress #8909 can't merge as it stands because it carries an open chain.tscis clean, and the morph-path tests pass (11, plus feat(core): one progress module for the motion foundation #9755's 12).Scope
Testing
pnpm exec vitest run packages/core/src/motion/morphPath.test.ts packages/core/src/motion/progress.test.ts: 23 passed.pnpm exec tsc -p packages/core --noEmit: clean.pnpm check:knowledge,pnpm check:changesets: pass.pnpm review:pre: 0 findings.Writing rubric results
Record changed:
spec:AST-094FR31, one closing sentence that namesmotion/morphPath.ts.motion/rectMorph.tsimports it); no plan or history.#number,/pull/or/issues/.