feat(booker): animate step 1→2 with motion instead of custom SizeTransition#814
Draft
pasqualevitiello wants to merge 20 commits into
Draft
feat(booker): animate step 1→2 with motion instead of custom SizeTransition#814pasqualevitiello wants to merge 20 commits into
pasqualevitiello wants to merge 20 commits into
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Co-Authored-By: pasquale <pasqualevitiello@gmail.com>
Co-Authored-By: pasquale <pasqualevitiello@gmail.com>
…esence crossfade Co-Authored-By: pasquale <pasqualevitiello@gmail.com>
Co-Authored-By: pasquale <pasqualevitiello@gmail.com>
Co-Authored-By: pasquale <pasqualevitiello@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the hand-rolled
SizeTransitionprimitive withmotionfor the Booker step 1 (select) → step 2 (confirm) card resize. Reverts the twoSizeTransitioncommits (527060a9,f22fbde7) back to thea72a4b26state, then animates the step container directly.Motivation: the custom impl cross-faded a
cloneNode(true)snapshot of the outgoing step, a visual-only copy that dropped runtime state — most visibly, scrolling the time list and picking a slot snapped the clone back toscrollTop: 0, causing a jump on transition start (plus focus/media/portals and duplicate DOMids). Hardening it would have re-implemented a worseAnimatePresence.motionanimates the real, mounted nodes, so that whole class of bugs goes away.Approach
motion'slayoutprop fakes size changes withtransform: scale— it snaps the box to its final size and scales, so the surrounding layout doesn't actually resize and you get a visible scale/distortion. Instead this drives the realwidth/heightwith a FLIP measure + imperativeanimate(), whileAnimatePresencecross-fades the two mounted panels:Behavior mapping to the request:
opacityinitial/animate/exiton the keyed panels;mode="popLayout"overlaps them (simultaneous cross-fade) and freezes the exiting panel's box.width/heightviaanimate()(notransform, no scale, no slide); the card box genuinely resizes so the meta side follows.overflow-clipon the container.reducedMotion="user"for the opacity, and the sizeanimate()usesduration: 0whenprefers-reduced-motion: reduce.Kept the design-system easing/duration (
duration 0.45,cubic-bezier(0.32,0.72,0,1)).LazyMotion+domMaxkeeps the feature bundle code-split (domMaxrequired forAnimatePresencepopLayout). Pinnedmotion@12.42.0(exact).Advice on the "animate the Card instead of the steps container" option: keeping it on the steps container is better — the Card's meta column is fixed-width, so animating the container avoids the meta side scaling/reflowing; only the step region should move.
Registry: added
"motion"to thebooker-1atomdependenciesand regeneratedpublic/r.Notes:
registry:validate-depsfailure fortableis unrelated (present on the base branch) and left untouched.Link to Devin session: https://app.devin.ai/sessions/0e0c577537ce42fdac18e9eec4224bbc
Requested by: @pasqualevitiello