Skip to content

Allow Android tablets to rotate - #5613

Merged
juliusmarminge merged 3 commits into
mainfrom
fix-android-tablet-landscape
Aug 10, 2026
Merged

Allow Android tablets to rotate#5613
juliusmarminge merged 3 commits into
mainfrom
fix-android-tablet-landscape

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 7, 2026

Copy link
Copy Markdown
Member

What Changed

Added an Expo config plugin that enables Android tablets with a smallest width of at least 600dp to support all orientations while keeping phones locked to portrait.

Why

The app's top-level portrait orientation setting currently locks Android tablets to portrait. This mirrors iPad behavior by allowing tablet rotation while preserving the existing portrait-only behavior on phones.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Scoped Android native MainActivity orientation logic with idempotent plugin injection; no auth, data, or API changes.

Overview
Adds withAndroidTabletOrientation, a new Expo config plugin registered in app.config.ts, so Android behavior matches iOS: phones stay portrait-only while tablets can rotate.

At build time the plugin patches MainActivity to call applyTabletOrientation() after onCreate and again in onConfigurationChanged. When smallestScreenWidthDp >= 600, it sets requestedOrientation to SCREEN_ORIENTATION_FULL_USER (overriding the manifest portrait lock); otherwise it forces portrait. Fold/unfold on foldables re-applies the same rule without requiring an activity restart.

Reviewed by Cursor Bugbot for commit 1f42088. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Allow Android tablets to rotate freely while keeping phones in portrait

  • Adds a new Expo config plugin withAndroidTabletOrientation.cjs that patches MainActivity.kt at build time to inject orientation logic.
  • At runtime, devices with smallestScreenWidthDp >= 600 (tablets) use SCREEN_ORIENTATION_FULL_USER, respecting the system auto-rotate setting; phones stay locked to portrait.
  • An onConfigurationChanged override re-evaluates orientation on each configuration change, covering foldable devices.
  • The plugin is registered in app.config.ts and skips patching if already applied.

Macroscope summarized 1f42088.

Summary by CodeRabbit

  • Enhancements
    • Improved tablet orientation support in the mobile app, allowing users to select available screen orientations on larger Android tablets.
    • Preserved portrait orientation behavior on Android phones.

- Add an Expo config plugin that enables all user-allowed orientations on tablets
- Keep portrait locking for Android phones
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The mobile app registers an Expo config plugin. The plugin modifies Kotlin MainActivity to allow user-selected orientations on tablets while preserving manifest portrait behavior on phones.

Changes

Android tablet orientation

Layer / File(s) Summary
Register and implement tablet orientation override
apps/mobile/plugins/withAndroidTabletOrientation.cjs, apps/mobile/app.config.ts
The Expo plugin validates Kotlin MainActivity files, adds the ActivityInfo import and tablet-only SCREEN_ORIENTATION_FULL_USER override, avoids duplicate insertion, and is registered in the app configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 and concisely describes the primary change: enabling Android tablet rotation.
Description check ✅ Passed The description includes the required What Changed, Why, and Checklist sections and explains the tablet and phone behavior.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-android-tablet-landscape

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 11.3 KiB 11.3 KiB −22 B (−0.2%) 15.1 KiB
Codex Thread snapshot wire 5.5 KiB 5.5 KiB −3 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 5.9 KiB 5.9 KiB −19 B (−0.3%) 7.8 KiB
Codex Live turn WebSocket decoded 49.7 KiB 49.7 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 16 16 0 (0.0%) 21
Claude Total thread wire 11.3 KiB 11.3 KiB −4 B (−0.0%) 15.1 KiB
Claude Thread snapshot wire 5.5 KiB 5.5 KiB −4 B (−0.1%) 7.3 KiB
Claude Live turn WebSocket wire 5.9 KiB 5.9 KiB 0 B (0.0%) 7.8 KiB
Claude Live turn WebSocket decoded 50.6 KiB 50.6 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 16 16 0 (0.0%) 21

Baseline: 9690680 · PR result: 1f42088 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 94.6 KiB
  • Claude decoded thread snapshot: 95.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 7, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR enables new user-facing behavior (screen rotation) on Android tablets that were previously locked to portrait. While well-implemented and following existing plugin patterns, new runtime capabilities that change user experience warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Aug 10, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit 1e430ec. Configure here.

Comment thread apps/mobile/plugins/withAndroidTabletOrientation.cjs Outdated
- Reapply orientation policy when foldables cross the tablet breakpoint
- Restore portrait locking when folding back to phone dimensions
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 10, 2026 19:05

Dismissing prior approval to re-evaluate 1f42088

@juliusmarminge
juliusmarminge merged commit 428d9f9 into main Aug 10, 2026
19 checks passed
@juliusmarminge
juliusmarminge deleted the fix-android-tablet-landscape branch August 10, 2026 19:18
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 10, 2026
## What's Changed
* fix(ci): extend release publish timeout by @t3-code[bot] in pingdotgg/t3code#6034
* Allow Android tablets to rotate by @juliusmarminge in pingdotgg/t3code#5613
* fix(web): account for Windows window controls in PR page header by @UtkarshUsername in pingdotgg/t3code#6049


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260810.1061...v0.0.34-nightly.20260810.1062

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260810.1062
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. size:M 30-99 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.

1 participant