Skip to content

fix(modal): render cutover modal inline to fix Android New-Arch login freeze - #673

Merged
islandbitcoin merged 1 commit into
mainfrom
fix/cutover-modal-android-offscreen-freeze
Jul 23, 2026
Merged

islandbitcoin merged 1 commit into
mainfrom
fix/cutover-modal-android-offscreen-freeze

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

Problem

On Android, immediately after login the app shows a distorted modal whose dismiss button is off-screen; its backdrop keeps capturing touches, so the entire app freezes. Only killing and relaunching clears it.

Root cause

CashWalletCutoverModal auto-shows once after login for any account created before the cash-wallet cutover (CashWalletCutoverModal.tsx:35, mounted at home-screen.tsx:163). It's a bottom-anchored react-native-modal — style: { justifyContent: "flex-end", margin: 0 }.

Under the New Architecture, react-native-modal (coverScreen defaults to true) renders through the core RCTModalHostView. Commit #545 (New-Arch enablement) already documented this component as "broken on Android with Fabric (RN 0.76.9)": it mis-measures the flex:1 content container. With justifyContent: "flex-end" the sheet is positioned below the visible viewport, while the full-screen backdrop still renders on top and swallows every touch → distorted, unreachable OK button, frozen app. A restart skips the login→home transition during which the host is mis-measured, which is why it appears to "fix" itself.

Centered modals tolerate the mis-measurement (a centered card stays roughly on-screen); only bottom-anchored sheets get pushed off.

Fix

+ coverScreen={false}

This takes react-native-modal's inline render path (modal.js:536, if (!coverScreen …)) instead of the broken native host, so layout measures correctly and the sheet stays on-screen and dismissable. A library bump won't help — 14.0.0-rc.1 is already the latest and has no Fabric fix.

Wider context (not fixed here)

#545 originally added a portal-based workaround for this exact Fabric bug and then removed it in the same series (* remove ModalPortal). So other bottom-anchored react-native-modal usages across the app are likely affected too. This PR fixes the one that auto-fires on login (highest impact — every returning pre-cutover user hits it); the rest are tracked as a separate modal-audit sweep.

Testing

  • Android device (New Arch), account created before cutover, hasSeenCashWalletCutoverModal unset: log in → the sheet renders on-screen and is dismissable; app not frozen.
  • iOS regression: modal still appears and dismisses (behavior unchanged).

The defect is a native/Fabric layout measurement, so a JS unit test can't reproduce it; the on-device check above is the meaningful guard.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg

CashWalletCutoverModal auto-shows once after login for accounts created
before the cash-wallet cutover. It is a bottom-anchored react-native-modal
(style justifyContent: "flex-end", margin: 0). On Android under the New
Architecture, react-native-modal renders through RCTModalHostView, which
#545 already documented as broken on Fabric: it mis-measures the flex:1
content container, so the sheet is positioned below the visible viewport
while its full-screen backdrop keeps capturing touches. The dismiss button
is unreachable and the app appears frozen; only a restart clears it.

Fix: pass coverScreen={false} so react-native-modal takes its inline render
path instead of the broken native host, measuring layout correctly and
keeping the sheet on-screen and dismissable.

The portal-based workaround #545 added for this exact Fabric bug was removed
in the same series, so other bottom-anchored react-native-modal usages are
likely affected too; those are tracked separately as a modal-audit sweep.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg
@islandbitcoin
islandbitcoin force-pushed the fix/cutover-modal-android-offscreen-freeze branch from 2423746 to 096a8ab Compare July 23, 2026 16:36
@islandbitcoin
islandbitcoin merged commit d74e7cf into main Jul 23, 2026
9 checks passed
bobodread876 pushed a commit that referenced this pull request Aug 19, 2026
…, single source

Review fixes for PR #701:

- coverScreen={false} on the mandatory-update modal. It was the only
  react-native-modal in the tree without it — the exact omission #673/#674 fixed
  for seven other modals to stop the Fabric/New-Arch freeze on Android. Its
  children are flex-filled with a bottom-pinned spacer, so RCTModalHostView
  would push "Tap here to update" and "Contact Support" off-screen while the
  opaque backdrop keeps eating touches: an unescapable white screen on a modal
  with no dismiss, no backdrop press and a swallowed hardware back button.
  Because the inline path makes paint order follow sibling order, <AppUpdateGate />
  now mounts as the last child in app.tsx instead of ahead of RootStack.

- The store-link failure is rendered inside the modal instead of a toast.
  toastShow is dropped when a modal is already up (FIXME in utils/toast), so on
  the blocking path a failed openURL was a silent no-op with no way out.
  AppUpdateGate holds the openFailed state; the banner keeps the toast, which is
  reachable there.

- One version check for the whole app. AppUpdateProvider owns the query
  subscription and the AppState listener; the gate and the home banner consume
  it. Previously each mounted its own hook — two sources of truth for "am I
  blocked?", with the banner re-deriving the gate's negation.

- Release checklist + preflight for the deploy-order dependency. The served
  mobileVersions payload lives in lnflash/deployments, so a stale floor
  hard-blocks the whole install base at launch (prod currently serves min 362
  against builds android 89 / ios 51). docs/release.md now carries the step, and
  `yarn check:version-gate [--api <url>]` compares the served payload against
  this checkout's build numbers and exits non-zero when the gate would block the
  release.

Tests:
- pin coverScreen={false} on the gate's modal
- foreground re-check now asserts the refetched payload actually flips the gate
  (rerender case) plus an end-to-end case over a real Apollo link with two
  sequential responses
- Android store-link coverage in a sibling spec (isIos is captured at module
  load), for both the blocking modal and the banner
- inline failure message replaces the toast assertion on the blocking path, and
  the banner's toast keeps its own case
- one AppState listener for the tree, and a consumer without the provider throws
- version-gate parsing/comparison unit tests
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