fix(mobile): preserve Android Usage across layout changes#25231

merged4
main
maria/takeover-pr-24903
opened5d agobyMmaria
View on GitHubTwo-way sync enabledPR last imported 1d ago

Problem

Crossing Android's compact/split workspace boundary remounts Usage, resetting its selected page, filters, and scroll container.

Change

Keep one workspace tab tree mounted across both layouts, retaining the original implementation's layout-specific safe-area insets, bottom clearance, navigation, and pull request content. Reuse the existing workspace test file instead of adding a new one.

Verification

  • Both compact-to-split and split-to-compact regression cases failed on current main with Limits replacing Usage.
  • Blacksmith vp run check:changed passed formatting, lint, both knip passes, affected mobile/scripts typechecks, and all 18 workspace tests. The regression drives the actual Android root with a stateful leaf and checks its state and DOM identity through repeated transitions.
  • Android native folding, resizing, scroll behavior, and before/after native captures remain unverified: this VM has no attached Android device. The web client does not exercise the Android root. No substitute web captures are presented as Android evidence.
  • Merged github/main (32bf48f42820) with merge commit 1a76f93797, preserving both mobile test registrations. Blacksmith vp run check:changed passed on this head; All 30 reported checks are green and GitHub reports no conflicts.
  • Two independent source reviews approved 1a76f93797 without findings. CodeRabbit reported no actionable findings on this head and its description check now passes.
  • Production changes affect Android only; provider, server, contracts, web, desktop, and iOS paths are unchanged.

Scope and approval

This is a focused fix for the Android layout transition resetting Usage state. It keeps the existing screen mounted and adds regression coverage in the existing test file. Maria requested this takeover of #24903.

Takeover

Replaces #24903, with thanks to @PixPMusic for the original implementation.

Built with GPT-6.1-Sol in the Codex harness on T3 Code.

Checks

23 successful · 16 skipped
All checks passed
0cce95d

Added 1 commit

  • fix(mobile): preserve Android Usage across layout changesf40df47
Synced from GitHub

Review in Change Stack →

Walkthrough

Android workspace tabs now use a shared rendering path for split and standard layouts. Layout-specific clearance, safe-area, empty-state, pull-request, header, and navigation behavior remain distinct. A mounted-render test checks that Usage content retains its state as layouts change.

Changes: Android workspace layout

Layer / File(s)Summary
Shared workspace rendering
apps/mobile/src/features/workspace/WorkspaceRootScreen.android.tsx
Split and standard layouts use a shared tab renderer. Clearance, safe-area insets, empty states, pull-request content, headers, and navigation vary by layout.
Layout-switch persistence test
apps/mobile/src/features/workspace/workspace-tabs-state.test.ts, apps/mobile/vite.config.ts
A mounted-render test alternates layout settings and checks that the Usage label and button instance persist. The React test project includes the test.

Priority: External image Normal

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

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: External image Minimal · up to 0cce9

No actionable merge-blocking issue was identified. Android resize behavior was reported verified on an emulator.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely identifies the main change: preserving Android Usage state across workspace layout changes.
Description checkPassedThe description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the regression, implementation, test coverage, verification results, and remaining pla…
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the regression, implementation, test coverage, verification results, and remaining platform limits.

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.

Synced from GitHub

Approvability

Verdict: Approved at 0cce95d

Macroscope's review found this PR approvable — Android workspace tabs now retain their mounted state across compact and split-view transitions while preserving layout-specific navigation and spacing. The change is confined to presentation and test configuration, with no material data or operational impact identified.

You can add or adjust custom eligibility rules. Learn more.

Added 1 commit

  • chore: merge main into Android Usage takeover334b33d

Note

Written by gpt-6.1-sol on behalf of Maria

Merged main into the existing head with merge commit 334b33db08ed7429ee258d560ca50d3dbb3d3c39. The sole conflict was the mobile test registration list; both sides' entries are preserved. The PR remains three files, 109 insertions and 37 deletions against main.

Blacksmith vp run check:changed passed formatting, lint, both knip passes, mobile/scripts typechecks, and all 18 workspace tests. Two independent source reviews found no issues on this head. New-head CI is awaiting mirror synchronization.

Native Android resizing/folding and captures remain unverified: adb lists no attached devices. Browser evidence cannot exercise the Android workspace root.

Added 1 commit

  • chore: merge main into Android Usage takeover1a76f93

Note

Written by gpt-6.1-sol on behalf of Maria

Pushed merge commit 1a76f93797484e041de6f72b47bbe5e79b42ad3c without force. The mobile test-list conflict preserves both sides. Scope remains three files, 109 additions and 37 deletions.

All 30 reported checks are green, with no conflicts. Blacksmith vp run check:changed passed formatting, lint, both knip passes, affected typechecks, and all 18 workspace tests. Two independent source reviews approved this head. CodeRabbit found no actionable issues; its description finding is addressed.

Native Android resizing/folding, scroll behavior, and captures remain unverified because adb lists no attached devices. This remains a verification gap before calling the UI ready. No dev servers were started; the task testbox is stopped.

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

No changed runtime behavior could be verified on this Linux VM. I read the diff, description, discussion, inline comments, and commit authors at 1a76f93797484e041de6f72b47bbe5e79b42ad3c. The PR is open, and none of its three PR commits is authored by @juliusmarminge or @t3dotgg. GitCafe identifies this as PR #25231 too. Its status reports 30 successful checks, zero failing and zero pending; this is CI status, not runtime proof.

The production change is confined to the native Android workspace root: keep Usage mounted while crossing compact/split layouts, preserving its page, filters, and scroll state. The web client does not run this Android root.

Device prerequisite checks this turn:

text
1$ adb devices -l
2List of devices attached
3[no devices]
4
5$ device_list
6Agent device access is turned off for this environment.

Not verified

The original bug on main and the fix on the PR remain unverified in the real app. No Android client was available. The required test-t3-mobile skill says: "If T3 device tools or the selected device are unavailable, report the blocker and stop verification. Do not install or switch to another automation system."

Consequently I did not start dev servers, install dependencies, create projects or provider turns, or substitute browser/mock evidence. Native Usage page/filter/scroll retention in both layout directions, repeated transitions, safe-area/bottom clearance, thread navigation, and pull request content remain unverified. No before/after screenshots or recording could be captured. No code, branch, labels, or PR description changed.

To complete verification, enable an Android device with resizing/folding support, reproduce on main, and repeat on this exact head with real project/thread data and Codex gpt-6.1-sol turns. Exercise Usage state retention and neighboring thread/PR navigation, and capture native evidence.

Note

Written by gpt-6.1-sol on behalf of Maria

Verified on Android emulator (API 35) against a real dev server

verified head 1a76f93797484e041de6f72b47bbe5e79b42ad3c on the t3 x86_64 emulator with kvm, the matching cached native dev client (ed36a9cc9856c84a322bb71e6d67744f0a00877d), metro on 8081, and an isolated backend on 13773 using .t3 state.

created the real Android verification project and two threads through the server. both Codex gpt-6.1-sol turns completed through this vm's local proxy. opened the resulting reply in the native client. no mocks or demo records were used; usage also reads this machine's existing real codex session history.

selected usage, 7d, and tokens, then resized the same running app between 1080×2400 and 2100×2400 pixels at 420 dpi (about 411 and 800 dp wide). the bottom navigation changed to the split navigation rail and back. usage, 7d, and tokens stayed selected through repeated transitions in both directions. a settled scroll round trip retained the visible providers/totals/cost position. deselecting the environment stayed deselected through another round trip, preserving the empty selection message and filled filter icon.

neighbor checks: opened a completed real codex reply from chats and returned; the real pull request list loaded in compact and split layouts. controls and bottom clearance remained usable.

ci reports 19 successful checks and 11 skipped checks, with no failures or pending checks. no source changes or pushes were needed, so no new check run was made.

before and after below mean before/after resizing on the pr head, not a main-versus-pr comparison.

compact before resizing, usage with 7d and tokens selected

split after resizing, usage with 7d and tokens retained

compact to split and back in the same running android app

settled scroll position before a resize round trip

settled scroll position after a resize round trip

completed real codex reply in the android client

Not verified

  • iOS cannot run on this linux vm.
  • the original failure was not run on github/main; these captures verify the pr head.
  • physical folding/hinge hardware, freeform windows, and rotation were not exercised. emulator display resizing exercised the compact/split boundary.
  • codex limits retrieval returns Codex could not read usage (JSON-RPC -32600) through the local proxy. usage history and real turns work; successful limits retrieval remains unverified.
  • a separate display-density experiment restarted the android activity and reset navigation to chats. it is not counted as a passing resize check; this pr retains a mounted tree and does not persist state across activity restarts.

Added 1 commit

  • chore: merge main into Android Usage takeover0cce95d

Note

Written by gpt-6.1-sol on behalf of Maria

Merged github/main (b42adff3d77f) into the existing head with merge commit 0cce95db8488f341ab21bfe9f0ad96650d9b2bbc, pushed without force. Resolved the Android root conflict by preserving main's floating navigation and safe-area behavior alongside this PR's stable Usage tree. Both mobile test registrations are retained. Scope remains three files (135 additions, 50 deletions against the merged main).

Blacksmith vp run check:changed passed format, lint, both knip passes, mobile/scripts typechecks, all 20 workspace tests, and focused React Compiler coverage. Existing regression cases now cover floating tabs enabled and disabled. Two independent source reviews approved this exact head without findings. GitCafe reports 32 successful checks, zero pending/failing, and no conflicts.

Native Android verification of the conflict resolution remains unverified: device_list returns Agent device access is turned off for this environment. Prior Android evidence in this discussion covers the previous head, not the new floating-navigation integration. Browser evidence cannot exercise this Android root. No dev servers were started; the testbox is stopped. No merge or label changes were made.