Repository navigation
feat(zen): two-engine Motion with shared presets - #75
Merged
Merged
Conversation
Motion's whileTap binds pointer and Enter only. Track Space through capture handlers so a keyboard press reaches the same scale, and keep the behaviour seam asserting both keys.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ew-card # Conflicts: # apps/web/scripts/capture-examples.ts # apps/web/test/install.test.ts
Cover Popover, Dropdown Menu, Context Menu and Select in the install and capture seams: the library dependency, the snappy preset, the pointer origin, the anchor width and Select's mixed mounting.
Resolve each popup's open state with useControllableOpen and compose the snappy spring through render inside AnimatePresence. Context Menu keeps its pointer origin, Dropdown Menu its anchor width and keyboard navigation, and Select keeps Base UI's mixed mounting after the first interaction.
…components # Conflicts: # apps/web/scripts/capture-examples.ts
codingcodax
marked this pull request as ready for review
November 12, 2026 04:18
The combobox width check sampled the painted box, so an entrance scale read as a narrower popup on a slower CI runner; sample the layout width beside it. The tab highlight compared viewport boxes read at different moments, so a late scroll shift read as a misaligned indicator; compare both in one evaluation. Upload the hidden capture directory so failures are debuggable.
The settle check polled the indicator's left edge and then asserted the full box 80ms later, so a slower spring could pass the poll while its width was still travelling. Poll all four edges atomically against the selected tab, which also removes the scroll-drift comparison.
Button and Toggle used the snappy spring for press feedback. Measured: 250ms to reach 0.97 and 260ms back, while a click lasts about 100ms, so the button was still shrinking when released and lagged on the way out. Press is a tween now: 100ms down, 160ms up, shared by pointer, Enter and Space. The Motion page and the capture seam follow.
Switch stretch and Slider grab ran on springs, so both were still growing when a 100ms click ended; they use the press tween now. The Checkbox mark's pop gets a 120ms state tween and the Tabs highlight moves to snappy.
The Motion page must list Switch travel, Switch press, Checkbox state, Slider grab and Tabs highlight with a shipped preset, and the state tween must finish inside a click.
Combobox and Autocomplete no longer spring their popup size, so rows hold still under the pointer.
Select shares the menu presence shape, so its exit completes instead of keeping the popup mounted for the rest of the session.
Command now uses the smooth preset for its backdrop and popup, matching Dialog, Sheet and Alert Dialog.
Examples render a plain button with buttonVariants, so pressing an open trigger does not scale it.
Clear the settled flag when an animation starts, so a reopen mid-close stays clipped until the open settles.
…iming # Conflicts: # apps/web/test/motion.test.ts
A clicked Drawer runs at the standard duration while a swipe keeps the drawer duration, which now ships in the preset scale. Toast content and the anchored popup follow the root duration.
The capture seam samples the clip on every frame of a close and reopen, and checks the Drawer opens and closes at the standard duration and the Toast keeps one timing.
The check polled for data-ending-style, a transient attribute on a 240ms close, so a slow runner could miss it entirely. Record the computed transition durations in the exit observer that is already installed before Escape, then wait for the popup to hide.
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.
Implements #64 and every ticket in its graph.
zen now runs Motion on two engines. Springs, presses, thumbs, the tab highlight, expandables and popup enter/exit go through the
motionpackage; colour, shadow, border, hover, focus, Toast, Drawer, Sidebar, Progress and Meter stay CSS.registry:libitem,@kosori/motion, installed atlib/motion.ts, is the only item declaring themotionpackage. Animated items depend on it and nothing else.snappy,smooth,morph,responsiveandgentle; easing and duration live in CSS as--ease-*and--duration-*. No value is duplicated across engines.renderprop, with one shared presence seam, so no component gained a prop, export or DOM level.onOpenChangecancellation, controlled and uncontrolledopen, nested dialog depth and Select's mixed mount lifecycle are preserved.Closes #64
Closes #65
Closes #66
Closes #67
Closes #68
Closes #69
Closes #70
Closes #71
Closes #72
Closes #73
Closes #74
Test plan:
bun test— 61 pass, 0 fail (includes a real CLI install and Consumer typecheck)bun run check-typesbun run checkbun run visual:capture— 120/120 (60 Examples × light/dark), reduced motion asserted per Examplebun run build