fix(mobile): Android environment toggles toggle instead of opening the row #21041
main fromfix/android-env-switch-toggle·opened View on GitHubOn Android, the environment toggles did not toggle. A tap on the switch opened the environment detail view instead. On the detail view, a tap on the switch expanded the row instead.
The Android switch is a Jetpack Compose view inside a row Pressable. Now an RN Pressable around the switch handles the tap, and the Compose view has pointerEvents="none", so it only draws the switch. The innermost Pressable gets the tap, so the row's onPress cannot run instead of the toggle.
This is the shared Android NativeSwitch, so all Android switches now use this tap path. You can no longer drag the thumb on Android.
Testing on emulators (Pixel 8 on API 36, Pixel Fold on API 37, both phone and unfolded layouts):
- With this change, the Environments list switch and the environment detail switch toggle off and on. The list stays open and the detail row stays closed. A tap on the row still opens the details. A normal settings switch (Thread behavior) still toggles and keeps its label for accessibility.
- With the old code, the emulators did not reproduce the bug. The switch toggled there too. The bug was seen on a Galaxy Fold (Android 17) connected through T3 Connect. This PR has the mobile preview label so it can be checked on that device.
Reviewed with sol-loop: 1 round with GPT-6.1 Sol. Sol verdict: approved
Made with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
juliusmarminge added labelsmacroscope-review
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
a9f0fd4Macroscope's review found this PR approvable — This is a focused, one-file Android bug fix that redirects switch taps to the existing toggle callback and prevents them from opening the enclosing environment row. It leaves other platforms and the surrounding switch contract unchanged, with no product-default, static-analysis, schema, or sensitive-area changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
d50e9ed6-8e60-4ba7-88da-b107de00f426
📥 Commits
-
Reviewing files that changed from the base of the PR and between 16918b57d6754d6f145e9b6367c825aa31a740da and a9f0fd4fff216ae0c2a4bae870fa4f3bcd235940.
📒 Files selected for processing: 1
-
apps/mobile/src/components/ui/NativeSwitch.android.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
📝 Walkthrough
-
The Android
NativeSwitchnow uses aPressableto toggle its value. It disables thePressablewhenprops.disabledis true and places the Compose switch in a non-interactive, accessibility-hiddenView.Changes: Android NativeSwitch
Layer / File(s) Summary Press handling
apps/mobile/src/components/ui/NativeSwitch.android.tsxThe wrapper changes from ViewtoPressable, which toggles the value when pressed and is disabled whenprops.disabledis true. The innerViewignores pointer events. The previous explicit accessibility activate action and handler are removed.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
a9f0f-
Android switch taps toggle without also navigating or expanding their parent row. No concrete merge-blocking issue is established; the change is ready for normal checks.
Pre-merge checks:
3 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Description check The description explains the problem, implementation, testing, limitations, and agent usage. It does not include the required Scope and approval section or explain the applicable approval exemption. I… Add a Scope and approval section with the triaged issue or maintainer approval, or explain why this focused obvious bug qualifies for the exemption. Add clear before-and-after screenshots for the UI change, and include a recording if needed… Passed checks: 3 passed-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check The title clearly and concisely describes the Android switch behavior being fixed.
Full details: Description check
-
Explanation
The description explains the problem, implementation, testing, limitations, and agent usage. It does not include the required Scope and approval section or explain the applicable approval exemption. It also omits the required before-and-after UI screenshots.
Resolution
Add a Scope and approval section with the triaged issue or maintainer approval, or explain why this focused obvious bug qualifies for the exemption. Add clear before-and-after screenshots for the UI change, and include a recording if needed to demonstrate the interaction behavior.
-
- Fix all pre-merge checks with AI
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
t3dotgg(GitHub profile, opens in a new tab) added labels🚀 Mobile Continuous Deployment
🚀 Expo continuous deployment is ready!
- Project → t3-code
- Platforms → android, ios
- Scheme → t3code-preview
🤖 Android 🍎 iOS Fingerprint e9a166de320920bf3553e5431ecb128eb39c75f9 4234d33f57bbfc9d8956cd01f43948d871583608 Build Details Build Permalink Details
Distribution:INTERNAL
Build profile:preview:dev
Runtime version:e9a166de320920bf3553e5431ecb128eb39c75f9
App version:2.0.0
Git commit:3149651a3ff95fa8437bd7beeb2bed1844b568b7Build Permalink Details
Distribution:INTERNAL
Build profile:preview:dev
Runtime version:4234d33f57bbfc9d8956cd01f43948d871583608
App version:2.0.0
Git commit:3149651a3ff95fa8437bd7beeb2bed1844b568b7Update Details Update Permalink Details
Branch:pr-21041
Runtime version:e9a166de320920bf3553e5431ecb128eb39c75f9
Git commit:3149651a3ff95fa8437bd7beeb2bed1844b568b7Update Permalink Details
Branch:pr-21041
Runtime version:4234d33f57bbfc9d8956cd01f43948d871583608
Git commit:3149651a3ff95fa8437bd7beeb2bed1844b568b7Update QR Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Closing: this change shipped in #21071, which combined it with the other Android foldable fixes.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes