refactor(mobile): a pane's bar draws its own sidebar toggle#27086

open1
t3/workspace-split-1
t3/workspace-split-2
opened4d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 1h ago

Four places drew the sidebar toggle: the iOS AppBar, the native header item, the Android header button and the iOS empty detail column. Each had its own label and visibility rule, and screens opted out one at a time with sidebar={false}.

The workspace shell now tells each screen which column it renders in through PaneContext (sidebar, content or inspector). A single useSidebarToggle shows the button in the content pane when columns are showing and the sidebar can move. It stays hidden beside a list that keeps the sidebar, and on a workspace page that covers it. AppBar loses its sidebar prop. Screens that set their own left header items keep them, and so does the scheduled-task editor's guarded Back, which now goes through AppBar options. Pages presented over the columns (modals, fullscreen) render with no pane, so they show no toggle.

Visible change: content pages that used to opt out now show the toggle, such as iPad Settings pages and Android's archived threads, files and new task.

iPad Settings → Environments: the content pane's bar now has the sidebar toggle Fold: content headers with the toggle

Part of the workspace split: router → shell → feature screens → design system → native. Stacked on #26741.

Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

Checks

19 successful · 12 skipped · 2 neutral
All checks passed
2673734
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — The comparison includes mobile pane-header changes and broader desktop and tooling changes. Newly added lint and Effect diagnostic suppressions require human review of those exceptions. This assessment was made without Macroscope's correctness findings, which could not be posted.

Needs human approval because:

  • Macroscope's correctness review could not post its findings

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

Synced from GitHub

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between ae74a539e76d67f5b7f3abe7c10b379a24b83241 and 9f1992b6cc789469f094d3b651a94eab02ce274a.

External image Files selected for processing: 1
  • apps/mobile/src/features/workspace/WorkspaceRootScreen.android.tsx

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

The mobile app now provides sidebar-toggle data through a shared hook that uses pane roles and adaptive workspace state. App bars and workspace headers use this data. AppBar callers no longer pass the sidebar prop. The scheduled-tasks editor passes iOS navigation options through SettingsScreen.

Changes: Sidebar toggle integration

Layer / File(s)Summary
Pane roles and toggle availability
apps/mobile/src/components/ui/Pane.tsx, apps/mobile/src/features/layout/adaptive-workspace-context.ts, apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx, apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx, apps/mobile/src/features/settings/SettingsWorkspaceLayout.android.tsx, apps/mobile/src/features/layout/useSidebarToggle.ts
Pane context identifies sidebar, content, and inspector regions. Adaptive workspace state exposes whether the sidebar can be toggled. useSidebarToggle returns toggle data in eligible content panes.
App bar and workspace header integration
apps/mobile/src/components/ui/AppBar.tsx, apps/mobile/src/components/ui/AppBar.android.tsx, apps/mobile/src/components/ui/AppBar.android.test.tsx, apps/mobile/src/components/ui/AppBar.types.ts, apps/mobile/src/features/layout/useWorkspaceSidebarHeaderItem.ts, apps/mobile/src/features/layout/workspace-sidebar-toolbar.tsx, apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx, apps/mobile/src/features/threads/useThreadHeaderOptions*
App bars and workspace headers use shared sidebar-toggle data. Android app bars render an icon button when toggle data exists and the bar is not a sheet. The sidebar prop and previous Android sidebar button are removed.
Caller updates and settings header options
apps/mobile/src/components/ui/Sheet*.android.tsx, apps/mobile/src/features/archive/*, apps/mobile/src/features/browser/*, apps/mobile/src/features/connection/*, apps/mobile/src/features/development/*, apps/mobile/src/features/files/*, apps/mobile/src/features/home/*, apps/mobile/src/features/pull-requests/*, apps/mobile/src/features/review/*, apps/mobile/src/features/settings/*, apps/mobile/src/features/threads/*, apps/mobile/src/features/workspace/*
AppBar callers no longer pass sidebar. SettingsScreen forwards options to AppBar; the scheduled-tasks editor supplies its iOS navigation options through that prop.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Sequence Diagram(s)

mermaid
1sequenceDiagram
2 participant AppBar
3 participant useSidebarToggle
4 participant PaneContext
5 participant AdaptiveWorkspaceContext
6 participant AndroidHeaderIconButton
7 AppBar->>useSidebarToggle: request sidebar-toggle data
8 useSidebarToggle->>PaneContext: read pane role
9 useSidebarToggle->>AdaptiveWorkspaceContext: read toggleability and visibility
10 useSidebarToggle-->>AppBar: return toggle data or null
11 AppBar->>AndroidHeaderIconButton: render label, icon, and press handler

Suggested reviewers: pixpmusic, t3dotgg

Merge Risk: External image Minimal · previous review 9f199

No actionable regression or merge-blocking risk remains.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly summarizes the main change: sidebar-toggle rendering is centralized in the pane's bar. It is concise and specific.
Description checkPassedThe description explains the problem, the centralized PaneContext and useSidebarToggle design, affected behavior, scope, stacked pull request, and visible UI results with screenshots. It does not list…
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 explains the problem, the centralized PaneContext and useSidebarToggle design, affected behavior, scope, stacked pull request, and visible UI results with screenshots. It does not list focused test results or explicit maintainer approval, but it is sufficiently complete and directly related to the change.

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
MmacroscopeappBoton file4d ago

🟡 Medium home/ThreadListToolbar.android.tsx:24

After the search input has blurred, invoking focusSearch leaves it unfocused, so typing does not update the query until the user taps the field. openSearch only sets searchOpen and bypasses SearchableAppBar.open(), which focuses the input; preserve an imperative focus path for this command.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
text
1In file @apps/mobile/src/features/home/ThreadListToolbar.android.tsx around line 24:
2
3After the search input has blurred, invoking `focusSearch` leaves it unfocused, so typing does not update the query until the user taps the field. `openSearch` only sets `searchOpen` and bypasses `SearchableAppBar.open()`, which focuses the input; preserve an imperative focus path for this command.

Added 1 commit

  • refactor(mobile): a pane's bar draws its own sidebar toggle2673734