@onekeyfe/react-native-native-overlay 6.7.0-alpha.466 → 6.8.0-10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +119 -21
  2. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayEntryRootView.kt +60 -0
  3. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayHost.kt +37 -5
  4. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayPackage.kt +1 -1
  5. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayPageHostView.kt +14 -3
  6. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayToastCardView.kt +869 -0
  7. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayToastSpec.kt +327 -0
  8. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayToasterView.kt +574 -0
  9. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayToasterViewManager.kt +54 -0
  10. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayView.kt +12 -0
  11. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayViewManager.kt +8 -0
  12. package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlayAccessibilityIsolationTest.kt +172 -0
  13. package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlayMotionTest.kt +42 -0
  14. package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlayPageHostLayoutTest.kt +58 -0
  15. package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlaySheetInsetTest.kt +78 -0
  16. package/docs/SPEC.md +337 -33
  17. package/ios/NativeOverlayContainerView.swift +6 -0
  18. package/ios/NativeOverlayToastCardView.swift +572 -0
  19. package/ios/NativeOverlayToastSpec.swift +356 -0
  20. package/ios/NativeOverlayToasterView.swift +519 -0
  21. package/ios/NativeOverlayWindowManager.swift +244 -7
  22. package/ios/RCTNativeOverlayToasterComponentView.h +11 -0
  23. package/ios/RCTNativeOverlayToasterComponentView.mm +85 -0
  24. package/lib/module/NativeOverlayNativeComponent.ts +13 -0
  25. package/lib/module/NativeOverlayToasterNativeComponent.ts +24 -0
  26. package/lib/module/OverlayView.js +7 -1
  27. package/lib/module/OverlayView.js.map +1 -1
  28. package/lib/module/animation/anchoredOrigin.js +26 -0
  29. package/lib/module/animation/anchoredOrigin.js.map +1 -0
  30. package/lib/module/animation/resolveAnimation.js +26 -4
  31. package/lib/module/animation/resolveAnimation.js.map +1 -1
  32. package/lib/module/index.js +3 -0
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/toast/OverlayToastHost.js +42 -0
  35. package/lib/module/toast/OverlayToastHost.js.map +1 -0
  36. package/lib/module/toast/OverlayToastHost.web.js +32 -0
  37. package/lib/module/toast/OverlayToastHost.web.js.map +1 -0
  38. package/lib/module/toast/OverlayToastStore.js +217 -0
  39. package/lib/module/toast/OverlayToastStore.js.map +1 -0
  40. package/lib/module/toast/toastBridge.js +65 -0
  41. package/lib/module/toast/toastBridge.js.map +1 -0
  42. package/lib/module/toast/toastDomContent.web.js +298 -0
  43. package/lib/module/toast/toastDomContent.web.js.map +1 -0
  44. package/lib/module/toast/toastDomRenderer.web.js +695 -0
  45. package/lib/module/toast/toastDomRenderer.web.js.map +1 -0
  46. package/lib/module/toast/toastStyles.web.js +97 -0
  47. package/lib/module/toast/toastStyles.web.js.map +1 -0
  48. package/lib/module/toast/types.js +2 -0
  49. package/lib/module/toast/types.js.map +1 -0
  50. package/lib/module/web/animateTransition.js +38 -12
  51. package/lib/module/web/animateTransition.js.map +1 -1
  52. package/lib/module/web/overlayLayers.js +5 -0
  53. package/lib/module/web/overlayLayers.js.map +1 -1
  54. package/lib/typescript/src/NativeOverlayNativeComponent.d.ts +13 -0
  55. package/lib/typescript/src/NativeOverlayNativeComponent.d.ts.map +1 -1
  56. package/lib/typescript/src/NativeOverlayToasterNativeComponent.d.ts +19 -0
  57. package/lib/typescript/src/NativeOverlayToasterNativeComponent.d.ts.map +1 -0
  58. package/lib/typescript/src/OverlayView.d.ts.map +1 -1
  59. package/lib/typescript/src/animation/anchoredOrigin.d.ts +7 -0
  60. package/lib/typescript/src/animation/anchoredOrigin.d.ts.map +1 -0
  61. package/lib/typescript/src/animation/resolveAnimation.d.ts +9 -3
  62. package/lib/typescript/src/animation/resolveAnimation.d.ts.map +1 -1
  63. package/lib/typescript/src/animation/types.d.ts +5 -1
  64. package/lib/typescript/src/animation/types.d.ts.map +1 -1
  65. package/lib/typescript/src/index.d.ts +5 -0
  66. package/lib/typescript/src/index.d.ts.map +1 -1
  67. package/lib/typescript/src/toast/OverlayToastHost.d.ts +6 -0
  68. package/lib/typescript/src/toast/OverlayToastHost.d.ts.map +1 -0
  69. package/lib/typescript/src/toast/OverlayToastHost.web.d.ts +6 -0
  70. package/lib/typescript/src/toast/OverlayToastHost.web.d.ts.map +1 -0
  71. package/lib/typescript/src/toast/OverlayToastStore.d.ts +47 -0
  72. package/lib/typescript/src/toast/OverlayToastStore.d.ts.map +1 -0
  73. package/lib/typescript/src/toast/toastBridge.d.ts +11 -0
  74. package/lib/typescript/src/toast/toastBridge.d.ts.map +1 -0
  75. package/lib/typescript/src/toast/toastDomContent.web.d.ts +15 -0
  76. package/lib/typescript/src/toast/toastDomContent.web.d.ts.map +1 -0
  77. package/lib/typescript/src/toast/toastDomRenderer.web.d.ts +8 -0
  78. package/lib/typescript/src/toast/toastDomRenderer.web.d.ts.map +1 -0
  79. package/lib/typescript/src/toast/toastStyles.web.d.ts +2 -0
  80. package/lib/typescript/src/toast/toastStyles.web.d.ts.map +1 -0
  81. package/lib/typescript/src/toast/types.d.ts +240 -0
  82. package/lib/typescript/src/toast/types.d.ts.map +1 -0
  83. package/lib/typescript/src/web/animateTransition.d.ts +12 -0
  84. package/lib/typescript/src/web/animateTransition.d.ts.map +1 -1
  85. package/lib/typescript/src/web/overlayLayers.d.ts.map +1 -1
  86. package/package.json +3 -2
  87. package/react-native.config.js +1 -0
  88. package/src/NativeOverlayNativeComponent.ts +13 -0
  89. package/src/NativeOverlayToasterNativeComponent.ts +24 -0
  90. package/src/OverlayView.tsx +7 -0
  91. package/src/animation/anchoredOrigin.ts +35 -0
  92. package/src/animation/resolveAnimation.ts +28 -7
  93. package/src/animation/types.ts +5 -1
  94. package/src/index.ts +24 -0
  95. package/src/toast/OverlayToastHost.tsx +62 -0
  96. package/src/toast/OverlayToastHost.web.tsx +29 -0
  97. package/src/toast/OverlayToastStore.ts +254 -0
  98. package/src/toast/toastBridge.ts +62 -0
  99. package/src/toast/toastDomContent.web.ts +351 -0
  100. package/src/toast/toastDomRenderer.web.ts +856 -0
  101. package/src/toast/toastStyles.web.ts +97 -0
  102. package/src/toast/types.ts +251 -0
  103. package/src/web/animateTransition.ts +54 -14
  104. package/src/web/overlayLayers.ts +7 -0
package/docs/SPEC.md CHANGED
@@ -1,10 +1,12 @@
1
1
  # react-native-native-overlay SPEC
2
2
 
3
3
  Status: Implemented through the P5 caller migration in app-monorepo. Android
4
- and Web runtime checks passed there; focused iOS 26.5 simulator and Android 16
5
- emulator checks are recorded below. Broader iOS runtime, physical-device and
6
- iPad acceptance remain unverified. Packaging in app-modules is validated
7
- separately.
4
+ and Web runtime checks passed there; focused iOS 26.5 and iOS 27.0 simulator
5
+ checks and Android 16 emulator checks are recorded below. The iOS 27.0 check
6
+ covers this window handoff with repeated More-sheet gestures, immediate and
7
+ delayed account-selector dismissal, and an interactive cancellation. Broader
8
+ iOS runtime, physical-device and iPad acceptance remain unverified. Packaging
9
+ in app-modules is validated separately.
8
10
 
9
11
  The implementation is migrated from app-monorepo commit
10
12
  `376633bd9f1c410dbccb01fb6a0492be9a5c3f38`, package
@@ -68,8 +70,9 @@ password verify, DialogLoading, app lock, Spotlight, in-app notification.
68
70
 
69
71
  Non-goals:
70
72
 
71
- - Business UI. Titles, buttons, forms, toast cards, the hardware stage morph and
72
- the lock screen UI stay React content owned by components and kit.
73
+ - Business UI. Titles, buttons, forms, the hardware stage morph and the lock
74
+ screen UI stay React content owned by components and kit. Message toast
75
+ cards are the exception: the platform draws them from data (§5.14).
73
76
  - Navigation. Screens and navigation modals stay in react-navigation and
74
77
  react-native-screens.
75
78
  - Third-party windows such as RN `Modal`, WalletConnect, and system dialogs.
@@ -176,7 +179,10 @@ visible)`, `removePage(ownerKey)`.
176
179
 
177
180
  - `animation.enter` and `animation.exit` are each
178
181
  `{ type: none|fade|slide|scale, edge, distance, scale, offsetY, fade, origin: center|anchor, motion }`.
179
- - `exit` defaults to `enter`.
182
+ - `exit` resolution order: a caller-supplied `animation.exit`, otherwise a
183
+ mirror of a caller-supplied `animation.enter` (so custom enters keep their
184
+ old reverse exit), otherwise the presentation's own default exit (currently
185
+ only `center`, see below), otherwise the default `enter`.
180
186
  - `motion` is a preset name or a concrete `{ type: 'spring', spring: { mass, stiffness, damping, overshootClamping } }`
181
187
  or `{ type: 'timing', timing: { durationMs, easing: cubicBezier } }`.
182
188
  - Presets are resolved per platform:
@@ -199,14 +205,34 @@ visible)`, `removePage(ownerKey)`.
199
205
  it would slow web overlays down 4–9×.
200
206
  - Presentation defaults (`DEFAULT_OVERLAY_ANIMATIONS`):
201
207
 
202
- | Presentation | Enter / exit | Backdrop |
203
- | ------------ | -------------------------------------------------------------------------------- | ------------- |
204
- | sheet | slide from bottom, `quick` | fade, `quick` |
205
- | center | scale 0.85 + fade, `quick` | fade, `quick` |
206
- | toast | slide from top + fade, `toastSlide` (native 300 ms quad in-out, web 400 ms ease) | none |
207
- | fullscreen | fade, `quick` | none |
208
- | anchored | scale 0.95 + fade from the resolved anchor placement, `popoverQuick` | fade |
209
-
208
+ | Presentation | Enter | Exit | Backdrop |
209
+ | ------------ | ---------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------- |
210
+ | sheet | slide from bottom, `quick` | same as enter | fade, `quick` |
211
+ | center | scale 0.85 + fade, `quick` | scale 0.96 without fade, `quick` | fade, `quick` |
212
+ | toast | slide from top + fade, `toastSlide` (native 300 ms quad in-out, web 400 ms ease) | same as enter | none |
213
+ | fullscreen | fade, `quick` | same as enter | none |
214
+ | anchored | scale 0.95 + fade from the resolved anchor placement, `popoverQuick` | same as enter | fade |
215
+
216
+ - **Centered card keeps its surface opaque on exit (Implemented; consumer Web
217
+ runtime evidence pending):** a centered Dialog is a solid card over the page
218
+ or over another overlay. Fading the card out made any opaque content behind
219
+ it — a text-heavy page, the account list inside the account selector —
220
+ readable through the card for the whole transition, which consumers reported
221
+ as a doubled render right after closing a dialog (OK-66647, desktop, 120 fps
222
+ recording: the card reached ~20–30 % opacity while the list rows behind
223
+ stayed opaque). The default exit therefore shrinks the card from scale 1 to
224
+ 0.96 with `fade: false`; the host unmounts it when the exit completes.
225
+ `fade: false` is honoured by all three renderers (`hidesOpacity` on iOS and
226
+ Android, `hiddenKeyframe` on Web), and the backdrop still fades on the same
227
+ clock. A fade-free exit also starts from full opacity: when it interrupts a
228
+ still-running fade-in, the partly transparent surface is snapped back to
229
+ alpha 1 before the scale-out begins, so a rapid close cannot show the
230
+ content behind the card either. That interruption is covered by
231
+ `NativeOverlayMotionTest` on Android and by `buildTransitionKeyframes` on
232
+ Web; the iOS dismiss path lives in `NativeOverlayContainerView`, which the
233
+ iOS test app does not compile, so its snap is source-reviewed only. Reduce
234
+ Motion still degrades the exit to a fade on every platform, so this
235
+ protection does not apply there.
210
236
  - **Android sheet transform ownership (Implemented; Android 16 consumer-shell runtime verified):**
211
237
  the overlay's enter/exit transform belongs to the sheet's CoordinatorLayout
212
238
  parent. Material's IME insets callback owns the child sheet's `translationY`,
@@ -322,6 +348,50 @@ not change React ownership. Public APIs, Android/Web, and page scope are unchang
322
348
  first responder; passive toast/debug entries do not win solely by level.
323
349
  Keyboard restoration may finish after dismissal completion; callers/tests
324
350
  requiring keyboard geometry must observe the new keyboard readiness event.
351
+ - Delivered-touch retirement extension (Implemented; thirty native checks and
352
+ four focused local iOS 27.0 App cases passed):
353
+ before showing a global entry, install a passive touch observer on its real
354
+ app window and on the entry window. Active and retired entries of that real
355
+ host share a touch lifetime, including touches delivered to a lower entry or
356
+ the exiting window itself. Other real app windows remain independent, even
357
+ within the same scene. Each observer tracks delivered touch identities, never
358
+ retains UIEvent objects, never cancels or delays touches, and neither prevents
359
+ nor can be prevented by another recognizer. It stays possible until the last
360
+ tracked touch ends or cancels, then fails and resets without recognizing.
361
+ It accepts concurrent touch types with `requiresExclusiveTouchType = false`
362
+ and preserves UIKit's default allowed touch types.
363
+ - Removing an entry while its real app window or any active/retired entry owned
364
+ by that real host has delivered active touches or
365
+ an interactive UIKit presentation
366
+ removes that entry from active ordering and restores key ownership immediately,
367
+ but retains its exiting window/root/scene, without hiding it, until both the
368
+ delivered touch set is empty and the interaction finishes or cancels. Touch
369
+ completion/cancellation and UIKit interaction changes schedule cleanup on the
370
+ next main turn. Cleanup rechecks the complete current touch set and transition
371
+ coordinator before releasing
372
+ that exact window lifetime. A newly interactive transition keeps it retired
373
+ until its own completion; repeated or late callbacks cannot release a new
374
+ entry for the same owner. A new touch beginning after a previous touch ends but
375
+ before queued cleanup keeps the window retired. Overlapping multi-touch can
376
+ extend retirement without a timeout. When neither condition exists, removal
377
+ still releases synchronously. Remove an entry observer only when its window
378
+ is released; remove a real app window's observer only when that host has no
379
+ active or retired entries. Touch callbacks query current host ownership across
380
+ scenes, rather than binding to the scene of first installation. Moving the
381
+ same real host to another scene keeps its remaining users protected.
382
+ Reassigning an observed window to a different host does not change its
383
+ delivered touch context: retain weak prior-host associations until a next-turn
384
+ check finds its complete touch set empty and those hosts' retirements released.
385
+ A new touch during an idle gap still protects a prior host whose context remains
386
+ retired. Touch completion, observer removal and host reassignment wake current
387
+ and prior hosts; queued cleanup does not require the source observer to survive.
388
+ Scene disconnect removes that scene's records and unregisters only observers with
389
+ no remaining users before releasing active and retired windows
390
+ without notifying an already removed owner again. No fixed timeout controls
391
+ this handoff.
392
+ Key restoration MUST NOT activate a host that has moved to another scene.
393
+ Public UIKit observation cannot account for a DOWN not yet delivered to the
394
+ app window; acceptance must separately exercise that delivery/teardown boundary.
325
395
  - Every presentation lifetime has a generation. Asynchronous present, dismiss,
326
396
  and animation completions must match the generation, controller/entry
327
397
  identity and applicable phase before changing state or emitting callbacks.
@@ -469,6 +539,11 @@ Max-width sheet (`sheet.maxWidth`, default 540):
469
539
  amount, so the fractional boundary between the two views cannot antialias
470
540
  into a hairline on scaled renders (Simulator windows, screenshots, screen
471
541
  recordings).
542
+ - Android hosts the sheet inside the activity content view and pads the sheet
543
+ by the navigation-bar inset, so the JS tail below the React content root is
544
+ not composited there. Native paints that inset strip with the drawn surface
545
+ color (`sheetBottomInsetColor`, limited by `sheetBottomInsetHorizontal`)
546
+ instead; the JS tail still covers the iOS home-indicator area.
472
547
 
473
548
  Width changes while open (rotation, folding, window resize):
474
549
 
@@ -562,7 +637,7 @@ Known divergences:
562
637
  | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
563
638
  | iOS global sheet (system physics) vs. iOS page sheet (custom physics) | Accepted (decision A). Revisit after on-device comparison. |
564
639
  | RN `Modal` and third-party dialogs on Android are windows above every layer | Accepted, mitigated by the lock policy (§5.7). |
565
- | Web anchored origin follows the resolved placement after flip; today's code uses the requested placement | Intentional fix. |
640
+ | Web anchored origin follows the resolved placement after flip; the Tamagui Popover used the requested placement | Intentional fix, implemented (`getAnchoredTransformOrigin`). |
566
641
 
567
642
  ## 5.7 Failure, fallback, and safety
568
643
 
@@ -606,11 +681,13 @@ of these UIKit resources. Native logger persistence is owned by the logger.
606
681
 
607
682
  ## 5.8 Performance and resource budget
608
683
 
609
- - iOS entry windows are created lazily and released after their entry detaches.
610
- Window count is O(active global entries) per scene, rather than a six-window
611
- level cache. No new public limit/configuration is introduced; page entries
612
- remain views. Re-ranking is O(n log n) for the affected scene and creates no
613
- per-frame bridge work.
684
+ - iOS entry windows are created lazily and released after their entry detaches,
685
+ or after an in-progress UIKit interaction finishes when release is deferred.
686
+ Window count is O(active global entries plus retired interactive windows) per
687
+ scene, rather than a six-window level cache. Scene disconnect drains both.
688
+ No new public limit/configuration is introduced; page entries remain views.
689
+ Re-ranking is O(n log n) for the affected scene and creates no per-frame
690
+ bridge work.
614
691
  - Android layers are views, not windows: no extra surfaces or WindowManager IPC.
615
692
  - Store operations are O(n) in the number of live entries. Snapshots are
616
693
  rebuilt once per mutation.
@@ -642,15 +719,82 @@ navigation remains a separate runtime acceptance item.
642
719
 
643
720
  ## 5.9 Conformance and acceptance
644
721
 
722
+ Focused iOS 27.0 simulator runtime check (2026-11-13): three repetitions of
723
+ the previously failing 0.25-second More-to-account-selector handoff and one
724
+ 1.25-second control dismissed to Home. A separate 0.25-second handoff with a
725
+ slow partial selector drag canceled and returned to its original position;
726
+ More reopened and a subsequent full drag dismissed normally. Home and Market
727
+ remained interactive. This checks the main-UI window handoff only; physical
728
+ devices and the broader runtime matrix remain unverified.
729
+
730
+ Historical app-touch acceptance for revision `404e87c` (2026-11-13,
731
+ local Debug build on an isolated
732
+ iOS 27.0 simulator): all eight first-pan-only cases passed, starting from the
733
+ Home header or list body at 250, 300, 350 and 400 ms after More close UP. The
734
+ 250/300 ms cases kept all twenty old-context events routed to the app window;
735
+ 350/400 ms started after teardown (observed 5–49 ms later) and routed all twenty
736
+ new-context events normally. No backing-event-only dispatch occurred. Native
737
+ pager logs recorded ended state 3 in every case. List-body accessibility samples
738
+ continued moving after UP without another input, confirming inertia. After
739
+ waiting for release, the first React control tap opened Home More (header) or
740
+ AccountSelectorStack (body), without another pan or tab switch. Per-case main
741
+ and background runtime markers remained unchanged. These measured teardown
742
+ boundaries do not guarantee observation of a DOWN UIKit has not delivered yet.
743
+
744
+ For the same historical revision, two additional selector handoffs exercised
745
+ multiple front-card drags and a partial rebound, then front dismissal followed
746
+ 250 ms later by either a complete
747
+ back-selector dismissal or a partial drag canceled into rebound. Both preserved
748
+ complete old-context delivery (36 and 16 events respectively), zero backing-only
749
+ events, stable main/background markers, and working direct React controls.
750
+ The entry was the watch-only account-row More inside AccountSelectorStack,
751
+ which uses the same global NativeOverlay UIWindow over a UIKit modal host.
752
+ It is an equivalent-host regression, not a replay of the original three-account
753
+ HD wallet-level menu. Release/TestFlight binaries, physical devices and other
754
+ OS versions remain unverified.
755
+
756
+ Review extension acceptance for `c59572b`: thirty focused native checks passed.
757
+ A rebuilt local Debug App passed first-only header/250 ms and body/300 ms Home
758
+ handoffs with native ended state 3, direct React control actions and stable
759
+ main/background runtime markers. Two further cases used an independently mounted
760
+ passive global entry over Home More. A lower-entry drag received all sixteen
761
+ events in its own context while the upper entry closed; its next React close
762
+ action worked. This does not establish use of the upper entry's context by the
763
+ lower drag. In the exiting-entry case, UIKit delivered DOWN to the upper window,
764
+ restored key ownership to the lower window on close, and delivered UP to the
765
+ same upper window/context 657 ms after native close; the next lower React close
766
+ action worked. Runtime markers stayed stable throughout these four post-recovery
767
+ cases. The earlier nineteen native checks, eight Home cases and two equivalent
768
+ selector handoffs above belong to `404e87c`, not a rerun of the review version.
769
+ The eleven added native groups cover lower/exiting-entry and cross-window touch
770
+ ownership, mixed delivered types, repeated host reassignment, UP/rehost/DOWN and
771
+ coordinator-held idle gaps, projected scene ownership/disconnect, and key scope.
772
+ Mixed-type tests directly deliver synthetic touches and assert observer flags;
773
+ they do not prove physical Pencil input. Scene tests project one real scene into
774
+ controlled manager identity buckets using an internal resolver; they do not prove
775
+ system multi-scene migration. The default resolver remains `ObjectIdentifier(scene)`.
776
+
645
777
  Automated (P0):
646
778
 
647
779
  - `tests/ios/run.sh` compiles the production WindowManager, SheetController and
648
- Animation into an isolated UIKit test app. Its seven checks cover bounded/live
780
+ Animation into an isolated UIKit test app. Its original nineteen checks cover bounded/live
649
781
  ordering, key restoration eligibility, owning-entry release, injected scene
650
782
  disconnect/reuse with original-window identity and reentrant-registration
651
783
  rejection, conditional original-input focus restoration (including
652
784
  higher/foreign/new-input guards), and a native sheet surviving another
653
- entry's dismissal.
785
+ entry's dismissal. Four focused checks cover interactive retirement after
786
+ finish and cancellation, reopening the same owner while the old window is
787
+ retired, and disconnecting a scene with only a retired window. They use a
788
+ controlled transition coordinator to test manager lifecycle; the real
789
+ gesture check is the iOS 27.0 simulator run above.
790
+ Eight app-touch checks directly drive the production observer's
791
+ `touchesBegan`/`touchesEnded`/`touchesCancelled` and reset with synthetic
792
+ touch objects. They assert passive gesture flags, touch-only retirement,
793
+ multi-touch and per-real-window isolation, next-turn touch-set rechecks,
794
+ reset cleanup, conjunction with coordinator ownership, owner/orphan reuse,
795
+ and scene-disconnect callback invalidation. They prove manager lifecycle,
796
+ not UIKit delivery or scroll inertia; those are covered separately by the
797
+ local App runtime checks above, with the stated selector-entry limitation.
654
798
  Sheet checks use `animated: false`; they do not compile the React/Fabric
655
799
  Container or replace Gallery coverage of animated reversal/generation races,
656
800
  real multi-scene/disconnect, keyboard geometry or accessibility.
@@ -669,7 +813,20 @@ Automated (P0):
669
813
  reparenting in both directions, including the exit-completion staging path,
670
814
  old-parent transition completion after the move, and reopen during exit.
671
815
  It also covers Fabric removal of staged content and replacement of presented
672
- content during a transition, including layout-listener cleanup.
816
+ content during a transition, including layout-listener cleanup, and the
817
+ fade-free centered exit snapping an interrupted fade-in to full opacity
818
+ before the scale-out.
819
+ - `NativeOverlayPageHostLayoutTest` places the Android page host below an
820
+ actual `ReactViewGroup` and checks a sheet at 200, 600 and 320 px after
821
+ attachment. Height changes MUST relayout and bottom-pin the sheet without
822
+ a Fabric host-size update, and leave no pending host layout flag.
823
+ - `NativeOverlaySheetInsetTest` exercises the production Android sheet inset
824
+ painter: the navigation-bar strip sits behind the content, follows the drawn
825
+ surface width, carries the surface color and is removed when the platform
826
+ sheet paints its own background. `src/__tests__/sheetSurface.test.ts` checks
827
+ that the drawn surface color and horizontal inset reach native only while
828
+ the JS surface is active. Source and Robolectric verified; physical-device
829
+ verification pending.
673
830
  - `src/__tests__/pageIsolation.web.test.ts` mounts a real React portal in a
674
831
  DOM host and verifies late suspension, level ordering and restoration after
675
832
  the blocking entry is removed.
@@ -694,7 +851,11 @@ Automated (P0):
694
851
  - the spring response in all damping regimes, overshoot clamping and settle
695
852
  time;
696
853
  - Android `SpringForce` conversion and CSS `linear()` sampling;
697
- - presentation defaults and per-platform preset resolution.
854
+ - presentation defaults and per-platform preset resolution, including the
855
+ centered fade-free exit and a caller-supplied exit override;
856
+ - Web enter/exit keyframes: a fade-free exit keeps opacity 1 when it
857
+ interrupts a partial fade-in, a fading exit starts from the interrupted
858
+ opacity, and the interrupted enter transform is retargeted.
698
859
 
699
860
  Runtime matrix, required per platform before migrating callers (P1–P3):
700
861
 
@@ -740,6 +901,15 @@ P3 page scope notes:
740
901
  - iOS page sheets are drawn by the entry (bottom-pinned content view, pan to
741
902
  close) because UIKit sheets always cover the window. Android and Web reuse
742
903
  their global sheet implementation inside the page host.
904
+ - Android page hosts MUST complete their own measure/layout lifecycle after
905
+ native child layout requests. This clears the pending host layout flag so
906
+ later descendant requests can reach the host through Fabric-managed parents.
907
+ Scheduling MUST remain available when View construction requests layout
908
+ before the callback is initialized. Fitted sheets follow settled content
909
+ height changes in both directions. Runtime verified in app-monorepo 6.7.0
910
+ with a locally rebuilt shell on a Pixel 10 Pro API 37 emulator: the referral
911
+ form and Apply button remain visible after loading, error text grows the
912
+ sheet, and clearing the error restores its height.
743
913
  - Android back also resolves page entries: global overlays first, then the
744
914
  topmost visible page overlay.
745
915
  - A declarative page overlay waits for a resolvable host and owner; it never
@@ -780,10 +950,9 @@ P2 sheet notes:
780
950
 
781
951
  P4a toast notes:
782
952
 
783
- - Message toasts (`Toast.success` / `message` / `error` …) keep their
784
- libraries (sonner on web, `@backpackapp-io/react-native-toast` on native)
785
- and render inside one persistent, non-blocking `toast`-level fullscreen
786
- entry (kit `ToastOverlayContainer`). The iOS raise tokens are gone.
953
+ - Message toasts (`Toast.success` / `message` / `error` …) are drawn by the
954
+ platform from data; see §5.14. The React toast libraries and the persistent
955
+ `toast`-level fullscreen entry that hosted them are gone.
787
956
  - Custom toasts (`Toast.show` / `ShowCustom`) are their own `toast` entries:
788
957
  transparent blocking backdrop (tap closes when `dismissOnOverlayPress`),
789
958
  `scale 0.8 + offsetY -20 + fade` on `quick`, PanResponder swipe up to
@@ -802,7 +971,9 @@ P4b dialog loading notes:
802
971
  it. Its 50 ms delays and the iOS remount key are gone; text updates in
803
972
  place.
804
973
  - Android sheets pad their content by the navigation-bar inset, matching the
805
- UIKit sheet's home-indicator inset.
974
+ UIKit sheet's home-indicator inset, and paint that inset strip natively with
975
+ the drawn surface color (the JS tail is not composited below the React
976
+ content root on Android).
806
977
 
807
978
  P1 implementation map:
808
979
 
@@ -908,6 +1079,13 @@ P5b web popover notes:
908
1079
  untransformed, so Floating UI uses the same coordinate space during and after
909
1080
  the animation. Completion positioning must not correct coordinates distorted
910
1081
  by the enter scale. Multi-child roots retain their shared full-window motion.
1082
+ - The anchored content's transform origin is the side and corner facing the
1083
+ anchor, read from its `data-placement` (Floating UI notation, after flip):
1084
+ `bottom-end` scales from `right top`, `top-start` from `left bottom`, and so
1085
+ on. Without a placement it falls back to the content center. The caller
1086
+ sets `data-placement` once Floating UI resolves; because the enter run can
1087
+ start before that, the caller also writes the same origin
1088
+ (`getAnchoredTransformOrigin`) onto the running content.
911
1089
  - Press-triggered anchored panels close on a backdrop press without activating
912
1090
  the page underneath. Presses on the panel or inside an overlay ranked above
913
1091
  it do not close it, so a nested Select or a Dialog opened from the panel
@@ -1078,13 +1256,13 @@ Accepted limitations:
1078
1256
  scroll views. Page sheets should keep scrollable content short or pass
1079
1257
  `dismissOnPanDown={false}`.
1080
1258
  - Custom toasts stack by request order and overlap at the top, as before;
1081
- message toasts stack inside their libraries.
1259
+ message toasts stack in the platform toaster (§5.14).
1082
1260
 
1083
1261
  Future work (better to have):
1084
1262
 
1085
1263
  - VoiceOver / TalkBack cross-window modality, verified on device.
1086
- - Screen-reader toasts: the native toast library renders nothing under a
1087
- screen reader today; the toast host should announce content and extend
1264
+ - Screen-reader toasts: the native toaster announces each card's text when
1265
+ it appears (§5.14); the lifetime is not yet extended, and the host should
1088
1266
  its timer instead.
1089
1267
 
1090
1268
  Known gaps:
@@ -1129,3 +1307,129 @@ staged version). Following the repository's verification guidance, the entire
1129
1307
  batch advances to `3.0.162-alpha.270`. Existing versions are never overwritten.
1130
1308
  The iOS lockfile failure was only local CocoaPods 1.17.0 versus the Gemfile's
1131
1309
  locked 1.16.2; the actual CI lockfile was adopted, preserving semantic checks.
1310
+
1311
+ ## 5.14 Message toasts
1312
+
1313
+ Message toasts are plain data. `overlayToastStore.show(spec, handlers)` takes
1314
+ an `IOverlayToastSpec` (`src/toast/types.ts`) and the platform draws the card:
1315
+ DOM on Web, UIKit on iOS, Android views on Android. React draws nothing; the
1316
+ only React piece is `OverlayToastHost`, which attaches the renderer.
1317
+
1318
+ ### Contract
1319
+
1320
+ - A spec holds resolved values only: CSS colour strings, points, font sizes,
1321
+ icon names. The package carries no design tokens.
1322
+ - Two layouts: `message` (status icon, title, message, action row) and
1323
+ `notification` (round badge, clamped title and message, trailing image,
1324
+ pressable row).
1325
+ - Text is paragraphs of runs. A run may set colour, weight, size, underline
1326
+ and `link`; a link is opaque and comes back through `onLink`.
1327
+ - Actions are small buttons described by data and report `onAction(id)`.
1328
+ Pressing one does not dismiss the toast.
1329
+ - `show` with an id that is on screen updates that card and restarts its
1330
+ lifetime; `update` redraws it (theme or layout change) without restarting.
1331
+ - A toast leaves the list when its renderer reports `close`, after the exit.
1332
+ With no renderer attached a dismissal removes it at once. At most 20 toasts
1333
+ are kept; older ones are dropped without animation.
1334
+ - Events: `dismiss(reason)` when the card starts leaving (`timeout`, `swipe`,
1335
+ `close`, `programmatic`), `close(reason)` when it is gone, `action`,
1336
+ `link`, `press`.
1337
+ - `configure` sets toaster-wide values: position and theme (Web), card colour
1338
+ and content box (native), and the top obstruction the stack rests under.
1339
+
1340
+ ### Bridge
1341
+
1342
+ iOS and Android use one zero-size Fabric component, `RNCNativeOverlayToaster`,
1343
+ with two string props (`toasts`, `config`: JSON) and one direct event
1344
+ (`onToastEvent { toastId, type, value }`). An infinite duration crosses as
1345
+ `-1`. The cards are not children of this view: iOS draws them in a `toast`
1346
+ level window from `NativeOverlayWindowManager`, Android in a layer at the
1347
+ bottom of the host's `toast` level container, so custom toast entries stay
1348
+ above them. Web has no bridge: the DOM renderer subscribes to the store.
1349
+
1350
+ Named icons come from `@onekeyfe/react-native-image`'s native registry,
1351
+ reached at runtime (Objective-C runtime on iOS, reflection on Android) so this
1352
+ package takes no dependency on it; without the registry an icon stays blank.
1353
+ On Android the lookup is `OneKeyNamedSVG.INSTANCE` plus its `request` (8
1354
+ arguments) and `cancel` methods; the image package's consumer R8 rules keep
1355
+ those names, since release app builds minify and would otherwise rename them.
1356
+ Web draws an SVG `<use>` of the `href` the caller supplies.
1357
+
1358
+ ### Platform behaviour
1359
+
1360
+ Each platform keeps the look and motion of the renderer it replaced.
1361
+
1362
+ | Behaviour | Web | iOS / Android |
1363
+ | --- | --- | --- |
1364
+ | Position | Per toast or toaster; default bottom-right | Always top-centre |
1365
+ | Stack | Newest in front, 3 visible. Hover or tap to expand multiple cards. An outside press clears tap expansion. | Oldest at the top, newest under it, 8 pt apart, all visible |
1366
+ | Card | 356 px wide, 16 px padding, themed surface and border, close button | Content box from `contentWidth` plus 16 / 12 pt padding, 8 pt radius, shadow |
1367
+ | Enter / exit | 400 ms transform and opacity transition; exit 200 ms | 300 ms quadratic ease-in-out slide from above the top edge, with opacity |
1368
+ | `close` reported | 200 ms after the exit starts | 1000 ms after the exit starts |
1369
+ | Timer pause | While the stack is hovered, expanded, or has an active press. When the pause ends, timers restart with the full lifetime. | While a card is pressed; resuming continues the remaining time |
1370
+ | Swipe | Away from the anchored edge (down on bottom groups, up on top groups). Once a vertical swipe starts, only vertical displacement counts. Release dismisses at 20 px or above 0.11 px/ms. | Up; 32 pt, or 12 pt at 600 pt/s; dragging down moves a quarter as far |
1371
+ | Top obstruction | Inline `top` on top groups, 220 ms | The whole stack translates, 220 ms |
1372
+ | Reduced motion | Transitions off (media query) | Every animation is instant |
1373
+
1374
+ On Web, the card captures the pointer after recognizing a swipe. Ordinary
1375
+ clicks and taps activate the pressable row, buttons, or links through their
1376
+ own handlers. Each press ends independently on release or cancellation.
1377
+ Card removal, reuse, or repositioning clears its presses, and window blur
1378
+ clears all presses and expansion. A touch drag that did not dismiss the card
1379
+ ends the press without creating hover or tap expansion.
1380
+
1381
+ Divergences from the renderers replaced:
1382
+
1383
+ - Web measures a card's own height. The previous renderer could record a
1384
+ scaled height when several toasts arrived in one tick, which put about 4 px
1385
+ less between cards of an expanded stack.
1386
+ - Web starts the enter transition synchronously, so a toast shown while the
1387
+ page is hidden still appears.
1388
+ - Native shows toasts under a screen reader and announces their text; the
1389
+ previous renderer drew nothing while a screen reader was on.
1390
+
1391
+ ### Verification
1392
+
1393
+ - Web: `src/__tests__/overlayToast.web.test.ts` covers the store and the DOM
1394
+ renderer. In app-monorepo, 13 scenarios in three captures (wide dark, narrow
1395
+ dark, wide light) matched the previous renderer's card boxes, text line
1396
+ rects, icon and button boxes and computed styles within 0.5 px.
1397
+ - Web pointer regression: `tests/browser/overlayToast.test.cjs` exercises
1398
+ browser-generated mouse clicks, touch taps, mixed input, and swipes in
1399
+ Chromium. Run from the package with `node --test tests/browser/overlayToast.test.cjs`.
1400
+ Make `esbuild` and `playwright-core` available via `NODE_PATH` or the local
1401
+ install, and set `CHROMIUM_EXECUTABLE_PATH` if using a system Chrome.
1402
+ - iOS: built into app-monorepo and run on an iPhone 17 Pro simulator (iOS
1403
+ 26.0) beside the previous renderer. In 13 scenarios the card frames and
1404
+ every text line box matched to the pixel; the only differing pixels were
1405
+ corner anti-aliasing against a differently lit backdrop. Timeout, close
1406
+ callback, action press, notification press, swipe up, press-to-pause with
1407
+ resume, programmatic close, id de-duplication and dismiss by id were
1408
+ exercised with injected touches. Not exercised there: the top obstruction
1409
+ shift, the keyboard limit, dark theme, rotation, iPad and VoiceOver.
1410
+ - Android: built into app-monorepo and run on a Pixel 7 emulator (API 35,
1411
+ 420 dpi) beside the previous renderer, both with the brand typeface. In 13
1412
+ scenarios, light and dark, every card, text, icon and button frame matched
1413
+ to the pixel; inside the cards the remaining pixel differences were at most
1414
+ 12 of 255 (anti-aliasing), apart from the spinner's animation frame. The
1415
+ spinner box is 2 px shorter than before (53x52 against 53x54). Timeout and
1416
+ close callback, action press, notification press, swipe up, a short drag
1417
+ that settles back, press-to-pause with resume, programmatic close, id
1418
+ de-duplication, dismiss by id and stacking order were exercised with
1419
+ injected touches. Not exercised there: the top obstruction shift, the
1420
+ keyboard limit, rotation, tablets, foldables and TalkBack.
1421
+
1422
+ iOS text is laid out and drawn with TextKit (no font leading, glyphs centred
1423
+ in a fixed line box) because that is what the previous text engine did. Two
1424
+ of its habits are kept on purpose: a text box is one pixel taller than its
1425
+ lines, and an explicit letter spacing, zero included, turns the font's pair
1426
+ kerning off.
1427
+
1428
+ Android cards follow the previous layout engine's pixel rounding (Yoga): an
1429
+ offset from the parent is rounded half up, a text offset is floored, and a
1430
+ size is the difference of the rounded absolute edges, so the card keeps its
1431
+ unrounded window position. Text is drawn unhinted at subpixel positions with
1432
+ the font size and line height rounded up to whole pixels, underlines are
1433
+ stroked at baseline + thickness + 1 px, and a bordered pill's fill is inset
1434
+ by 0.8 px, all as React Native draws them. Named icons render at their
1435
+ rounded frame size.
@@ -470,6 +470,12 @@ final class NativeOverlayEntryView: UIView {
470
470
  contentExtent: entry.contentExtent(),
471
471
  bounds: entry.bounds
472
472
  )
473
+ // A fade-free exit does not animate alpha. If the fade-in was interrupted,
474
+ // the card would otherwise stay partly transparent and show the content
475
+ // behind it for the whole scale-out (OK-66647).
476
+ if !transition.hidesOpacity {
477
+ entry.contentView.alpha = 1
478
+ }
473
479
  let contentAnimator = transition.motion.makeAnimator()
474
480
  contentAnimator.addAnimations {
475
481
  if transition.hidesOpacity {