Skip to content

spec(AST-090): exits ship off, and a theme turns them on for dialogs and layers - #8003

Merged
kentonquatman merged 3 commits into
mainfrom
spec/exit-motion
Oct 26, 2026
Merged

kentonquatman merged 3 commits into
mainfrom
spec/exit-motion

Conversation

@kentonquatman

@kentonquatman kentonquatman commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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, DropdownMenu and its sub-menus, ContextMenu, Selector, ComplexSelector, PowerSearch, and BreadcrumbItem menus). 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 keep Tooltip passive, 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-runtime records that a closing BottomSheet releases its outlet when it starts closing.
  • Consumer docs, 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.
  • The Motion Lab in the sandbox app (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).
  • Open pull requests: [Spec] motion DEC-1: every hover-to-display interaction is debounced #7327 (motion DEC-1, hover entry delay), docs(design): a hover-summoned layer enters as local feedback (motion DEC-2, draft) #7367 (motion DEC-2, hover-summoned entrance), fix(core)!: remove useContainerReveal default motion and delay #6865 (useContainerReveal default motion). None settles exits, and this spec does not change entrances.
  • Search terms: exit animation, exit motion, exit transition, --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 (Dialog and 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):

  • Exits ship off; a theme turns them on, per kind. --duration-exit-dialog and --duration-exit-layer default to 0ms, so nothing closes differently until a theme sets one (FR1, FR2, DEC-1, DEC-2).
  • An exit retraces its entrance on an accelerating curve. --ease-exit is cubic-bezier(0.3, 0, 0.6, 0.6), the curve BottomSheet already closes on. --duration-exit is var(--duration-fast), the standard dismissal duration a theme points a kind at (FR3, FR12, DEC-3).
  • A leaving surface: takes no input (FR4), keeps its dismissal role until it is hidden, so a closing dialog or popover still takes Escape while a closing tooltip stays passive (FR5), hands focus back at the close for a layer and after the dialog is hidden for a dialog (FR6), fires callbacks at the request (FR7), reopens without a flash (FR8), is never stranded past its duration plus 100ms (FR9), closes at once under reduced motion (FR10), keeps its content until it is hidden (FR11), and, for a dialog, keeps supplying its modal outlet so toasts stay operable above it until it is hidden (FR13).
  • Layer exits play only where the browser can keep a closing layer in the top layer (a transition of overlay with allow-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 from BottomSheet; --duration-exit as 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

  • An exit prop on each component: it puts an implementation value on every call site (spec:AST-002 FR3) and cannot reach layers that other components compose, such as every tooltip prop.
  • Exits on by default in this release: a visual change to every dialog and layer at once.
  • One switch for every surface: a theme could not animate dialog exits without also animating every tooltip and menu, against the motion docs.
  • The entrance played backwards on --ease-standard: a decelerating curve spends the travel before the eye can follow it, which is why BottomSheet closes on its own curve.
  • Core-owned outside-press handling so layer exits play in every browser: it would replace native light dismissal across the layer runtime.

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:

  • surfaces that already animate out (Drawer, BottomSheet, MobileNav, Toast, the TopNavMegaMenu panel); BottomSheet's close only reads the new token at its current value;
  • layers with no entrance today, or elements in page flow such as FieldStatus (OQ2);
  • any entrance, including the hover-summoned entrance in docs(design): a hover-summoned layer enters as local feedback (motion DEC-2, draft) #7367 and the Dialog backdrop's entrance;
  • the rest of the Motion Lab's semantic vocabulary (entry, movement, and state curves; enter, overlay, and reveal durations).

Evidence and implementation relationship

Source audit on current main:

  • Dialog plays a keyframe entrance and closes with dialog.close() in the same effect that sees isOpen turn false, so the panel and backdrop disappear in one frame.
  • Layer/layerAnimations.stylex.ts defines entrances only. useLayer's hide() calls hidePopover(), and an auto popover's light dismissal hides it before Core hears of it, so only CSS can animate that close.
  • Drawer holds its native host open until its own transition ends, with a timer backstop, then hides and returns focus in one task; TopNavMegaMenu already animates a popover out with :popover-open and discrete overlay/display transitions; BottomSheet closes on cubic-bezier(0.3, 0, 0.6, 0.6).

Implementation follows in separate pull requests once this is approved:

  1. --ease-exit, with BottomSheet reading it (no visual change): feat(tokens): add --ease-exit, the curve BottomSheet already closes on #8004.
  2. A shared presence hook taken from Drawer's, adopted by Drawer without behavior change.
  3. Dialog family exit and backdrop fade, behind --duration-exit-dialog.
  4. Layer exits in the shared layer styles and useLayer, behind --duration-exit-layer.

Writing rubric results

  • R1 narration: scanned for proposes, previously, now, decided, today, and will, including the revisions to FR4, FR5, FR13, the non-goals, and Current-state impact; none in the record. Requirements and decisions are written in the present tense.
  • R2 research in the record: none. The source audit and the Motion Lab comparison live in this description; DEC-3 keeps one sentence of the conclusion behind the exit curve.
  • R3 evidence naming a change: none. Verification rows name tests and states.
  • R4 rejected alternatives over one line or outside a decision: five, each a single Rejected: line inside DEC-1 (two), DEC-2, DEC-3, and DEC-4.
  • R5 pull request or issue references remaining: none (searched # followed by digits, /pull/, and /issues/).
  • R6 ruled open questions still listing options: none ruled. OQ1 is open and lists its options; OQ2 is open.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract. (overlay with allow-discrete is named only as the browser capability that decides where layer exits play.)
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge, and node scripts/check-knowledge.mjs --base origin/main: aligned.
  • Prettier: clean.
  • git diff --check: clean.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 23, 2026
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 24, 2026 3:30am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 24, 2026, 3:51 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-003 FR4 and DEC-1 (a Tooltip never shields the surface beneath it); scope FR5 to dismissal owners and add spec:AST-003 to 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:motion with a hover-summoned entrance should drop the owner, since that record does not define one.

[Automated review]

Comment thread docs/specs/AST-090-exit-motion/spec.md Resolved
Comment thread docs/specs/AST-090-exit-motion/spec.md Resolved
Comment thread docs/specs/AST-090-exit-motion/spec.md Resolved
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

View Storybook for this PR · View Sandbox for this PR

Current run: The current change has no visual or preview-producing scope. Visual checks are not applicable; preview links are not shown.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-003 claim changes (FR16 keeps toasts operable above the current modal).

[Automated review]

Comment thread docs/specs/AST-090-exit-motion/spec.md Resolved

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@kentonquatman
kentonquatman merged commit f09d083 into main Oct 26, 2026
65 checks passed
@github-actions
github-actions Bot deleted the spec/exit-motion branch October 27, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — b0bc5776 Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant