Skip to content

fix(mobile): stop support modules from registering as routes - #11652

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/mobile-router-support-file-placement
Aug 2, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/mobile-router-support-file-placement

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

What this fixes

Expo Router treats every source module under mobile/app/ as a potential screen. Eight support files containing styles, types, and components lived there, so every mobile launch logged misleading “missing default export” route warnings.

Before / after

  • Before: Startup emits eight route warnings for files that were never meant to be screens.
  • After: Only real route modules remain under mobile/app/, so those warnings disappear.

What changed

  • Move the eight non-route modules into domain-specific folders under mobile/src/.
  • Update the real routes and tests to import them from their new locations.
  • Add a boundary test requiring source files under mobile/app/ to be genuine default-exporting routes.

This is a file-boundary cleanup. It does not intentionally change navigation, layout, terminal behavior, or account behavior.

Verification

  • Exact PR head 4d902529edc402c4d60dbe09e5d0d1a7351f49f0 integrates cleanly with origin/main at f936e7fc9c7defebc40398a1ddf2ce50e93c7dfc; simulated integration tree: e61117cdc7f2fac5346f3aaf2606a11b16c1541a.
  • Exact-head CI mobile suite passed: 375 files, 2,776 tests passed, 3 skipped. Mobile typecheck, lint, and formatting checks passed.
  • Focused route-boundary test passed: 4/4. The integrated tree contains 29/29 valid route source files.
  • Native iPad build succeeded with 0 errors; cold iOS Metro bundled 4,638 modules in 16.302s.
  • Native traversal passed: landing → connected host → Accounts → back → Session → back to worktrees → back to hosts. Accounts and Session rendered normally, including the moved support-module import graphs, with unchanged back navigation.
  • The retained native startup/navigation log contained 0 Expo Router missing-default-export warnings and no warnings naming any of the eight former support modules.
  • Screenshot evidence: fix(mobile): stop support modules from registering as routes #11652 (comment)
  • Android native runtime QA remains outstanding because the iPad was the only granted native lane.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Mobile accounts and session screens now use shared mobile module paths. Session route types and style modules use local dependencies, and a combined styles export is available. Session-related tests update their fixture and type import paths. A new Vitest suite checks Expo app modules for valid default exports.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the issue and verification, but it omits the required AI Review Report and Security Audit sections. Add the required AI Review Report and Security Audit sections, including explicit macOS, Linux, and Windows compatibility checks and security-risk findings.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main change: preventing support modules from registering as Expo Router routes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0278f539-8ff8-4aa5-aa4e-6fac05b08d9c

📥 Commits

Reviewing files that changed from the base of the PR and between 33b6d4d and 27704b4.

📒 Files selected for processing (17)
  • mobile/app/h/[hostId]/accounts.tsx
  • mobile/app/h/[hostId]/session/[worktreeId].tsx
  • mobile/src/accounts/mobile-accounts-screen-styles.ts
  • mobile/src/expo-route-module-boundary.test.ts
  • mobile/src/session/MobileBrowserTabActionSheet.tsx
  • mobile/src/session/MobileSessionHeaderIconButton.tsx
  • mobile/src/session/QuickCommandsTabButton.tsx
  • mobile/src/session/mobile-bulk-close-sheet-actions.ts
  • mobile/src/session/mobile-session-command-input-styles.ts
  • mobile/src/session/mobile-session-frame-styles.ts
  • mobile/src/session/mobile-session-reader-styles.ts
  • mobile/src/session/mobile-session-review-comment-styles.ts
  • mobile/src/session/mobile-session-route-types.ts
  • mobile/src/session/mobile-session-styles.ts
  • mobile/src/session/mobile-terminal-tab-agent.test.ts
  • mobile/src/session/mobile-terminal-tab-agent.ts
  • mobile/src/terminal/terminal-live-input-affordance.test.ts

@greptile-apps

greptile-apps Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR is a file-boundary cleanup that moves eight non-route support modules from mobile/app/ into mobile/src/ to stop Expo Router from registering them as screen routes on startup. All downstream import paths in the real route files and tests are updated accordingly.

  • Eight files (styles, types, and a component) are renamed/moved from mobile/app/h/[hostId]/session/ and mobile/app/h/[hostId]/ into mobile/src/session/, mobile/src/accounts/, etc., with their relative imports corrected.
  • A new mobile/src/expo-route-module-boundary.test.ts is added that uses the TypeScript compiler API to verify every file remaining under mobile/app/ carries a genuine default export, guarding against future regressions.

Confidence Score: 5/5

Safe to merge — pure file-move refactoring with no logic changes; all import paths verified correct.

Every changed line is either a file rename, a relative import path correction, or an update to a test URL. The logic in all moved files is identical to what was there before. The new boundary test uses the TypeScript compiler AST (not string matching) to detect default exports, correctly handling re-export forms.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
mobile/src/expo-route-module-boundary.test.ts New boundary guard test; uses TypeScript AST to detect default exports, correctly handles re-export forms like export { default } from.
mobile/src/session/mobile-session-route-types.ts Renamed from app/h/[hostId]/session/; all import paths updated correctly for the new location under mobile/src/session/.
mobile/app/h/[hostId]/session/[worktreeId].tsx Three import statements updated from local ./ paths to ../../../../src/session/ paths; no logic changes.
mobile/src/session/QuickCommandsTabButton.tsx Renamed from app/ directory; theme import path updated to ../theme/mobile-theme, styles import is now sibling-relative.
mobile/src/terminal/terminal-live-input-affordance.test.ts URL path for mobile-session-command-input-styles.ts updated from the old app/ location to ../session/; no test logic changes.
mobile/src/accounts/mobile-accounts-screen-styles.ts Renamed from mobile/app/h/[hostId]/accounts-screen-styles.ts; theme import corrected to ../theme/mobile-theme.

Reviews (4): Last reviewed commit: "test(mobile): reject platform API routes..." | Re-trigger Greptile

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review and rendered QA — current head b59563774e

A serialized same-model review found and fixed one meaningful issue in the new boundary test: text matching could be fooled by comments, strings, and type-only exports, and rejected valid default re-exports. The test now uses the TypeScript parser, recognizes Expo special modules, and has focused regression cases. A fresh second review pass returned clean.

Warning-count and regression evidence

  • Base (33b6d4de3e): 8 invalid Expo route modules — the eight support files moved by this PR.
  • Current head: 0 invalid Expo route modules.
  • Expo Web: Metro bundled 4,226 modules in 3.679 s with 0 missing-default-export warnings.
  • Full mobile suite: 370 files, 2,757 passed, 3 skipped.
  • Targeted boundary test: 3/3 passed.
  • Passed: mobile typecheck, standalone test typecheck, oxlint, oxfmt, and git diff --check.
  • No stale imports to the moved paths; no runtime/performance path changed.

Real rendered Expo-Web proof

Landing screen:

Expo-Web landing on b59563774e

Direct render of the changed Accounts route (the expected unpaired-host state confirms the moved style/component graph loads):

Expo-Web Accounts route on b59563774e

Native-device gap: coordinator approval for QA-iPad testing was declined because the sole allowed QA device was occupied. No emulator/simulator command was run, no device was acquired, and the prohibited device was not touched; native runtime proof remains outstanding.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Native iPad router QA — exact head 4d902529edc4

Tested only the granted iPad Pro 13-inch (M5), UDID C589AF84-2F0C-4978-952B-748933DE6804.

  • Fetched origin/main at f936e7fc9c7defebc40398a1ddf2ce50e93c7dfc.
  • Exact-head/current-main merge simulation was conflict-free; integration tree: e61117cdc7f2fac5346f3aaf2606a11b16c1541a.
  • Native build succeeded with 0 errors. Cold iOS Metro bundled 4,638 modules in 16.302s.
  • Complete retained native startup/navigation log scan: 0 Expo Router missing-default-export warnings and 0 warnings naming any of the eight former support modules.
  • Native route traversal passed: landing → Host 5 → Accounts → back → Session (Ask Orca global chat) → back to worktrees → back to hosts.
  • Accounts rendered Claude/Codex content; Session rendered its tab strip, Quick Commands action, chat input, and dictation control. Back navigation remained unchanged.
  • Exact-head CI mobile totals: 375 test files passed; 2,776 tests passed; 3 skipped. Mobile typecheck, lint, and format checks passed. Focused local boundary test: 4/4 passed.
  • Android native runtime QA was not run; the iPad was the only granted native lane. Static integrated-tree validation still reports 29/29 route source files valid.

The only Metro warning was the unrelated existing @noble/hashes/crypto.js exports fallback.

Screenshots

Native landing:

iOS native landing

Native Accounts route:

iOS native Accounts route

Native Session route:

iOS native Session route

@brennanb2025
brennanb2025 merged commit 2efc6e5 into main Aug 2, 2026
82 of 84 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…i#11652)

* fix(mobile): keep support modules out of Expo routes

* test(mobile): parse Expo route exports

* test(mobile): reject platform-specific API routes

* test(mobile): reject platform API routes unconditionally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant