Skip to content

fix(modal): render remaining bottom-anchored modals inline (Android New-Arch sweep) - #674

Merged
islandbitcoin merged 1 commit into
mainfrom
fix/modal-sweep-coverscreen
Jul 23, 2026
Merged

islandbitcoin merged 1 commit into
mainfrom
fix/modal-sweep-coverscreen

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

What & why

Companion sweep to #673 (the CashWalletCutoverModal login-freeze fix). Same root cause, remaining instances.

Under the New Architecture, react-native-modal renders through the core RCTModalHostView, which commit #545 documented as broken on Android/Fabric — it mis-measures the flex:1 content host. Any bottom-anchored sheet (justifyContent: "flex-end", or content bottom-pinned via a flex:1 spacer) is positioned off-screen while its full-screen backdrop keeps capturing touches → unreachable controls, frozen app. #545 built a portal workaround for this and removed it in the same series, so these are unprotected.

The confirmed fix is coverScreen={false}, which takes react-native-modal's inline render path (modal.js:536) instead of the broken native host, so layout measures correctly.

Changes — 6 confirmed bottom-anchored modals

File Why affected Notable
modal-tooltip.tsx flex-end sheet Reused across many screens; was coverScreen={true}
contact-modal.tsx flex-end sheet
reports-modal.tsx flex-end sheet
home-screen/AccountCreateModal.tsx bottom-pinned via flex:1 spacer Shows on "need wallet"
modal-nfc.tsx bottom-pinned via flex:1 spacer Auto-shows on Android during NFC scan
earns-screen/earns-quiz.tsx bottom-pinned quiz card

Each change is a single coverScreen={false} prop with a short comment.

Deliberately NOT changed

  • Centered modals (library-default justifyContent, ~15 files): tolerate the mis-measurement, not affected.
  • merchant-suggest-modal.tsx: top-anchored (flex-start) — stays on-screen even when mis-measured.
  • Core React Native <Modal> usages (~20): hit the same broken host but cannot take coverScreen. Several are bottom-sheets on core flows (receive, transfer). These need a different remedy (restore a portal, or migrate) and are tracked separately — out of scope here.

Testing

Manual Android (New Arch) device pass — each modal opens on-screen with reachable controls and no freeze:

  • Tooltip (any ? info icon)
  • Contact options modal
  • Reports modal
  • "Need wallet" create-account modal (home)
  • NFC scan modal (Flashcard tap)
  • Earns quiz modal

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

Scope note

Pre-existing eslint debt in some of these files (unused vars, no-alert, no-explicit-any, unspaced comments) is left untouched to keep the diff to the fix. Verified: the added lines introduce no new lint errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg

…rch layout

Sweep companion to the CashWalletCutoverModal fix. Under the New
Architecture, react-native-modal renders through RCTModalHostView, which
#545 documented as broken on Android/Fabric: it mis-measures the flex:1
content host, so any bottom-anchored sheet (justifyContent: flex-end, or
content bottom-pinned via a flex spacer) is positioned off-screen while its
full-screen backdrop keeps capturing touches — unreachable controls, frozen
app. #545's portal workaround was removed in the same series, leaving these
unprotected.

Adds coverScreen={false} (react-native-modal's inline render path) to the
six confirmed bottom-anchored modals:

- modal-tooltip (reused across many screens; was coverScreen=true)
- contact-modal, reports-modal (flex-end sheets)
- home-screen/AccountCreateModal (bottom-pinned; shows on "need wallet")
- modal-nfc (bottom-pinned; auto-shows on Android during NFC scan)
- earns-screen/earns-quiz (bottom-pinned quiz card)

Reviewed and intentionally left unchanged: centered modals (default
justifyContent) tolerate the mis-measure; merchant-suggest-modal is
top-anchored (flex-start) so it stays on-screen. Core react-native <Modal>
usages hit the same broken host but cannot take coverScreen and need a
separate remedy — tracked separately, not in this PR.

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/modal-sweep-coverscreen branch from 0179b19 to 535ae40 Compare July 23, 2026 17:23
@islandbitcoin
islandbitcoin merged commit a8474ec 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
islandbitcoin pushed a commit that referenced this pull request Oct 4, 2026
… in reach

Android has no system NFC sheet, so the Flashcard provider shows its own
("Ready to Scan" with a Cancel) while a read waits for a card. It was a
transparent core React Native Modal with a bottom-pinned sheet, the case
the Fabric Modal host measures wrongly on Android (#545): on the Pixel only
part of the NFC illustration showed, top-left, with no backdrop, no text
and no Cancel. Back was the only way out.

The sheet now renders inline through react-native-modal (coverScreen
false), as modal-nfc does since #674, in a full-size frame the provider
wraps around the app. A SafeAreaView keeps Cancel above the navigation bar
under Android 16's edge-to-edge. Cancel, Back and a tap on the backdrop
each end the read. iOS keeps its system sheet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
islandbitcoin added a commit that referenced this pull request Oct 5, 2026
… in reach (#751)

* fix(flashcard): render the Android NFC scan sheet inline, with Cancel in reach

Android has no system NFC sheet, so the Flashcard provider shows its own
("Ready to Scan" with a Cancel) while a read waits for a card. It was a
transparent core React Native Modal with a bottom-pinned sheet, the case
the Fabric Modal host measures wrongly on Android (#545): on the Pixel only
part of the NFC illustration showed, top-left, with no backdrop, no text
and no Cancel. Back was the only way out.

The sheet now renders inline through react-native-modal (coverScreen
false), as modal-nfc does since #674, in a full-size frame the provider
wraps around the app. A SafeAreaView keeps Cancel above the navigation bar
under Android 16's edge-to-edge. Cancel, Back and a tap on the backdrop
each end the read. iOS keeps its system sheet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(flashcard): press Back through BackHandler, under the real navigation container

Review fixes for #751.

- Back: the spec called the sheet's onBackButtonPress prop, so it could not
  see how Back really arrives. Inline there is no native dialog to catch it;
  react-native-modal's BackHandler listener does, and BackHandler runs the
  newest listener first. The spec now presses Back through React Native's own
  BackHandler mock, and again under the app's real NavigationContainerWrapper
  over a two-screen stack: with the sheet up, Back ends the read and the card
  screen stays; with the sheet down, Back pops the screen. Making the
  wrapper's getInitialURL synchronous fails that test.
- Inline: the test only read the coverScreen prop. It now asserts no core
  Modal is in the tree while the sheet is up, as
  app-update-inline-modal.spec.tsx does.
- Backdrop: pressed where react-native-modal draws it, not through the prop.
- Comments at the sheet and at FlashcardProvider in app.tsx say why the
  provider has to stay inside NavigationContainerWrapper.

No runtime change: the app bundle is byte-identical to the previous commit's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(flashcard): pin the scan sheet's bottom inset and app frame

Review fixes for #751.

The Pixel was not attached, so the device check ran on an API 35
emulator instead (Pixel 7 Pro profile, Fabric, a debug build of this
branch, NFC faked in JS for the run and not committed). The sheet drew
right in gesture and in 3-button navigation: dimmed backdrop, "Ready to
Scan", and Cancel ending one navigation-bar height plus the sheet's 20 dp
padding above the bottom. Cancel, Back and a backdrop tap each closed it,
and Back over a pushed screen left that screen up. The Pixel check is now
an Android RC blocker in the 0.7.3 Linear project rather than a line in
this PR's body.

The spec now pins the two facts that run depends on: Cancel sits in a
SafeAreaView padded on the bottom edge only, and the sheet's parent is the
flex: 1 frame the app renders in. Each assertion fails when its fact is
removed (bottom edge dropped or joined by top, SafeAreaView swapped for a
View, Cancel moved out of it, flex dropped, sheet or app moved out of the
frame). The spec's gate note names the Linear issue.

No runtime change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Dread <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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