Skip to content

refactor(MobileNav): keep the closing dialog rendered through the layer runtime's presentation hold - #8590

Open
cixzhang wants to merge 1 commit into
feat/presentation-holdfrom
feat/presentation-hold-mobilenav
Open

cixzhang wants to merge 1 commit into
feat/presentation-holdfrom
feat/presentation-hold-mobilenav

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #8587 (the layer runtime's presentation hold); the base is its branch, so this diff is MobileNav's adoption alone.

What it does

MobileNav keeps its dialog rendered from the commit that closes it until its delayed close() has run (WebKit drops a closing modal <dialog> to display: none at once otherwise, leaving the page inert with nothing visible). That close hold (isCloseHeld with a wasOpen latch) now uses the layer runtime's presentation hold (Layer/presentationHold.ts, architecture:layer-runtime INV14). The hold is taken during render as MobileNav opens, so it's already held in the commit that closes. It's released after close() runs, or when nothing is open, exactly where the old hold was cleared. The drawer's transform and backdrop stay keyed to isOpen.

No behavior change

MobileNav's tests are the oracle and pass unchanged (78), including the WebKit close-hold cases. The real-browser check is MobileNav's specs, which this PR's CI runs because the change touches the MobileNav folder.

Size (gzip KB, minified)

The same method as #8587: a fresh packages/core dist at the base and at this head; esbuild bundle, minify, splitting, ESM, packages external.

Component Desktop Phone
MobileNav 35.24 → 35.33 (+0.09) 36.11 → 36.20 (+0.09)

The shared hold is about 0.1 KB, loaded once with Popover's.

Overlap

#8374 (MobileNav's touch close timing) adds a second close timer that clears the old hold. It lands first; this pull request then merges it up, and its extra release point becomes releasePresentation(). #8374 needs no change for this one.

Testing

  • pnpm vitest run --project ui packages/core/src/MobileNav: 78 pass.
  • tsc and eslint clean.
  • [chore] changeset.

…er runtime's presentation hold

MobileNav's own close hold (isCloseHeld with a wasOpen latch) kept the
dialog rendered from the commit that closes it until its delayed close()
ran. It now takes the layer runtime's presentation hold
(Layer/presentationHold): held from the open, released after close() runs
or when nothing is open, as before. No behavior change; MobileNav's tests
pass unchanged.
@vercel

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

Request Review

@astracat-bot

astracat-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 26, 2026, 9:25 PM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to merge once #8587 lands: MobileNav's close hold now comes from the layer runtime's presentation hold with no change in behavior, and the close test that guards the hold still passes. Two optional follow-ups: MobileNav.spec.md's Current-state impact could say the close hold is now the runtime's, and the size table could note that CSS is unchanged. Test and lint CI don't run for pull requests into feat/presentation-hold, so they will first run when this targets main.

[Automated review]

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

This branch was successfully deployed

1 active deployment
Preview — 5ba8d147 Deployed Oct 26, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant