ReviewOS

also looking at this

craft-native/craft

feat(maps): add key-free native Android maps and shared map controls

#363
Merged chris wants to merge codex/wildloop-native-map-providers into main
28 files +1857 -481
packages/android/fixtures/native-navigation/NativeNavigationTest.ktmodified+48-0
Changes to packages/android/fixtures/native-navigation/NativeNavigationTest.kt
@@ -725,6 +725,54 @@ class NativeNavigationTest {
725725 }
726726 }
727727
728 @Test
729 fun nativeTestIdsRemainQueryableWithoutReplacingVisibleLabels() {
730 val automation = instrumentation.uiAutomation
731 val previousServiceInfo = automation.serviceInfo
732 automation.serviceInfo = automation.serviceInfo.apply {
733 flags = flags or android.accessibilityservice.AccessibilityServiceInfo.FLAG_REPORT_VIEW_IDS
734 }
735 val activity = instrumentation.startActivitySync(
736 Intent(instrumentation.targetContext, MainActivity::class.java)
737 .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
738 ) as MainActivity
739 fun matching(root: AccessibilityNodeInfo, id: String): AccessibilityNodeInfo? {
740 if (root.viewIdResourceName == id) return root
741 for (index in 0 until root.childCount) {
742 val child = root.getChild(index) ?: continue
743 matching(child, id)?.let { return it }
744 }
745 return null
746 }
747 fun node(id: String): AccessibilityNodeInfo {
748 repeat(100) {
749 // Native automation consumes node metadata. Android's direct
750 // find-by-view-ID RPC instead resolves an AAPT resource ID,
751 // which authored STX identities deliberately do not allocate.
752 automation.rootInActiveWindow?.let { matching(it, id) }?.let { return it }
753 SystemClock.sleep(100)
754 }
755 throw AssertionError("The native accessibility tree did not expose STX testID $id")
756 }
757 try {
758 awaitView(activity, "home-title")
759 val title = node("home-title")
760 assertEquals("Home", title.text.toString())
761 assertEquals("The test identity must not become a spoken label", null, title.contentDescription)
762 val toggle = node("toggle-safe-area")
763 assertEquals("Toggle safe edges", toggle.text.toString())
764 assertTrue("The identified native button did not accept its accessibility click",
765 toggle.performAction(AccessibilityNodeInfo.ACTION_CLICK))
766 awaitText(activity, "safe-area-status", "Safe edges: bottom")
767 assertEquals("The identity disappeared after native reconciliation", "Toggle safe edges",
768 node("toggle-safe-area").text.toString())
769 } finally {
770 instrumentation.runOnMainSync { activity.finishAndRemoveTask() }
771 automation.serviceInfo = previousServiceInfo
772 instrumentation.waitForIdleSync()
773 }
774 }
775
728776 @Test
729777 fun outgoingTabTapWinsOverSettlingSwipe() {
730778 assertTabTapInterruptsSettlingSwipe(0, "navigation-home-state", "Home state: Ada/1")