fix(mobile): connecting an environment no longer crashes the header#22521
Connecting a new environment can crash development builds with “Couldn't find a navigation context” when the header checkmark becomes a loading indicator. The toolbar options comparison follows the React element's development-only owner into React Navigation's context.
Compare React elements by type, key, and props, and preserve React component/context objects by identity. This keeps equivalent toolbar updates stable without traversing React internals. It also covers custom content in sheet headers.
Verification: 14 focused toolbar and pairing tests pass. The new regression test exercises a custom toolbar element beneath a context with a throwing default, including equivalent renders and changed content. On the iPhone Duo simulator, auto-connect reaches normal connection-error handling without the navigation render error. No visual styling changes.
Implemented by Claude Opus 5.5 through the T3 Code Claude harness; reviewed and verified by GPT-6.1 through the Codex harness.
Checks
- SuccessfulCodeRabbitGitHub
Review skipped
- Successful
Skipped - Not affected
- Skipped
- Skipped
- Skipped
- SuccessfulRemove preview downloadGitHub
- SuccessfulCheckGitHub
- Skipped
- SkippedTest WebGitHub
- SkippedRustGitHub
- SkippedRelease SmokeGitHub
- SuccessfulTestGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulNative fingerprint diffGitHub
- SkippedBuild preview JS bundleGitHub
- Successful
- SkippedEAS PreviewGitHub
- SkippedDeploy web previewGitHub
- Successful
- SuccessfulLabel PR 22521GitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- Successful
- Successful
- Successful
- Successful
- SkippedEAS PreviewGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulPOST to CursorGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 6GitHub
- CancelledNative fingerprint diffGitHub
- SuccessfulTest Server 2GitHub
- SuccessfulLintGitHub
- SuccessfulChangesGitHub
Added 1 commit
- fix(mobile): adding an environment no longer crashes while connectingaaa7380
Approvability
Verdict: Approved at aaa7380
Macroscope's review found this PR approvable — This is a focused mobile crash fix that safely bounds React-element and context handling in the existing header-options signature logic. Regression coverage verifies custom header rendering, deduplication, and updates without changing APIs, product defaults, or deployment behavior.
You can add or adjust custom eligibility rules. Learn more.