Skip to content

fix(mobile): show update confirmations above the open sheet - #698

Merged
nixuuu merged 1 commit into
devfrom
fix/mobile-update-sheet
Nov 14, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/mobile-update-sheet

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 14, 2026

Copy link
Copy Markdown
Member

Problem

On mobile, tapping Update on a computer (or Update all) in the update sheet did nothing. After the user closed the sheet, the app stopped responding to touch.

Root cause

  • Update did nothing. Since fix(updates): update paired desktop apps from mobile and web #536, computer/app updates (and since fix(updates): update every computer and agent CLI #669, Update all with a home app restart) need a restart confirmation. confirmAppUpdate calls the shared confirm(), whose single ConfirmHost is mounted at the app root. Its React Native Modal is presented from the root view controller (RCTModalHostViewComponentView presentViewController → [self reactViewController]) while that controller is already presenting the update sheet's Modal. UIKit refuses the second presentation, so no dialog appears and the confirmed request is never sent. The gateway path (ManageUpdates, owner scoping, confirm_restart) is the one web uses and is unchanged; worker updates, which need no confirmation, were not affected.
  • Invisible touch blocker. React Native sets _isPresented = YES before UIKit refuses the presentation and never resets it, so the confirmation stays mounted in a "presented" state that nobody can close. The orphaned transparent modal is what is left behind after the sheet closes. I couldn't confirm the exact UIKit sequence on a device; the device host is unavailable. The same structure has another trap: dismissing a parent modal while a modal nested in it is still presented makes UIKit dismiss only the topmost one, which leaves the parent on screen, invisible and catching touches. BotSettingsExtras (confirmations inside Bot settings) had the same pattern.

Fix (JS only)

  • ui/overlay-stack.ts registers every Overlay with its parent overlay (or the app window) and a phase: waiting, shown or closing.
  • Sibling overlays take turns. A waiting overlay presents only when no sibling is on screen or still dismissing, and only while its parent is open. "Gone" means native dismissal (iOS Modal.onDismiss, the Android commit), with a 1 s fallback so a lost callback can't block later overlays.
  • A parent keeps its native modal while nested overlays are attached, so UIKit never dismisses the wrong one.
  • confirm() renders inside the topmost open overlay: OverlayLayer renders ConfirmHost in every Overlay. The dialog appears above the update sheet, and the sheet stays open to show progress. If the host closes before the dialog appears, the dialog moves down a level (picker → root, after the picker is gone). If the host closes under the dialog, the dialog is cancelled.
  • While ManageUpdates is in flight (up to 150 s), the sheet shows "Starting update…". Then the rows show progress and the result, and UpdateFeedback shows errors with details.
  • Docs: docs/mobile.md (overlay ordering) and docs/updates.md (mobile confirmation).

Verification

  • bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check: clean.
  • expo export for iOS and Android: both pass.
  • expo-updates fingerprint:generate: iOS 138e0c6b171c82b4933e86808cdfef56da73b8c6, Android 906dc944f94eb8333fa384ed9f198834fdd30d13. These are identical to dev, so the fix ships OTA.
  • No gateway, contract or web code changed, so no gateway integration test and no web build. check:tmp was not run, since no server code changed.
  • Not device-verified: the device host reports "Could not communicate with device support".

Please re-test on a device (iOS first, then Android)

  1. Open Updates from the sidebar. Tap Update on a linked computer (or this computer's app). A "Update “Name”?" dialog appears above the sheet.
  2. Tap Cancel. The dialog closes, the sheet stays open and responds to touch. Close the sheet. The app responds everywhere.
  3. Repeat and tap Update computer. The sheet shows "Starting update…", then the row's progress or state (Queued/Downloading…/Restarting…), or a red error with details.
  4. With an unsent draft or attachment, tap Update on this computer. The sheet shows "Send or discard your drafts and files before updating this computer."
  5. Update all (when this computer's app has an update): same as 1–3, with "Update all?".
  6. Tap Update on a worker. The request goes out without a dialog and the row shows progress.
  7. Dialogs over other sheets:
    • Bot settings → Delete/Archive (confirmation inside the sheet).
    • Bot actions menu → Delete bot (menu closes, then the dialog appears).
    • Thread actions → Delete.
      After each: Cancel and Confirm, close everything, then check that the whole app responds to touch.
  8. Open a confirmation inside Bot settings, then swipe the sheet down if possible, or background and resume the app. There should be no frozen screen.

Copy audit (docs/copy.md §8)

  • New: Starting update…. Before, nothing was shown while the request ran. It is a progress state (§4.6: -ing verb plus ellipsis), in sentence case, a polite live region, and doesn't repeat the row badges.
  • Existing confirmation texts are unchanged: the title is a question and the button repeats its verb.
  • Short, typical and long computer names: the dialog uses the existing wrapping layout, not checked on a device (see above).

Fixes: #536
Related: #669

Tapping Update on a computer, or Update all, in the mobile update sheet
called confirm(). The shared ConfirmHost presented its React Native Modal
from the app window while the update sheet's Modal was still presented.
UIKit refuses a second presentation from a view controller that is
already presenting, but React Native marks the refused modal as
presented. Nothing appeared, no request was sent, and the orphaned modal
was left behind, which matches the touch blocker reported after closing
the sheet. Bot settings had the same pattern.

Overlays now register in ui/overlay-stack.ts with their parent overlay.
Sibling overlays take turns: one presents only after the previous
sibling is gone natively (iOS Modal.onDismiss, Android commit, 1 s
fallback). A parent keeps its native modal while nested overlays are on
screen, because UIKit would dismiss only the topmost one. confirm()
renders inside the topmost open overlay, so the dialog appears above the
update sheet, which stays open. While the gateway handles the request,
the sheet shows "Starting update…", then progress, the result or an
error.

Fixes: #536
Related: #669
@nixuuu
nixuuu merged commit a0e8af8 into dev Nov 14, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/mobile-update-sheet branch November 14, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant