Repository navigation
Conversation
…-add-hardware-keyboard-navigation # Conflicts: # mobile/src/host-screen/use-host-screen-controller.ts
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (47)
🚧 Files skipped from review as they are similar to previous changes (43)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughAdds mobile hardware-keyboard support across native Android and iOS modules. The change defines command registration, platform-specific keybinding conversion, preferences, tab and worktree navigation, and keyboard settings. It wires navigation into host and session screens, adds cached worktree fallback, and updates terminal and chat inputs to manage hardware-keyboard focus and soft-input behavior. Tests cover native compatibility, keybinding conversion, navigation, focus behavior, and terminal input gating. Merge Risk: ⚪ Minimal · up to This change adds mobile hardware-keyboard navigation, settings, and input-focus support without a concrete remaining correctness, security, or availability risk identified in the supplied evidence. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Out of Scope Changes checkExplanation The PR includes changes beyond the linked issue's application-navigation scope, including Native Chat and terminal input focus behavior, terminal input gating, tab-snapshot lag handling, and preference persistence failure handling. The linked issue explicitly excludes terminal input and standard text-editing behavior. Resolution Split the terminal and Native Chat focus, terminal input gating, tab-snapshot lag, and preference-persistence changes into separate linked work, or document and obtain explicit scope approval for these additions. Keep this PR focused on application-level hardware-keyboard navigation for worktrees and tabs. Full details: Docstring CoverageExplanation Docstring coverage is 2.47% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 81 functions across 42 files. (5 skipped: 5 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: f05a3eef-d0eb-4f57-8fba-0c3a96a4d067
⛔ Files ignored due to path filters (1)
mobile/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (41)
mobile/app/_layout.tsxmobile/app/h/_layout.tsxmobile/app/hardware-keyboard-settings.tsxmobile/app/settings.tsxmobile/package.jsonmobile/packages/expo-hardware-keyboard-navigation/android/build.gradlemobile/packages/expo-hardware-keyboard-navigation/android/src/main/java/expo/modules/hardwarekeyboardnavigation/ExpoHardwareKeyboardNavigationModule.ktmobile/packages/expo-hardware-keyboard-navigation/android/src/main/java/expo/modules/hardwarekeyboardnavigation/HardwareKeyboardActivityLifecycleListener.ktmobile/packages/expo-hardware-keyboard-navigation/android/src/main/java/expo/modules/hardwarekeyboardnavigation/HardwareKeyboardNavigationPackage.ktmobile/packages/expo-hardware-keyboard-navigation/android/src/main/java/expo/modules/hardwarekeyboardnavigation/HardwareKeyboardNavigationRegistry.ktmobile/packages/expo-hardware-keyboard-navigation/android/src/main/java/expo/modules/hardwarekeyboardnavigation/HardwareKeyboardWindowCallback.ktmobile/packages/expo-hardware-keyboard-navigation/expo-module.config.jsonmobile/packages/expo-hardware-keyboard-navigation/ios/ExpoHardwareKeyboardNavigation.podspecmobile/packages/expo-hardware-keyboard-navigation/ios/ExpoHardwareKeyboardNavigationModule.swiftmobile/packages/expo-hardware-keyboard-navigation/package.jsonmobile/packages/expo-hardware-keyboard-navigation/src/index.tsmobile/src/cache/worktree-cache.tsmobile/src/hardware-keyboard/hardware-keyboard-native-compatibility.test.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-actions.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-bindings.test.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-bindings.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-preferences.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-registry.tsmobile/src/hardware-keyboard/mobile-tab-keyboard-navigation.test.tsmobile/src/hardware-keyboard/mobile-tab-keyboard-navigation.tsmobile/src/hardware-keyboard/mobile-worktree-keyboard-navigation.test.tsmobile/src/hardware-keyboard/mobile-worktree-keyboard-navigation.tsmobile/src/hardware-keyboard/use-hardware-keyboard-text-input-focus.tsmobile/src/hardware-keyboard/use-mobile-hardware-keyboard-commands.tsmobile/src/hardware-keyboard/use-mobile-hardware-keyboard-preferences.tsmobile/src/hardware-keyboard/use-mobile-session-keyboard-navigation.tsmobile/src/hardware-keyboard/use-mobile-worktree-keyboard-navigation.tsmobile/src/hooks/use-active-worktree-scroll.tsmobile/src/host-screen/use-host-screen-controller.tsmobile/src/session/MobileNativeChatComposer.test.tsmobile/src/session/MobileNativeChatComposer.tsxmobile/src/session/MobileSessionCommandDock.tsxmobile/src/session/use-mobile-session-controller.tsmobile/src/session/use-mobile-session-terminal-send-actions.tsmobile/src/terminal/terminal-input-connection-gate.test.tsmobile/src/terminal/terminal-live-input-affordance.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Important
Worktree navigation bypasses the terminal-first shortcut policy, so worktree-switch chords still fire over a focused terminal instead of being passed to the shell.
Reviewed changes
- New
@orca/expo-hardware-keyboard-navigationExpo native module with iOS (UIKeyCommand+ ObjC runtime handler) and Android (window-callback +ReactActivityHandlerinterception) implementations for app-level key commands and physical-keyboard detection. - Worktree and tab keyboard-navigation hooks and pure helpers (cycling, index selection, MRU history) plus a new hardware-keyboard settings screen and a
orca-first/terminal-firstpreference store. - A
useHardwareKeyboardTextInputFocushook wired into the Native Chat composer and terminal command dock to refocus inputs without opening the software keyboard. - Terminal input connection-gate refactor so live-input sends share
resolveMobileTerminalInputGatewith the buffered command box.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 75efce93-2fb9-45f5-b150-cfb71a2c329a
📒 Files selected for processing (13)
mobile/app/h/_layout.tsxmobile/app/hardware-keyboard-settings.tsxmobile/src/hardware-keyboard/mobile-hardware-keyboard-bindings.test.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-preferences.test.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-preferences.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-registry.test.tsmobile/src/hardware-keyboard/mobile-hardware-keyboard-registry.tsmobile/src/hardware-keyboard/mobile-session-hardware-keyboard-context.test.tsmobile/src/hardware-keyboard/mobile-session-hardware-keyboard-context.tsmobile/src/hardware-keyboard/use-mobile-session-keyboard-navigation.tsmobile/src/hardware-keyboard/use-mobile-worktree-keyboard-navigation.test.tsmobile/src/hardware-keyboard/use-mobile-worktree-keyboard-navigation.tsmobile/src/session/mobile-session-route-parity.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- mobile/src/hardware-keyboard/use-mobile-session-keyboard-navigation.ts
- mobile/src/hardware-keyboard/mobile-hardware-keyboard-registry.ts
- mobile/app/hardware-keyboard-settings.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Threaded session keybinding context to the worktree scope — new
mobile-session-hardware-keyboard-context.tspublishes the session's active-tab context (terminal/app) keyed byhostId\0worktreeId;h/_layout.tsxreads it and passes it touseMobileWorktreeKeyboardNavigation, replacing the prior hardcodedcontext: 'app'. This resolves the earlierterminal-firstbypass. - Guarded worktree catalog refresh against stale host responses —
routeRefdiscards a catalog result whose client/hostId no longer match the current route. - Added nested-scope precedence —
claimedActionIdsdedup insyncNativeCommandslets a newer scope suppress an overlapping action from an older scope. - Made preference persistence failure-safe —
saveMobileTerminalShortcutPolicynow publishes only afterAsyncStorage.setItemsucceeds, and the settings screen surfaces a save error. - Added tests for the context registry, registry dedup, stale-catalog guard, and preference persistence ordering.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Cancelled in-flight worktree navigation on route change —
routeRefnow carries agenerationcounter that increments whenclient/hostIdchange;refreshreturnsnullonce the generation has advanced, and the command handler skipsapplyon anullresult, so a worktree switch triggered before a route transition can no longer fire over the new route.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…-add-hardware-keyboard-navigation # Conflicts: # mobile/src/session/mobile-session-route-parity.test.ts
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
This PR is good but big... Hmmm |
|
Rebased and split this work against the current |

ELI5
Orca mobile now responds to the same physical-keyboard workspace and tab shortcuts as desktop, while still letting the terminal own conflicting keys when the user chooses Terminal first.
What Changed
UIKeyCommandinstances and preserved terminal input across short tab-snapshot lag.Why
Issue #18041 asks for desktop keyboard-navigation parity on mobile devices with physical keyboards. Native key interception is required because React Native text inputs and terminal webviews otherwise consume or reroute these chords. Route-scoped registration keeps the policy and handlers owned by the active mobile surface without moving terminal or navigation logic across the RPC boundary.
Linked Issue
Fixes #18041
Visual Proof
N/A
This is OS-level physical-keyboard interception and focus behavior, which a static screenshot cannot demonstrate. Physical interaction validation is documented below.
Testing
Automated:
pnpm testinmobile/: 508 files passed; 4,083 tests passed, 3 skipped.pnpm tcpnpm run check:code-quality:changedgit diff --check:app:assembleDebugPhysical devices:
AI Disclosure
Review
Please focus on native command lifecycle, nested scope precedence, terminal-first filtering, route changes during catalog refresh, and physical-keyboard focus behavior.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Native Chat and terminal input changes are limited to integration safety: app shortcuts must remain available while inputs are focused, and returning from navigation must not swallow the next physical-keyboard input or open the software keyboard. This PR does not redesign terminal behavior or change the remote wire protocol.
Cross-platform shortcut definitions remain shared. Native behavior is isolated behind the Expo module, and worktree catalog access continues through the existing RPC client, preserving remote and SSH execution boundaries.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (changed-file lint and platform builds run locally; CI covers the repository-wide gates)