Repository navigation
refactor(MobileNav): keep the closing dialog rendered through the layer runtime's presentation hold - #8590
refactor(MobileNav): keep the closing dialog rendered through the layer runtime's presentation hold#8590cixzhang wants to merge 1 commit into
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
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]
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>todisplay: noneat once otherwise, leaving the page inert with nothing visible). That close hold (isCloseHeldwith awasOpenlatch) now uses the layer runtime's presentation hold (Layer/presentationHold.ts,architecture:layer-runtimeINV14). The hold is taken during render as MobileNav opens, so it's already held in the commit that closes. It's released afterclose()runs, or when nothing is open, exactly where the old hold was cleared. The drawer's transform and backdrop stay keyed toisOpen.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/coredist at the base and at this head; esbuild bundle, minify, splitting, ESM, packages external.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.[chore]changeset.