Repository navigation
fix(dialog): keyboard opens and Esc closes skip motion through createSkipMotion - #163
Merged
Merged
Conversation
…open paints offstage Side Panel's entering style has no skip-motion guard (#64), so its row fails until the fix.
…SkipMotion Dialog, Alert Dialog and Side Panel roots never tracked how they opened, so a keyboard open or Esc close faded and scaled like a pointer one (#47, #64). createSkipMotion gives each popup family one root wrapper and one part hook. Dialog, Alert Dialog, Side Panel and Command Dialog share the dialog instance; Select, Combobox, Dropdown Menu and Popover drop their copied context. A finished close clears the skip, so a controlled reopen by pointer animates. Side Panel's motion moves into popupMotion with a skip guard. Sheet still slides: ui-sdk Drawer has no instant open or close. Refs #47, #64
Owner
Author
|
Verifier: PASS+NOTES on merge tree 123983c9 (ui-sdk 6be0088 + head 36dbaaa). check, build, 560 tests. Browser, real keys, 45 frames per step: Dialog, Alert Dialog, Side Panel, Command Dialog open and close instantly from the keyboard; pointer still animates; the 4 migrated popups match base; no skip state leaks; 0 console errors. Notes: tracker rows #47/#64 updated in the lead's docs commit; Sheet still slides (ui-sdk Drawer, upstream). |
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.
Why
Goal of this run: fix every bug on
ui-sdkthat we can fix on our side, so it can land onmainwith no known issues. This PR fixes #47 and #64. DESIGN.md's never-list bans motion on a keyboard action. Dialog, Alert Dialog and Side Panel faded and scaled on a keyboard open and on Esc, the same as a pointer open, because their roots never recorded how a change came about.What
createSkipMotion()inlib/constella/motion.tsx(renamed from.tsfor JSX) gives each popup family one root wrapper and one hook that its parts read fordata-skip-motion. Select, Combobox, Dropdown Menu (submenu withinherit) and Popover drop their copiedSkipMotioncontexts and use it.dialog.tsx. Command Dialog wraps ui-sdk's Dialog root, not ours, so it keeps one skip state with its ownskipsDialogMotion.onOpenChangeComplete(false)) clears the skip. Without it, a controlled Dialog reopened by pointer after an Esc close opened at once (measured).popupMotion.sidePanel, with the skip guard on its starting style.popupMotion.dialogzeroes its duration only during its own open or close, so the nested step-back still moves.motion.css.test.tsxgains Alert Dialog and Side Panel rows. The Side Panel row failed first (commit 8a1ec52). Newmotion.test.tsxpins the helper: keyboard skip, pointer animates, customskips,inherit, and the reset. Three pick tests now check the skip while the close runs, since it clears afterward.docs/design/components.md.Verification
Chromium, static build, real key presses, per-frame computed opacity and translate. Script:
~/.local/share/pw/skm-proof.mjs.Edge cases (
skm-edge.mjs, on aVITE_AGENT_BRIDGE=1build). A controlled Dialog reopened by pointer after Esc animates. Enter on Alert Dialog's Cancel closes at once. A keyboard submenu opens and closes at once. The agent confirm opened byconfirmController.open()animates, and Enter, Esc and a reopen behave the same. Pointer Allow animates. No console errors, so no skippedflushSync.vpr check,vpr test(555 passed) andvpr buildpass on 36dbaaa. Reuse reviewer verdict: CLEAN. Frame dumps, screenshots (light and dark, opened by keyboard) and the verdict are in the run'sshots/A-motion/.Tradeoffs
physics.responsewould fake it, but that is a workaround, so it's out. This needs an upstream option.popupMotion, the same bug class as fix(popup): share popupMotion, so an instant open never paints offstage #132.createSkipMotionin this PR. None is left behind.Tracker
createSkipMotion(fixes Dialog animates when opened from the keyboard or closed with Escape #47, Side Panel animates when opened from the keyboard #64). The SkipMotion root pattern cleanup (createSkipMotion) in the Cleanup row is done for Select, Combobox, Dropdown Menu and Popover.orbit:verifieron the head) is left to the lead.