Skip to content

Commit b3ac8cd

Browse files
fix(mobile): unfolding the Duo shows the sidebar as the split expands
UIKit applies the split's preferred display mode while a collapsed split expands, before the new width reaches JS. The collapsed split asked for secondaryOnly whenever a detail was open, so unfolding first hid the sidebar and then slid it in once JS saw the wider window. A collapsed split now carries the display mode the expanded split will use, so the sidebar arrives with the expansion. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 29bdddb commit b3ac8cd

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,10 @@ function WorkspaceColumns(
224224
collapsed.current = false;
225225
}}
226226
preferredDisplayMode={
227-
panes.primarySidebarVisible || (!layout.usesSplitView && !activeDetailKey)
227+
// UIKit applies the mode as a collapsed split expands, before the new width reaches JS, so a
228+
// collapsed split already carries the sidebar the expanded one will show.
229+
(layout.usesSplitView ? panes.primarySidebarVisible : panes.primarySidebarWhenExpanded) ||
230+
(!layout.usesSplitView && !activeDetailKey)
228231
? "oneBesideSecondary"
229232
: "secondaryOnly"
230233
}

‎apps/mobile/src/lib/layout.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export interface Layout {
5858

5959
export interface WorkspacePaneLayout {
6060
readonly primarySidebarVisible: boolean;
61+
/** Whether the sidebar shows once a collapsed split expands; independent of the current width. */
62+
readonly primarySidebarWhenExpanded: boolean;
6163
readonly primarySidebarSuppressedByAuxiliary: boolean;
6264
readonly contentPaneWidth: number;
6365
readonly supportsAuxiliaryPane: boolean;
@@ -215,6 +217,7 @@ export function deriveWorkspacePaneLayout(input: {
215217

216218
return {
217219
primarySidebarVisible,
220+
primarySidebarWhenExpanded: input.primarySidebarPreferredVisible,
218221
primarySidebarSuppressedByAuxiliary,
219222
contentPaneWidth: Math.max(0, viewportWidth - primarySidebarWidth),
220223
supportsAuxiliaryPane: fileInspector.supported,
@@ -235,6 +238,7 @@ export function deriveWorkspacePaneLayout(input: {
235238

236239
return {
237240
primarySidebarVisible: preferredPrimarySidebarVisible,
241+
primarySidebarWhenExpanded: input.primarySidebarPreferredVisible,
238242
primarySidebarSuppressedByAuxiliary: false,
239243
contentPaneWidth,
240244
supportsAuxiliaryPane,

0 commit comments

Comments
 (0)