Skip to content

feat(mobile): show workspace sidebar on landscape phones - #18360

Open
isairz wants to merge 4 commits into
stablyai:mainfrom
isairz:isairz/mobile-landscape-sidebar
Open

isairz wants to merge 4 commits into
stablyai:mainfrom
isairz:isairz/mobile-landscape-sidebar

Conversation

@isairz

@isairz isairz commented Sep 3, 2026 •

Copy link
Copy Markdown

ELI5

Orca Mobile now keeps the workspace list beside the active workspace when a landscape phone is wide enough, just like on a tablet. If the list is hidden, a compact edge tab remains so it can always be reopened without taking width away from the workspace.

What Changed

  • Classify windows as wide when width is at least 700px and the window is either tablet-sized or landscape.
  • Preserve the existing 600px tablet short-side classification.
  • Reuse one accessible HostSidebarToggleButton for both hide and reopen actions.
  • Show the reopen action as a compact floating edge tab instead of a full-height rail.
  • Keep the base host route sidebar visible synchronously, including the render before its state-reset effect runs.
  • Add boundary, accessibility, and sidebar-presentation regression tests.

This change is based on main and is independent from keyboard-navigation PR #18195.

Why

Wide landscape phones have enough room for the tablet-style workspace split view, but were forced into full-screen list navigation. Wide layouts also had no in-place way to recover after hiding the workspace sidebar.

The list, host catalog, and navigation implementation are unchanged, so folder workspaces and git worktrees continue through the same existing paths.

Linked Issue

Fixes #18365

Visual Proof

Before: landscape phone opens the session without a workspace sidebar

Before: landscape phone with a full-screen session and no workspace sidebar in iPhone Simulator frame

After: landscape phone uses the wide split layout

After: landscape phone with workspace sidebar and detail in iPhone Simulator frame

After collapse: compact reopen edge tab without an empty rail

After collapse: compact upper-left reopen tab in iPhone Simulator frame

Testing

  • I manually tested these changes locally.
  • Automated tests added/updated.
  • pnpm --dir mobile test src/layout/responsive-layout-metrics.test.ts src/layout/host-sidebar-presentation.test.ts src/components/HostSidebarToggleButton.test.tsx — 14 tests passed.
  • pnpm tc — passed.
  • pnpm run check:code-quality:changed — passed with 0 findings.
  • iPhone 17 Pro simulator, iOS 26.5, landscape — verified before/after layout, hide, accessible reveal tab, reopen, and return to the base host route against the mock runtime.
  • iPad mini simulator, iOS 26.5, landscape — verified split layout, hide, reveal, and reopen against the mock runtime.
  • Android/Fold hardware was not available; the shared React Native path and deterministic width boundaries are covered by tests.

Author

  • GitHub: @isairz
  • X: N/A (no public handle listed)

AI Disclosure

OpenAI Codex (GPT-5) was used for implementation, tests, review, and simulator validation.

Review

  • Security: no authentication, persistence, secrets, or remote protocol changes.
  • Cross-platform: shared React Native layout and pressable behavior only; no platform-specific APIs remain in the implementation.
  • SSH/remote/local: no RPC, execution-host, connection, or navigation contract changes.
  • Agents/integrations/git providers: no agent, integration, or provider-specific behavior changes.
  • Folder workspaces/git worktrees: the existing host workspace catalog and routes are reused unchanged.
  • Performance: constant-time dimension and presentation decisions; the hidden sidebar unmount behavior is unchanged.
  • UI/accessibility: existing mobile theme tokens and Lucide icons are reused; the control exposes button role, label, hint, expanded state, and 48pt effective hit area.

Agent skill upstream boundary

  • Not applicable; this change copies or translates no upstream skill-installer source.

Notes

The base host route resolves directly to the visible-sidebar presentation, so a collapsed detail route cannot flash the reveal control over the empty placeholder while the state-reset effect runs.

Checklist

  • This PR is small and focused.
  • I explained what changed and why.
  • Before/after screenshots are attached.
  • Self-reviewed for correctness, security, and performance.
  • Cross-platform, SSH/remote, and compatibility impact considered.
  • Scoped tests, pnpm tc, and changed-file quality checks pass; remaining full-suite/build coverage is left to CI.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

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: Team

Run ID: 4b4c2ad6-c5b3-41f9-a4e1-daea393c46c9

📥 Commits

Reviewing files that changed from the base of the PR and between 41a06d9 and d13296c.

📒 Files selected for processing (1)
  • mobile/app/h/_layout.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds a shared HostSidebarToggleButton with state-specific icons, styles, accessibility metadata, and tests. The host layout derives sidebar presentation states and renders either the sidebar or a reveal tab. The host screen header uses the shared toggle. Responsive metrics classify qualifying landscape windows as wide layouts, with boundary tests for landscape and tablet dimensions.

Merge Risk: 🟡 Moderate · up to d1329

On landscape phones with a left-side camera cutout, users may be unable to reliably access the control needed to reopen a hidden workspace sidebar. Restore safe-area-aware positioning before merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy the coding objectives in issue #18365 [#18365], including wide-layout classification, sidebar reveal behavior, synchronous base-route visibility, shared accessibility controls, and…
Out of Scope Changes check ✅ Passed The layout logic, shared toggle component, presentation helper, regression tests, and accessibility updates are directly related to the linked issue objectives. No unrelated code changes are evident.
Title check ✅ Passed The title clearly and concisely describes the primary change: enabling the workspace sidebar on landscape phones.
Description check ✅ Passed The description follows the repository template and includes the change, rationale, linked issue, visual proof, testing, review notes, AI disclosure, boundary status, and checklist. It also explains t…
Full details: Linked Issues check

Explanation

The changes satisfy the coding objectives in issue #18365 [#18365], including wide-layout classification, sidebar reveal behavior, synchronous base-route visibility, shared accessibility controls, and preserved navigation paths.

Full details: Description check

Explanation

The description follows the repository template and includes the change, rationale, linked issue, visual proof, testing, review notes, AI disclosure, boundary status, and checklist. It also explains that full-suite and build validation remain covered by CI.

  • Fix all pre-merge checks with AI

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.

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: e5f30f25-8a79-4012-86e6-9aedcd16cf69

📥 Commits

Reviewing files that changed from the base of the PR and between 94fcbe1 and ac37227.

📒 Files selected for processing (7)
  • mobile/app/h/_layout.tsx
  • mobile/src/components/HostSidebarToggleButton.test.tsx
  • mobile/src/components/HostSidebarToggleButton.tsx
  • mobile/src/host-screen/host-screen-header.tsx
  • mobile/src/host-screen/host-screen-primary-styles.ts
  • mobile/src/layout/responsive-layout-metrics.test.ts
  • mobile/src/layout/responsive-layout-metrics.ts
💤 Files with no reviewable changes (1)
  • mobile/src/host-screen/host-screen-primary-styles.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread mobile/app/h/_layout.tsx Resolved

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

✅ No new issues found.

Reviewed changes

  • Wide-layout classification — getResponsiveLayoutMetrics now treats width >= 700 in landscape as isWideLayout (on top of the existing tablet short-side rule), flipping the [hostId] base route to the detail placeholder and moving landscape phones into the split view.
  • Collapsible-sidebar reveal rail — HostGroupLayout renders a safe-area-aware left rail (40px + insets.left, top/left inset padded) whenever the wide sidebar is collapsed, exposing a reusable HostSidebarToggleButton to reopen it.
  • Shared toggle component — the new HostSidebarToggleButton centralizes the hide/reopen Pressable with label, hint, and expanded state, and the header's inline collapse button is replaced with it.
  • Tests — a boundary table (699/700 across landscape and tablet) and a renderer test asserting the toggle's accessibility contract and single onPress fire.

ℹ️ isWideLayout is a shared flag with reach beyond this PR's title

The change deliberately broadens isWideLayout, which is consumed well past the workspace sidebar: home host list and empty state (content capping/centering), session panel dock (canDockSessionPanel), PR sidebar dock (canDockPrSidebar), MobileDiffReviewScreenView, RightDrawer width resolution, and mounted-bottom-drawer modal capping. The PR body and validation only cover the workspace sidebar, so I traced the other callers to confirm they don't misbehave on a landscape phone. They appear benign — the dock paths are gated by measured available width, and the detail pane on a landscape phone (window width minus the sidebar) falls below the 640px/680px dock thresholds, so panels stay in push/overlay mode; the rest is cosmetic capping. No code change required, but worth a quick landscape-phone sanity check of the home list and the session/diff-review screens if that behavior wasn't an explicit goal.

Technical details
# Blast radius of widened isWideLayout

## Affected sites (all mobile/)
- src/session/use-mobile-session-foundation.ts — canDockSessionPanel (dock gated by HOST_DOCK_MIN_WIDTH 280 + minMain 360 = 640)
- src/components/mobile-pr-sidebar-presentation.ts — canDockPrSidebar (320 + 360 = 680)
- src/components/MobileDiffReviewScreenView.tsx — inline vs overlay PR sidebar
- src/components/right-drawer-panel-width.ts — caps wide panel at 420
- src/components/mounted-bottom-drawer.tsx — caps modal at modalMaxWidth 480
- src/home/MobileHomeHostList.tsx / MobileHomeEmptyState.tsx — cap + center at contentMaxWidth 720
- app/h/[hostId]/index.tsx — base host route -> WorkspaceDetailPlaceholder

## Required outcome
- None required; the concern is a scope/validation question, not a defect.

## Open questions for the human (optional)
- Is dock/centering behavior on landscape phones an intended consequence, or should isWideLayout stay tablet-only with a separate split-view flag for the sidebar?

ℹ️ Nitpicks

  • Two comments are now inaccurate due to the semantic change (both in unchanged lines, so noted here rather than inline): mobile/app/h/_layout.tsx:65 ("Wide layout = tablet/foldable canvas") and mobile/src/host-screen/use-host-screen-controller.ts:50 ("on phones isWideLayout is false so it stays edge-to-edge").

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: dd484a41-3c27-4941-a0f0-6a44b5ded95c

📥 Commits

Reviewing files that changed from the base of the PR and between ac37227 and 7fa3463.

📒 Files selected for processing (4)
  • mobile/app/h/_layout.tsx
  • mobile/src/components/HostSidebarToggleButton.tsx
  • mobile/src/layout/host-sidebar-presentation.test.ts
  • mobile/src/layout/host-sidebar-presentation.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • mobile/src/components/HostSidebarToggleButton.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment thread mobile/app/h/_layout.tsx Resolved

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

ℹ️ No critical issues — one minor suggestion for the reveal tab's safe-area handling.

Reviewed changes

  • Compact reveal tab — replaced the full-height, safe-area-aware reveal rail with a floating revealTab pinned to the left edge at vertical center, so a collapsed sidebar leaves no empty strip.
  • Extracted presentation decision — new pure getHostSidebarPresentation helper (plus unit tests) maps showSidebar/detailHasContent/sidebarOpen to hidden | sidebar | reveal, which also keeps the base host route rendering the sidebar synchronously instead of flashing the reveal control before the state-reset effect runs.
  • Metrics cleanup — hoisted isLandscape into a local in getResponsiveLayoutMetrics and removed the now-stale comment that claimed width alone avoided landscape phones.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Comment thread mobile/app/h/_layout.tsx Resolved

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

✅ No new issues found.

Reviewed changes

  • Safe-area-aware reveal tab — re-added insets.left padding plus a bgPanel background to the floating revealTab, so the compact edge button clears the Dynamic Island on notched landscape devices instead of sitting under it. This resolves the prior safe-area concern.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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

✅ No new issues found.

Reviewed changes

  • Reveal-tab positioning — moved the collapsed-sidebar reveal tab from vertical center (top: '50%') to top: '25%' and dropped the paddingLeft: insets.left safe-area inset plus the container bgPanel, so the compact edge tab clears a landscape phone's side-mounted camera island by sitting above it rather than padding around it. The toggle button already supplies its own bgPanel/border, so the container background removal is a clean dedup and useSafeAreaInsets is now unused.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@isairz

isairz commented Sep 3, 2026

Copy link
Copy Markdown
Author

Follow-up verification for the collapsed-sidebar affordance:

  • The final control intentionally remains attached to the left edge without a horizontal safe-area inset; inset padding produced a visually heavy rail.
  • It now sits at the upper quarter of the screen instead of vertical center, keeping it above the side-mounted camera island.
  • Verified on an iPhone 17 Pro simulator in both landscape orientations. The Show workspace sidebar accessibility action remained exposed and tappable in each orientation.
  • The PR visual proof uses the camera-right orientation to keep the comparison unambiguous.
  • Focused tests: 14 passed. pnpm tc and the changed-file quality gate passed.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile: support wide workspace sidebar on landscape phones

1 participant