Skip to content

fix(core)!: remove useContainerReveal default motion and delay - #6865

Closed
ernestt wants to merge 4 commits into
mainfrom
ernestt/remove-container-reveal-default-motion
Closed

ernestt wants to merge 4 commits into
mainfrom
ernestt/remove-container-reveal-default-motion

Conversation

@ernestt

@ernestt ernestt commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

Remove useContainerReveal's implicit motion and exit delay. This is a default timing change rather than a new capability or a restoration to an existing contract, so the general template fits better than the feature, bug-fix, or appearance-only templates.

User or maintainer impact

Every reveal, conceal, and layout-preserved variant currently inherits a tokenized opacity fade. The non-layout-preserved reveal also defers its position reset until that fade finishes. After this change, all four variants change state immediately by default.

The public API is otherwise unchanged: hoverDelay remains an explicit pointer-intent gate, and keyboard focus and coarse pointers still reveal immediately. Because this changes a stable default, the changeset is [breaking] with a minor bump under the repository's 0.x policy.

Problem and solution fit

  1. The headless hook currently owns both reveal state and a visual transition duration/easing.
  2. That makes every caller inherit motion and exit sequencing, even when row actions should switch crisply; consumers have to override the hook to remove them.
  3. A composable state primitive should not impose aesthetic timing. Callers that want motion can compose it deliberately, while hoverDelay remains available for the separate hover-intent use case.

The implementation removes the duration/easing and the exit-only position delay. It intentionally keeps transition-property, transition-delay, and allow-discrete: CSS's initial transition-duration: 0s makes the default immediate, while a nonzero hoverDelay can still postpone the zero-duration state change without JavaScript timers.

No prop, export, focus behavior, touch behavior, accessibility-tree behavior, or layout-preservation option changes.

Authority

  • spec:AST-017 governs the compatibility treatment: a stable default change is [breaking] and uses the 0.x minor tier.
  • architecture:interaction-modality requires an operable path for every modality and reachable essential actions; the existing focus-within and coarse-pointer branches remain unchanged.
  • The exact-head design:motion/DR1–DR3 record makes the owner-approved rule explicit: frequent triggers do not animate, caller-requested intent gates remain timing only, and returning to rest is immediate. DEC-1 records ernestt as decider on 2026-10-01; infrequent and spatial motion remains outside this bounded decision.

Change and evidence

  • Promoted the existing design:motion owner with the bounded frequent-trigger rule, an exact decision log, and global motion routing for DR1–DR3.
  • Removed the tokenized opacity duration, easing, reduced-motion duration branch, and exit position delay.
  • Kept hoverDelay as an explicit opt-in and documented the zero-delay default.
  • Added a regression test covering reveal, conceal, and both layout-preserved variants.
  • Updated the hook docs, Storybook guidance, and a breaking changeset.
  • Promoted the default and hoverDelay stories into the required Chromium browser guard.

Exact-head Linux Chromium at bf6c331 passed both required browser probes:

Story state Browser result
Default reveal transition-duration and transition-delay resolve to 0s; pointer entry and exit update opacity and position immediately
hoverDelay={250} Pointer entry remains at rest during the 250 ms gate, then switches with zero duration; pointer exit is immediate
Global-baseline review receipt

node scripts/review-global-baselines.mjs --authority-commit 33eb65c56865603535fdf9bad709cc3decac6bdb --review-head bf6c3312a43eb503015372f29ad3c5582d9057d8 --triggers visual,interaction,motion,accessibility,specification

  • interaction matched architecture:interaction-modality INV1, INV2, INV3, INV4, INV7, and INV8. This change leaves focus ownership and modality paths unchanged; the focused regression test keeps every reveal variant mounted and the existing keyboard/touch branches are byte-identical.
  • accessibility matched spec:AST-009 FR1-FR7 and FR9-FR16 plus spec:AST-020 FR1, FR2, and FR6. The PR makes no AT-specific role, name, focus-order, announcement, or virtual-cursor claim, so AST-009 FR2/FR7 call for proportionate DOM/CSS and browser evidence rather than a real-AT matrix.
  • specification matched architecture:knowledge-contracts DEC-9, DEC-10, INV9, INV11, INV14, INV16, INV18, INV20, and INV21. The change reuses the canonical design:motion owner, keeps one bounded current claim, routes only DR1–DR3, and leaves implementation mechanics in code and evidence.
  • visual and motion matched no current global claim at the base authority commit, where design:motion was still draft. This exact head promotes the bounded rule and adds its global motion route for subsequent reviews; the proposed head was not treated as its own authority.

Every match reason was the script's deterministic Requested trigger ... matched review-applicability:v1 claim ... route at the authority commit above.

Scope

  • This PR has one primary intent.
  • Independently removable deltas were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Exact-head GitHub Actions run 36934571644 — all automated checks passed, including test, lint, build, knowledge validation, stable visual regression, Chromium accessibility/browser guards, and RTL
  • Exact-head spec-owner-ready/ernestt and spec-owner-approval statuses — passed
  • Required Chromium guard — both useContainerReveal timing probes passed at the exact head
  • pnpm exec vitest run packages/core/src/hooks/useContainerReveal.test.tsx scripts/build-css.test.mjs — 20 passed
  • pnpm lint:strict — passed (existing repository warnings only)
  • pnpm build — passed
  • pnpm -F @astryxdesign/storybook build — passed
  • pnpm -F @astryxdesign/storybook typecheck — passed after workspace packages were built
  • pnpm check:knowledge — passed with the promoted design:motion record and DR1–DR3 global route
  • pnpm check:changesets — passed

A local full pnpm test run on macOS was not used as the repository-wide verdict because several unrelated tests require GNU cp, Linux shell-array behavior, or a watcher that timed out on that host. The exact-head Linux test check passed and is the authoritative repository-wide result.

Reveal and conceal content immediately by default while preserving hoverDelay as an explicit pointer-intent gate.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 1, 2026
@vercel

vercel Bot commented Oct 1, 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 1, 2026 10:26pm UTC

Request Review

@github-actions github-actions Bot added the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Oct 1, 2026
@astracat-bot

astracat-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Oct 30, 2026, 12:03 AM UTC

Promote the default and hover-delay Storybook interactions into the required Chromium play guard.
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

16 of 420 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Chat Full AI Chat probe light 155,733
Chat Full AI Chat probe dark 155,005
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,229
Chat With Attachments probe dark 11,065
useContainerReveal Reveal neutral light 6,901
useContainerReveal Reveal neutral dark 2,842
Markdown Default probe dark 897
Markdown Default probe light 897
Markdown Default neutral dark 882
Markdown Default neutral light 858

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

Use Playwright's trusted pointer input for CSS hover timing instead of synthetic Storybook events.
Make frequent triggers animation-free, while preserving explicit intent gates as timing-only behavior.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 1, 2026
@ernestt
ernestt marked this pull request as draft October 1, 2026 22:23
@ernestt
ernestt marked this pull request as ready for review October 1, 2026 22:23
@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 1, 2026

@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.

Thank you for making the reveal behaviour crisper and for keeping hoverDelay, keyboard focus, and touch behaviour intact. The breaking-change treatment also looks right for a stable default change.

Approval needs one maintainer decision before this can land. On current main, the motion design record is still a draft with no approver, so the new frequent-trigger no-animation rule is not yet established authority, and promoting that record in the same PR cannot authorise the default change by itself. A maintainer needs to either land or promote the bounded frequent-trigger rule as current authority through the normal owner-approval path, or point to an existing current claim that already authorises removing the default fade and exit delay.

Once that governing spec is settled, the implementation can be assessed for approval on its merits. No change to the code is being requested solely because the spec is missing.

[Automated review]

@ernestt

ernestt commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Changeset compliance

The [breaking] entry needs two corrections before merge:

  • Append (#6865) to the first body line.
  • A breaking change requires a registered codemod, focused coverage, and an explicit codemod mention in the changeset. Focused behavior coverage is present, but no codemod or codemod mention is included.

The minor bump for the pre-1.0 package is correct for [breaking] under the repository changeset rules.

@cixzhang cixzhang 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.

Thanks for the careful work here, Ernest — the implementation is clean and the tests are thorough. I'm going to decline this one as written, though, because the premise doesn't hold: the exit delay and fade in useContainerReveal aren't aesthetic timing the primitive should shed. They exist to prevent users brushing the interface from causing janky rerenders while they move their pointer — the content stays in flow for the fade's duration so a brushed-past container doesn't snap out at full opacity and flicker, and the entry dwell is the same pointer-intent gate Tooltip and HoverCard use. That's input debouncing, and it's pointer-specific by construction: keyboard focus already reveals immediately with no dwell, and coarse pointers always show the content, so nothing is being made faster for those users by removing it.

Rather than flipping the default, could you come back with the use cases this change is meant to serve — where is an immediate switch actually needed, and for which input? That tells us what the right shape is: an explicit opt-out on the hook, a different hook for a non-hover reveal, or a change at the callsite. I'd like to see the rationale recorded in the motion rule either way; I'll get the current reason into the record so it's not just in code comments.

@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.

Changes requested. The immediate default and the promoted motion rule are owner-approved for this head, but an engineering owner's request for changes is still open, and two fixes are needed either way. Please reply to that review with the use cases that need an immediate switch, then rebase onto main, where the branch currently conflicts.

  • The [breaking] changeset cannot merge while main declares a patch version (AST-017 FR31), and it names no option that restores the old timing (FR3); if the change counts as appearance only, it is a [feat] patch instead.
  • The rewrite reuses DR1–DR3 for new rules and drops DR5, while AST-094 and AST-108 on main cite DR3 and DR5 by number, so new ids or a separate record would keep those citations correct.

[Automated review]

'@astryxdesign/core': minor
---

[breaking] `useContainerReveal` now shows and hides content immediately by default instead of applying a fade and deferred position reset. Explicit `hoverDelay` remains available as an opt-in pointer-intent gate.

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.

main now declares 0.7.5, so AST-017 FR31 rejects a [breaking] entry and pnpm check:changesets fails once this branch is rebased. FR3 also asks a functional default change to name the option that restores the old default; if the timing counts as appearance only, the entry is a [feat] with a patch bump instead.

Comment thread docs/design/motion.md
Comment on lines +47 to +55
- **DR1 — Frequent triggers do not animate.** A visual state change expected to
recur repeatedly during ordinary traversal or repeated operation MUST update
without animated interpolation, fading, travel, scaling, or exit sequencing.
- **DR2 — Intent gates remain timing, not motion.** An explicit dwell or intent
gate MAY postpone pointer activation when a caller requests it. Once the gate
accepts the interaction, the visual state MUST update without animation.
- **DR3 — Returning to rest is immediate too.** A frequent trigger's exit or
cancellation MUST NOT add an animation or an exit-only delay. Leaving the
trigger returns the surface to its resting state immediately.

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.

These ids already mean other rules on main: AST-094 and AST-108 cite DR3 (easing and overshoot) and DR5 (reduced motion) by number. Giving the frequent-trigger rules their own ids, or their own record, keeps those citations true after a rebase.

@cixzhang

Copy link
Copy Markdown
Contributor

(Posted by Cindy's agent.) Thank you, @ernestt, for digging into how container reveals feel! We're not taking this one: the motion design spec (DEC-1) keeps a small entry delay on every hover-to-display surface so brushing the pointer across the UI doesn't flash content, and a container reveal's exit guard is its fade, so removing a surface's default delay and motion is outside that decision. If a crisper entry still feels right, it could be proposed as its own spec change that keeps the exit fade. Closing this for now.

@cixzhang cixzhang closed this Nov 12, 2026
@github-actions
github-actions Bot deleted the ernestt/remove-container-reveal-default-motion branch November 13, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — bf6c3312 Deployed Oct 1, 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. needs:code-review High-risk change (new package/component/API) — needs human code review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants