Repository navigation
spec(AST-090): exits ship off, and a theme turns them on for dialogs and layers - #8003
Conversation
|
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.
Approval of this draft record waits on an engineering owner's decision on its new requirements and decisions (FR1–FR12, DEC-1–DEC-4 and Platform support); an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Before that approval, the record needs one revision, so the approval should name the revised head:
- FR5 keeps every leaving surface on the Escape stack, including Tooltip, which contradicts
spec:AST-003FR4 and DEC-1 (a Tooltip never shields the surface beneath it); scope FR5 to dismissal owners and addspec:AST-003to Current-state impact. - Current-state impact should say that
component:Dialog's visibility concept gains a leaving phase, since a Dialog its caller has closed stays presented until its exit ends. - The non-goal crediting
design:motionwith a hover-summoned entrance should drop the owner, since that record does not define one.
[Automated review]
PR Analysis ReportView Storybook for this PR · View Sandbox for this PR
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Approval of this draft record waits on an engineering owner's decision on its new requirements and decisions (FR1–FR12, DEC-1–DEC-4 and Platform support); an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. The FR5 Tooltip, Dialog visibility and non-goal fixes are in; one more revision is needed first, so the approval should name the revised head:
- Say whether a leaving Dialog keeps the modal outlet toasts render into: as written, FR4 and FR6 leave a toast unpressable until the Dialog is hidden, while Current-state impact says no
spec:AST-003claim changes (FR16 keeps toasts operable above the current modal).
[Automated review]
There was a problem hiding this comment.
Approval of this draft record waits on an engineering owner's decision on its new requirements and decisions (FR1–FR13, DEC-1–DEC-4 and Platform support); an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. The revisions requested on earlier heads, including keeping toasts operable above a leaving Dialog (FR13), are in, and no other change is needed at this head.
[Automated review]
Exact decision needed
Whether components that animate in may animate out, who turns that on, and how a surface behaves while it leaves.
Twelve components play an entrance and then vanish when they close: the Dialog family (
Dialog,AlertDialog,CommandPalette) and every layer that plays the shared layer entrance (Popover,Tooltip,HoverCard,DropdownMenuand its sub-menus,ContextMenu,Selector,ComplexSelector,PowerSearch, andBreadcrumbItemmenus). The Dialog backdrop does not animate at all. No record decides whether these surfaces exit, how a theme controls it, or what a closing surface does with focus, Escape, and input while it is still on screen.Existing authority searched
design:motion(draft; ernestt, cixzhang): DR1, DR2, and DR5 cover exits as intent. Its content boundary excludes tokens, animation APIs, and component behavior, so it cannot hold this decision.architecture:theme-tokens(current): owns the token vocabulary, not which components read a token or what they do while they close.architecture:layer-runtime(current): owns hosting, promotion, positioning, and close reconciliation; it has no exit phase.family:overlay-dismissal(current): AV6 leaves animation to each member; FR2 constrains what an Escape press may do during an exit.spec:AST-003(current): FR1 gives every registered surface an interaction role (active owner, blocking owner, or passive dependent), and FR4 and DEC-1 keepTooltippassive, so a leaving tooltip must not shield anything. FR16 and FR18 keep toasts operable above the current native modal through the outlet each active native modal supplies;architecture:layer-runtimerecords that a closing BottomSheet releases its outlet when it starts closing.motion› Movement Principles: tooltips, hover cards, and menus may disappear instantly; an exit is animated when it orients, such as a dialog revealing what it covered.apps/sandbox/src/app/(sandbox)/pages/motion-lab/): its exit-gap audit, its proposed semantic motion tokens, and its presence plan. It is not a record. This spec builds on it (see below).useContainerRevealdefault motion). None settles exits, and this spec does not change entrances.--ease-exit,--duration-exit,layerAnimations,useEntryAnimation, presence, close animation.A new system record is needed because the switch is read by a dozen components through two shared primitives (
Dialogand the layer runtime), and the one design record that covers motion excludes tokens and behavior.Decision
Proposed, pending review by the motion owners (ernestt, cixzhang):
--duration-exit-dialogand--duration-exit-layerdefault to0ms, so nothing closes differently until a theme sets one (FR1, FR2, DEC-1, DEC-2).--ease-exitiscubic-bezier(0.3, 0, 0.6, 0.6), the curveBottomSheetalready closes on.--duration-exitisvar(--duration-fast), the standard dismissal duration a theme points a kind at (FR3, FR12, DEC-3).overlaywithallow-discrete). Elsewhere a layer closes at once, the same as the default. Dialog exits play in every supported browser (Platform support, DEC-4).How this builds on the Motion Lab
It uses the lab's names and values for the exit (
--ease-exit, promoted fromBottomSheet;--duration-exitas an alias of--duration-fast), its rule that an exit retraces the entrance on the exit curve, its CSS approach for layers, and its Dialog behavior (panel and backdrop both leave; focus waits).It adds one thing: a switch per kind of surface. The lab decides in code which surfaces exit (dialogs yes; tooltips, menus, and selectors no). Here the theme decides, and every exit ships off. With a kind turned on at
var(--duration-exit), the lab's triage becomes the recommended theme setting, and OQ1 asks whether dialog exits should eventually ship on.Rejected alternatives
spec:AST-002FR3) and cannot reach layers that other components compose, such as everytooltipprop.--ease-standard: a decelerating curve spends the travel before the eye can follow it, which is whyBottomSheetcloses on its own curve.Claim scope and non-goals
The record governs the exit switches and vocabulary, exit motion for dialog and layer surfaces, how a leaving surface behaves, and where layer exits play. It does not change:
Drawer,BottomSheet,MobileNav,Toast, theTopNavMegaMenupanel);BottomSheet's close only reads the new token at its current value;FieldStatus(OQ2);Evidence and implementation relationship
Source audit on current
main:Dialogplays a keyframe entrance and closes withdialog.close()in the same effect that seesisOpenturn false, so the panel and backdrop disappear in one frame.Layer/layerAnimations.stylex.tsdefines entrances only.useLayer'shide()callshidePopover(), and an auto popover's light dismissal hides it before Core hears of it, so only CSS can animate that close.Drawerholds its native host open until its own transition ends, with a timer backstop, then hides and returns focus in one task;TopNavMegaMenualready animates a popover out with:popover-openand discreteoverlay/displaytransitions;BottomSheetcloses oncubic-bezier(0.3, 0, 0.6, 0.6).Implementation follows in separate pull requests once this is approved:
--ease-exit, withBottomSheetreading it (no visual change): feat(tokens): add --ease-exit, the curve BottomSheet already closes on #8004.Drawer's, adopted byDrawerwithout behavior change.--duration-exit-dialog.useLayer, behind--duration-exit-layer.Writing rubric results
Rejected:line inside DEC-1 (two), DEC-2, DEC-3, and DEC-4.#followed by digits,/pull/, and/issues/).Scope
overlaywithallow-discreteis named only as the browser capability that decides where layer exits play.)Validation
pnpm check:knowledge, andnode scripts/check-knowledge.mjs --base origin/main: aligned.git diff --check: clean.