Skip to content

Improve Android foldable/tablet split-view sidebar UX - #6063

Closed
MONKE2525E wants to merge 1 commit into
pingdotgg:mainfrom
MONKE2525E:feat/android-foldable-sidebar-ux-pr
Closed

Improve Android foldable/tablet split-view sidebar UX#6063
MONKE2525E wants to merge 1 commit into
pingdotgg:mainfrom
MONKE2525E:feat/android-foldable-sidebar-ux-pr

Conversation

@MONKE2525E

@MONKE2525E MONKE2525E commented Aug 10, 2026

Copy link
Copy Markdown

Summary

Improves the Android foldable/tablet experience by making split view usable on near-square foldable layouts and adding controls for hiding and restoring the thread sidebar.

Changes

  • Enable split view for foldable-sized windows
  • Add Android sidebar hide/show controls
  • Add left-edge swipe gesture to restore or dismiss the sidebar
  • Prevent duplicate native/in-flow headers across fold/unfold transitions
  • Keep the new-task affordance available in the persistent split sidebar
  • Add tests for foldable layout detection and sidebar swipe behavior

Tested

  • Verified on a Samsung Galaxy Z Fold 7
  • 60 focused mobile tests passing
  • Mobile typecheck passing
  • \git diff --check\ clean

Note

Medium Risk
Touches navigation chrome, gesture handling, and adaptive layout across core Android routes; behavior is platform-scoped but fold/unfold and split-view edge cases are easy to regress.

Overview
Android split-view on foldables/tablets is easier to use: the thread sidebar can be hidden and restored via header actions, the empty Home detail pane, and a left-edge pan gesture (only when split view is active, so horizontal scrolling in terminal/diffs is not stolen).

Headers: Native stack headers are disabled statically on Android for Home, Thread, Terminal, Review, and Files so fold/unfold does not leave duplicate native + in-flow chrome. A new AndroidHeaderScreen wraps loading/unavailable routes with the same in-flow header; LoadingScreen gains includeTopInset when a header already owns the top safe area.

Sidebar chrome: Split sidebar uses CompactBrandTitle instead of a plain “Threads” title (scroll-fade wash removed), AndroidHomeFabLayout keeps new-task FAB in the persistent sidebar, and list padding avoids the FAB.

Tests cover sidebar swipe thresholds and foldable-friendly layout cases (e.g. re-evaluating compact ↔ split as window size changes).

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

Note

Improve Android foldable/tablet split-view sidebar UX with swipe gestures and in-flow headers

  • Disables native stack headers on Android for Home, Thread, Terminal, Review, and Files screens, replacing them with an in-flow AndroidScreenHeader that renders consistently across loading, error, and ready states.
  • Adds a left-edge swipe gesture on Android split layouts (via WorkspaceSidebarSwipeSurface) to show/hide the thread sidebar, with distance and velocity thresholds defined in workspace-sidebar-swipe.ts.
  • Adds a sidebar toggle action button to the in-flow header across Thread, Terminal, Review, and Files screens when in split-view mode on Android.
  • Replaces the sidebar's "Threads" title with CompactBrandTitle (font scaling disabled) and removes the scroll-based gradient wash effect.
  • Surfaces the Android FAB inside the sidebar column on split layouts via AndroidHomeFabLayout.

Macroscope summarized 41efc71.

Summary by CodeRabbit

  • New Features

    • Added Android edge-swipe gestures to open and close the primary sidebar.
    • Added floating new-task access from Android workspace layouts.
    • Added sidebar show/hide controls in Android split views, including threads, files, terminal, and reviews.
    • Improved Android headers, back navigation, accessibility labels, and safe-area handling.
    • Enhanced responsive layouts for split-screen and foldable devices.
  • Bug Fixes

    • Prevented duplicate or stale native headers and redundant spacing during layout changes.
  • Tests

    • Added coverage for sidebar gestures and responsive layout behavior.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 18a242ac-90c4-44cb-9b71-ea6277e6de92

📥 Commits

Reviewing files that changed from the base of the PR and between 9c7622d and 41efc71.

📒 Files selected for processing (16)
  • apps/mobile/src/Stack.tsx
  • apps/mobile/src/components/AndroidScreenHeader.tsx
  • apps/mobile/src/components/CompactBrandTitle.tsx
  • apps/mobile/src/components/LoadingScreen.tsx
  • apps/mobile/src/features/files/ThreadFilesRouteScreen.tsx
  • apps/mobile/src/features/home/HomeRouteScreen.tsx
  • apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
  • apps/mobile/src/features/layout/WorkspaceEmptyDetail.tsx
  • apps/mobile/src/features/layout/workspace-sidebar-swipe.test.ts
  • apps/mobile/src/features/layout/workspace-sidebar-swipe.ts
  • apps/mobile/src/features/review/ReviewSheet.tsx
  • apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx
  • apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
  • apps/mobile/src/features/threads/ThreadRouteScreen.tsx
  • apps/mobile/src/features/threads/sidebar-header-actions.android.tsx
  • apps/mobile/src/lib/layout.test.ts
💤 Files with no reviewable changes (1)
  • apps/mobile/src/features/threads/sidebar-header-actions.android.tsx

📝 Walkthrough

Walkthrough

Android routes now use in-flow headers instead of native headers where required. Split layouts now support sidebar toggles, edge swipes, floating new-task actions, and updated sidebar rendering. Layout and gesture tests cover the new behavior.

Changes

Android header foundation

Layer / File(s) Summary
Android header foundation
apps/mobile/src/Stack.tsx, apps/mobile/src/components/AndroidScreenHeader.tsx, apps/mobile/src/components/LoadingScreen.tsx, apps/mobile/src/components/CompactBrandTitle.tsx
Android native headers are disabled for selected routes. AndroidHeaderScreen provides in-flow headers. Loading screens support optional top insets. Brand text supports configurable font scaling.

Workspace sidebar interaction

Layer / File(s) Summary
Workspace sidebar interaction
apps/mobile/src/features/layout/..., apps/mobile/src/features/home/HomeRouteScreen.tsx, apps/mobile/src/lib/layout.test.ts
Android split layouts support edge-gated sidebar swipes, directional thresholds, sidebar controls, floating new-task navigation, and pane-width updates. Tests cover gesture decisions and window-size transitions.

Route headers and actions

Layer / File(s) Summary
Route headers and actions
apps/mobile/src/features/files/ThreadFilesRouteScreen.tsx, apps/mobile/src/features/threads/ThreadRouteScreen.tsx, apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx, apps/mobile/src/features/review/ReviewSheet.tsx
Fallback states use Android headers with titles and back navigation. Split-view routes expose actions that show or hide the primary sidebar.

Thread sidebar presentation

Layer / File(s) Summary
Thread sidebar presentation
apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
The sidebar uses measured solid branding instead of the SVG fade. Android bottom padding accounts for the floating action button and existing insets.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant WorkspaceSidebarSwipeSurface
  participant SwipeDecisionHelpers
  participant AdaptiveWorkspaceLayout
  User->>WorkspaceSidebarSwipeSurface: Start an edge swipe
  WorkspaceSidebarSwipeSurface->>SwipeDecisionHelpers: Validate position and direction
  SwipeDecisionHelpers-->>WorkspaceSidebarSwipeSurface: Return toggle decision
  WorkspaceSidebarSwipeSurface->>AdaptiveWorkspaceLayout: Toggle primary sidebar
Loading

Possibly related PRs

  • pingdotgg/t3code#18: Also changes Android terminal header and layout behavior in ThreadTerminalRouteScreen.

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the changes and testing, but it omits the required Why, UI media, and Checklist sections. Add a Why section, before/after screenshots, a short interaction video, and the completed Checklist.
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: Android foldable/tablet split-view sidebar UX improvements.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 10, 2026
Comment thread apps/mobile/src/Stack.tsx
// it disabled statically avoids a stale native header surviving a
// fold/unfold layout change (runtime headerShown toggling cannot
// reliably unmount an already-shown native header).
headerShown: Platform.OS !== "android",

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.

🟡 Medium src/Stack.tsx:431

ThreadRouteScreen's early-return branches (OpeningThreadLoadingScreen and ThreadUnavailableScreen) render no AndroidScreenHeader, but the Thread route now statically sets headerShown: Platform.OS !== "android", so on Android those screens have no header at all — no visible back button or navigation chrome while a thread is hydrating or when it can't be opened. The same gap exists for the loading/unavailable early returns in ThreadTerminalRouteScreen and ThreadFilesTreeScreen. Consider rendering a fallback AndroidScreenHeader in those branches, or only suppressing the native header once the replacement in-flow header is actually mounted.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/Stack.tsx around line 431:

`ThreadRouteScreen`'s early-return branches (`OpeningThreadLoadingScreen` and `ThreadUnavailableScreen`) render no `AndroidScreenHeader`, but the `Thread` route now statically sets `headerShown: Platform.OS !== "android"`, so on Android those screens have no header at all — no visible back button or navigation chrome while a thread is hydrating or when it can't be opened. The same gap exists for the loading/unavailable early returns in `ThreadTerminalRouteScreen` and `ThreadFilesTreeScreen`. Consider rendering a fallback `AndroidScreenHeader` in those branches, or only suppressing the native header once the replacement in-flow header is actually mounted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0a5f5950b: Thread/Terminal/Files early loading and unavailable states now render an in-flow AndroidScreenHeader (via a new AndroidHeaderScreen wrapper) so Android keeps navigation chrome when the native stack header is statically disabled. iOS behavior unchanged.

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.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

Comment thread apps/mobile/src/features/threads/ThreadRouteScreen.tsx
@macroscopeapp

macroscopeapp Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR introduces new Android foldable/tablet UX features including swipe-to-toggle sidebar gestures, new header rendering logic, and FAB integration across multiple screens. The scope constitutes new user-facing capability rather than a simple fix, and there are unresolved Medium-severity findings about header chrome gaps and gesture conflicts.

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

@MONKE2525E
MONKE2525E force-pushed the feat/android-foldable-sidebar-ux-pr branch 2 times, most recently from 8b26f90 to f295f6c Compare August 10, 2026 23:13
return;
}
runOnJS(props.onToggleSidebar)();
}),

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.

Edge swipe fights system back

Medium Severity

The new content-pane sidebar swipe only accepts starts in the left 72px band. When the primary sidebar is hidden that band is the screen’s left edge, which Android gesture navigation already uses for Back. There is no systemGestureExclusionRects (or equivalent) opt-out, so a restore swipe can be claimed by the system and pop the current route instead of showing the sidebar.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f295f6ce8bcfb7986f627f40d03bb661ef7a1787. Configure here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessed and not changed: RNGH 2.31.2 exposes no systemGestureExclusionRects API (verified against its type definitions), so applying this fix would require a native change or a gesture-system redesign. Swipe-in was verified working on-device and is intentionally 'functional and learnable' per the PR scope. Left as-is.

@MONKE2525E
MONKE2525E force-pushed the feat/android-foldable-sidebar-ux-pr branch from f295f6c to b137719 Compare August 11, 2026 03:16
Comment thread apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
@MONKE2525E
MONKE2525E force-pushed the feat/android-foldable-sidebar-ux-pr branch from b137719 to 0a5f595 Compare August 11, 2026 04:12
Comment thread apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx Outdated
@MONKE2525E
MONKE2525E force-pushed the feat/android-foldable-sidebar-ux-pr branch from 0a5f595 to 776b867 Compare August 11, 2026 04:33

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

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 776b8671daa174913fed4531880b47e65548492c. Configure here.

Comment thread apps/mobile/src/Stack.tsx
Restores split view for near-square foldable windows and adds Android
sidebar controls so the thread list can be hidden, shown, and swiped on
devices like the Galaxy Z Fold 7.

- Sidebar visibility and animation drive hide/show across fold changes.
- Android split headers draw in-flow instead of relying on the native
  stack header, fixing duplicate brand/back headers that lingered across
  fold/unfold.
- Left-edge-gated pan swipes the sidebar away and back in, with header
  buttons as the accessible fallback.
- New-task FAB sits in the persistent Android split sidebar.
- Split-detection and pane-visibility behavior are covered by layout and
  swipe unit tests.

Verified on a Galaxy Z Fold 7.
@MONKE2525E
MONKE2525E force-pushed the feat/android-foldable-sidebar-ux-pr branch from 776b867 to 41efc71 Compare August 11, 2026 04:43
@MONKE2525E

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@MONKE2525E

Copy link
Copy Markdown
Author

@cursor[bot] review

@MONKE2525E MONKE2525E closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant