Skip to content

fix(mobile): Android environment toggles toggle instead of opening the row - #21041

Closed
t3dotgg wants to merge 1 commit into
mainfrom
fix/android-env-switch-toggle
Closed

t3dotgg wants to merge 1 commit into
mainfrom
fix/android-env-switch-toggle

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

On 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

…e row

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 17, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 17, 2026
@github-actions github-actions Bot added the size:S 10-29 changed lines (additions + deletions). label Oct 17, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a9f0fd4

Macroscope'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.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 16918b5 and a9f0fd4.

📒 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 NativeSwitch now uses a Pressable to toggle its value. It disables the Pressable when props.disabled is true and places the Compose switch in a non-interactive, accessibility-hidden View.

Changes: Android NativeSwitch

Layer / File(s) Summary
Press handling
apps/mobile/src/components/ui/NativeSwitch.android.tsx
The wrapper changes from View to Pressable, which toggles the value when pressed and is disabled when props.disabled is true. The inner View ignores 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: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning 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 Passed checks: 3 passed
Check name Status Explanation
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 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

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

@t3dotgg t3dotgg added the 🚀 Mobile Continuous Deployment Trigger Expo preview build label Oct 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint e9a166de320920bf3553e5431ecb128eb39c75f9 4234d33f57bbfc9d8956cd01f43948d871583608
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: e9a166de320920bf3553e5431ecb128eb39c75f9
App version: 2.0.0
Git commit: 3149651a3ff95fa8437bd7beeb2bed1844b568b7
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: 4234d33f57bbfc9d8956cd01f43948d871583608
App version: 2.0.0
Git commit: 3149651a3ff95fa8437bd7beeb2bed1844b568b7
Update Details Update Permalink
DetailsBranch: pr-21041
Runtime version: e9a166de320920bf3553e5431ecb128eb39c75f9
Git commit: 3149651a3ff95fa8437bd7beeb2bed1844b568b7
Update Permalink
DetailsBranch: pr-21041
Runtime version: 4234d33f57bbfc9d8956cd01f43948d871583608
Git commit: 3149651a3ff95fa8437bd7beeb2bed1844b568b7
Update QR

@t3dotgg

t3dotgg commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

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.

@juliusmarminge

Copy link
Copy Markdown
Member

Note

Grok responding on behalf of Julius.

Closing as superseded: this change landed on main as part of #21071, which combined the four Android foldable PRs (#21049, #21044, #21043, #21041).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews 🚀 Mobile Continuous Deployment Trigger Expo preview build size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants