ReviewOS

also looking at this

craft-native/craft

fix(native): retain keyed controls and correct map and tab chrome

#368
Merged chris wants to merge codex/native-repeated-selector-identity into main
32 files +449 -100

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

packages/ios/fixtures/native-navigation/NativeNavigationUnitTests.swiftmodified+19-0
Changes to packages/ios/fixtures/native-navigation/NativeNavigationUnitTests.swift
@@ -419,6 +419,25 @@ final class NativeNavigationUnitTests: XCTestCase {
419419 XCTAssertNil(CraftChrome.shared.tabAccessory)
420420 }
421421
422 func testDisappearingHiddenNativeTabCannotClearTheVisibleAccessory() async throws {
423 shell.open("/linked-details")
424 let home = try XCTUnwrap(stack("/"))
425 await displayWait("details accessory is visible") {
426 home.transitionCoordinator == nil && CraftChrome.shared.tabAccessory?.id == "/capabilities"
427 }
428 let background = CraftNativeScreenController(config: CraftHybrid.shared.config)
429 background.loadViewIfNeeded()
430 // A prepared or retained controller may finish disappearing after the
431 // current screen has published its chrome. It cannot clear that owner.
432 background.viewWillDisappear(false)
433 XCTAssertEqual(CraftChrome.shared.tabAccessory?.id, "/capabilities")
434 let visible = try XCTUnwrap(home.topViewController as? CraftNativeScreenController)
435 visible.viewWillDisappear(false)
436 XCTAssertNil(CraftChrome.shared.tabAccessory, "the owning screen must still clear its accessory")
437 visible.screenVisibilityChanged(true)
438 XCTAssertEqual(CraftChrome.shared.tabAccessory?.id, "/capabilities")
439 }
440
422441 func testCancelledColdSwipeRestoresTheVisibleScreensAccessory() async throws {
423442 let previous = CraftChrome.shared.tabAccessory
424443 drag(-150)