@onekeyfe/react-native-native-overlay 6.7.0-60 → 6.7.0-61
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.
- package/docs/SPEC.md +37 -11
- package/ios/NativeOverlayWindowManager.swift +57 -2
- package/package.json +1 -1
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
|
|
5
|
-
emulator checks are recorded below.
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
@@ -345,6 +347,16 @@ not change React ownership. Public APIs, Android/Web, and page scope are unchang
|
|
|
345
347
|
first responder; passive toast/debug entries do not win solely by level.
|
|
346
348
|
Keyboard restoration may finish after dismissal completion; callers/tests
|
|
347
349
|
requiring keyboard geometry must observe the new keyboard readiness event.
|
|
350
|
+
- Removing an entry while the app window has an interactive UIKit presentation
|
|
351
|
+
removes that entry from active ordering and restores key ownership immediately,
|
|
352
|
+
but retains its exiting window/root/scene until the interaction finishes or
|
|
353
|
+
cancels. After UIKit reports the interaction change, cleanup runs on the next
|
|
354
|
+
main turn and rechecks the current transition coordinator before releasing
|
|
355
|
+
that exact window lifetime. A newly interactive transition keeps it retired
|
|
356
|
+
until its own completion; repeated or late callbacks cannot release a new
|
|
357
|
+
entry for the same owner. Scene disconnect releases active and retired windows
|
|
358
|
+
without notifying an already removed owner again. No fixed timeout controls
|
|
359
|
+
this handoff.
|
|
348
360
|
- Every presentation lifetime has a generation. Asynchronous present, dismiss,
|
|
349
361
|
and animation completions must match the generation, controller/entry
|
|
350
362
|
identity and applicable phase before changing state or emitting callbacks.
|
|
@@ -634,11 +646,13 @@ of these UIKit resources. Native logger persistence is owned by the logger.
|
|
|
634
646
|
|
|
635
647
|
## 5.8 Performance and resource budget
|
|
636
648
|
|
|
637
|
-
- iOS entry windows are created lazily and released after their entry detaches
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
649
|
+
- iOS entry windows are created lazily and released after their entry detaches,
|
|
650
|
+
or after an in-progress UIKit interaction finishes when release is deferred.
|
|
651
|
+
Window count is O(active global entries plus retired interactive windows) per
|
|
652
|
+
scene, rather than a six-window level cache. Scene disconnect drains both.
|
|
653
|
+
No new public limit/configuration is introduced; page entries remain views.
|
|
654
|
+
Re-ranking is O(n log n) for the affected scene and creates no per-frame
|
|
655
|
+
bridge work.
|
|
642
656
|
- Android layers are views, not windows: no extra surfaces or WindowManager IPC.
|
|
643
657
|
- Store operations are O(n) in the number of live entries. Snapshots are
|
|
644
658
|
rebuilt once per mutation.
|
|
@@ -670,15 +684,27 @@ navigation remains a separate runtime acceptance item.
|
|
|
670
684
|
|
|
671
685
|
## 5.9 Conformance and acceptance
|
|
672
686
|
|
|
687
|
+
Focused iOS 27.0 simulator runtime check (2026-11-13): three repetitions of
|
|
688
|
+
the previously failing 0.25-second More-to-account-selector handoff and one
|
|
689
|
+
1.25-second control dismissed to Home. A separate 0.25-second handoff with a
|
|
690
|
+
slow partial selector drag canceled and returned to its original position;
|
|
691
|
+
More reopened and a subsequent full drag dismissed normally. Home and Market
|
|
692
|
+
remained interactive. This checks the main-UI window handoff only; physical
|
|
693
|
+
devices and the broader runtime matrix remain unverified.
|
|
694
|
+
|
|
673
695
|
Automated (P0):
|
|
674
696
|
|
|
675
697
|
- `tests/ios/run.sh` compiles the production WindowManager, SheetController and
|
|
676
|
-
Animation into an isolated UIKit test app. Its
|
|
698
|
+
Animation into an isolated UIKit test app. Its eleven checks cover bounded/live
|
|
677
699
|
ordering, key restoration eligibility, owning-entry release, injected scene
|
|
678
700
|
disconnect/reuse with original-window identity and reentrant-registration
|
|
679
701
|
rejection, conditional original-input focus restoration (including
|
|
680
702
|
higher/foreign/new-input guards), and a native sheet surviving another
|
|
681
|
-
entry's dismissal.
|
|
703
|
+
entry's dismissal. Four focused checks cover interactive retirement after
|
|
704
|
+
finish and cancellation, reopening the same owner while the old window is
|
|
705
|
+
retired, and disconnecting a scene with only a retired window. They use a
|
|
706
|
+
controlled transition coordinator to test manager lifecycle; the real
|
|
707
|
+
gesture check is the iOS 27.0 simulator run above.
|
|
682
708
|
Sheet checks use `animated: false`; they do not compile the React/Fabric
|
|
683
709
|
Container or replace Gallery coverage of animated reversal/generation races,
|
|
684
710
|
real multi-scene/disconnect, keyboard geometry or accessibility.
|
|
@@ -174,7 +174,19 @@ final class NativeOverlayWindowManager: NSObject {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
private final class RetiredWindow {
|
|
178
|
+
let window: NativeOverlayPassthroughWindow
|
|
179
|
+
weak var appWindow: UIWindow?
|
|
180
|
+
weak var observedCoordinator: AnyObject?
|
|
181
|
+
|
|
182
|
+
init(window: NativeOverlayPassthroughWindow, appWindow: UIWindow?) {
|
|
183
|
+
self.window = window
|
|
184
|
+
self.appWindow = appWindow
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
177
188
|
private var scenes: [ObjectIdentifier: [ObjectIdentifier: Entry]] = [:]
|
|
189
|
+
private var retiredWindows: [ObjectIdentifier: [ObjectIdentifier: RetiredWindow]] = [:]
|
|
178
190
|
private var disconnectingScenes = Set<ObjectIdentifier>()
|
|
179
191
|
private var sequence = 0
|
|
180
192
|
|
|
@@ -256,7 +268,15 @@ final class NativeOverlayWindowManager: NSObject {
|
|
|
256
268
|
scenes[sceneKey]?[ownerKey] = nil
|
|
257
269
|
let remaining = scenes[sceneKey] ?? [:]
|
|
258
270
|
if remaining.isEmpty { scenes[sceneKey] = nil }
|
|
259
|
-
|
|
271
|
+
if Self.interactiveCoordinator(in: entry.appWindow) != nil {
|
|
272
|
+
// Destroying this window context can strand a touch already routed to the app's interactive sheet.
|
|
273
|
+
let retirement = RetiredWindow(window: entry.window, appWindow: entry.appWindow)
|
|
274
|
+
let windowKey = ObjectIdentifier(entry.window)
|
|
275
|
+
retiredWindows[sceneKey, default: [:]][windowKey] = retirement
|
|
276
|
+
finishRetirement(retirement, sceneKey: sceneKey, windowKey: windowKey)
|
|
277
|
+
} else {
|
|
278
|
+
release(entry.window)
|
|
279
|
+
}
|
|
260
280
|
reorder(remaining)
|
|
261
281
|
guard wasKey, let scene,
|
|
262
282
|
scene.activationState == .foregroundActive || scene.activationState == .foregroundInactive else { return }
|
|
@@ -331,11 +351,45 @@ final class NativeOverlayWindowManager: NSObject {
|
|
|
331
351
|
window.windowScene = nil
|
|
332
352
|
}
|
|
333
353
|
|
|
354
|
+
private static func interactiveCoordinator(in appWindow: UIWindow?) -> UIViewControllerTransitionCoordinator? {
|
|
355
|
+
var controller = appWindow?.rootViewController
|
|
356
|
+
while let current = controller {
|
|
357
|
+
if let coordinator = current.transitionCoordinator, coordinator.isInteractive {
|
|
358
|
+
return coordinator
|
|
359
|
+
}
|
|
360
|
+
controller = current.presentedViewController
|
|
361
|
+
}
|
|
362
|
+
return nil
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
private func finishRetirement(_ retirement: RetiredWindow, sceneKey: ObjectIdentifier,
|
|
366
|
+
windowKey: ObjectIdentifier) {
|
|
367
|
+
guard retiredWindows[sceneKey]?[windowKey] === retirement else { return }
|
|
368
|
+
guard let coordinator = Self.interactiveCoordinator(in: retirement.appWindow) else {
|
|
369
|
+
retiredWindows[sceneKey]?[windowKey] = nil
|
|
370
|
+
if retiredWindows[sceneKey]?.isEmpty == true { retiredWindows[sceneKey] = nil }
|
|
371
|
+
release(retirement.window)
|
|
372
|
+
return
|
|
373
|
+
}
|
|
374
|
+
guard retirement.observedCoordinator !== coordinator else { return }
|
|
375
|
+
retirement.observedCoordinator = coordinator
|
|
376
|
+
coordinator.notifyWhenInteractionChanges { [weak self, weak retirement] context in
|
|
377
|
+
guard !context.isInteractive else { return }
|
|
378
|
+
DispatchQueue.main.async { [weak self, weak retirement] in
|
|
379
|
+
guard let self, let retirement,
|
|
380
|
+
self.retiredWindows[sceneKey]?[windowKey] === retirement else { return }
|
|
381
|
+
self.finishRetirement(retirement, sceneKey: sceneKey, windowKey: windowKey)
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
334
386
|
@objc private func sceneDidDisconnect(_ notification: Notification) {
|
|
335
387
|
precondition(Thread.isMainThread)
|
|
336
388
|
guard let scene = notification.object as? UIWindowScene else { return }
|
|
337
389
|
let sceneKey = ObjectIdentifier(scene)
|
|
338
|
-
|
|
390
|
+
let entries = scenes.removeValue(forKey: sceneKey) ?? [:]
|
|
391
|
+
let retired = retiredWindows.removeValue(forKey: sceneKey) ?? [:]
|
|
392
|
+
guard !entries.isEmpty || !retired.isEmpty else { return }
|
|
339
393
|
disconnectingScenes.insert(sceneKey)
|
|
340
394
|
defer { disconnectingScenes.remove(sceneKey) }
|
|
341
395
|
// Unregister first: owner callbacks must not restore a disconnected scene's key.
|
|
@@ -343,5 +397,6 @@ final class NativeOverlayWindowManager: NSObject {
|
|
|
343
397
|
entry.owner?.overlaySceneDidDisconnect(window: entry.window)
|
|
344
398
|
release(entry.window)
|
|
345
399
|
}
|
|
400
|
+
for retirement in retired.values { release(retirement.window) }
|
|
346
401
|
}
|
|
347
402
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-overlay",
|
|
3
|
-
"version": "6.7.0-
|
|
3
|
+
"version": "6.7.0-61",
|
|
4
4
|
"description": "Native and Web overlay hosts with ordered levels, page scope and Fabric measurement",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|