fix(app): run menu selections that close the menu on iOS

Selecting an item parked its action in a ref and waited for the Modal's
onDismiss to flush it. MenuOverlay returns null as soon as the menu closes, so
the Modal unmounted and onDismiss never fired: every close-on-select action was
dropped. Creating a terminal from the compact workspace menu did nothing at all.

Wait on a timer instead. The grace period was always about giving UIKit time to
tear the surface down before a native presenter launches, and a callback fired
from inside a subtree being removed is racing its own removal. The sheet had no
flush at all, so it was broken the same way for a different reason.
This commit is contained in:
Mohamed Boudra
2026-08-04 12:03:00 +02:00
parent 56cb70fa59
commit bf6cd09d6c
5 changed files with 88 additions and 38 deletions
@@ -206,7 +206,7 @@ function MenuPopoverSurface({
return (
<MenuSurfaceContext.Provider value={surfaceValue}>
<MenuOverlay visible={menu.open} onClose={handleClose} onDismiss={menu.flushPendingSelect}>
<MenuOverlay visible={menu.open} onClose={handleClose}>
<>
<AnchoredSurface
open={menu.open}