Repository navigation
[agent-cli] runtime:tree finds the focused screen of an expo-router 58 app (llp/0018 §Shipped decisions 2) - #199
Merged
Conversation
vonovak
force-pushed
the
vonovak/fix-focused-screen-router
branch
from
October 23, 2026 22:22
bf93d8d to
377ccde
Compare
vonovak
marked this pull request as ready for review
October 24, 2026 03:41
vonovak
marked this pull request as draft
October 24, 2026 05:08
…8 app (llp/0018 §Shipped decisions 2) Problem (dogfood finding N3-08): in an expo-router 58 app, runtime:tree said "which screen is focused could not be determined" and listed every mounted screen, oldest first. After three pushes of street/[name], --testID street-length returned three matches, so an agent read a stale screen first. Cause: the focus detection read only a fiber named Screen with props isFocused and name. That is the expo-router native tabs shape. React Navigation's Screen and SceneView carry focused and route instead, so on the native stack and JS tabs focus was null. Change: the screen reader keeps the native tabs shape (Screen with isFocused and name) and accepts the React Navigation shape (Screen for JS tabs and drawer, SceneView for the native stack, with focused and route). The focus rule is unchanged. JS stack, JS top tabs and headless ui tabs render no screen fiber either shape matches; they still report focusedScreen null and the whole tree, and the LLP says so. The test fixture screen() is renamed nativeTabsScreen() to name its source. expo-router 58.0.24 source: native tabs render Screen with name and isFocused (build/native-tabs/NativeTabsView.ios.js:65-69). JS tabs render elements.Screen with focused and route (build/react-navigation/bottom-tabs/views/BottomTabView.js:260), and so does the drawer (drawer/views/DrawerView.js:249-251). The native stack renders a SceneView with focused and route (native-stack/views/NativeStackView.native.js:100,385-387). The core SceneView (core/SceneView.js:74) is rendered inside every route and has no focused prop. The JS stack renders CardContainerInner with focused and scene (stack/views/Stack/CardStack.js:476-481). Red before: the focus filter in an expo-router 58 app > finds the top stack screen as the focused one, and matches one element of three street screens (focusedScreen was null, expected "street/[name]"). Guard: the focus filter in an expo-router 58 app > reports no focused screen and the whole tree under the JS stack, whose cards are not screen fibers (passes before; fails with "expected 'street/[name]' to be null" if a SceneView without focused counts as focused). The core SceneView inside each route of the first test fails it with "expected +0 to be 1" if a missing focused reads as false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vonovak
force-pushed
the
vonovak/fix-focused-screen-router
branch
from
October 24, 2026 20:50
377ccde to
7a2a16a
Compare
vonovak
marked this pull request as ready for review
October 26, 2026 09:10
Kudo
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In expo-router 58 apps,
runtime:tree --testIDread every mounted screen, oldest first, so the first match could be a stale screen (dogfood N3-08). Focus detection knew one screen shape,ScreenwithisFocusedandname, which in expo-router 58 only its native tabs render. expo-router 58 ships its own copy of React Navigation (expo-router/build/react-navigation/), whose navigators renderScreen(JS tabs, drawer) orSceneView(native stack) withfocusedandroute.Fix
Focus detection reads both shapes. JS stack, JS top tabs and headless
uitabs render neither, so they still report no focused screen (llp/0018).🤖 Generated with Claude Code