The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): the unfolded Duo sidebar no longer pops back in while resizing Files (#33510)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Nov 9, 2026 at 11:56 UTC
2da1b7431d07abeefe69c3cda4ae38d7f7c3df30
3 files changed
+22
-12
apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
+7
-6
@@ -245,13 +245,10 @@ function AdaptiveWorkspaceLayoutContent(
245
const [primarySidebarPreferredVisible, setPrimarySidebarPreferredVisible] = useState(true);
246
const [fileInspectorPreferredVisible, setFileInspectorPreferredVisible] = useState(true);
247
const [nativeInspectorWidthFraction, setNativeInspectorWidthFraction] = useState(0.4);
248
+ const horizontalSafeArea =
249
+ (nativeMetrics?.safeArea.left ?? 0) + (nativeMetrics?.safeArea.right ?? 0);
250
const inspectorWidthFor = (fraction: number) =>
249
- nativeInspectorColumnWidth({
250
- viewportWidth,
251
- horizontalSafeArea:
252
- (nativeMetrics?.safeArea.left ?? 0) + (nativeMetrics?.safeArea.right ?? 0),
253
- fraction,
254
- });
251
+ nativeInspectorColumnWidth({ viewportWidth, horizontalSafeArea, fraction });
252
const nativeInspectorWidth = inspectorWidthFor(nativeInspectorWidthFraction);
253
const [fileInspectorPreferredWidth, setFileInspectorPreferredWidth] = useState<number | null>(
254
null,
@@ -408,6 +405,7 @@ function AdaptiveWorkspaceLayoutContent(
405
deriveWorkspacePaneLayout({
406
layout,
407
viewportWidth: width,
408
+ horizontalSafeArea,
409
nativeWorkspace,
410
primarySidebarFloats: sidebarFloats,
411
primarySidebarPreferredVisible: showPrimarySidebar,
@@ -419,6 +417,7 @@ function AdaptiveWorkspaceLayoutContent(
417
}),
418
[
419
nativeInspectorWidth,
420
+ horizontalSafeArea,
421
fileInspectorPreferredVisible,
422
fileInspectorPreferredWidth,
423
inspectorActive,
@@ -438,6 +437,7 @@ function AdaptiveWorkspaceLayoutContent(
437
: deriveWorkspacePaneLayout({
438
layout,
439
viewportWidth: width,
440
+ horizontalSafeArea,
441
nativeWorkspace,
442
primarySidebarFloats: sidebarFloats,
443
primarySidebarPreferredVisible: sidebarWithoutKeyboard,
@@ -448,6 +448,7 @@ function AdaptiveWorkspaceLayoutContent(
448
}).primarySidebarVisible,
449
[
450
nativeInspectorWidth,
451
+ horizontalSafeArea,
452
fileInspectorPreferredVisible,
453
fileInspectorPreferredWidth,
454
inspectorActive,
apps/mobile/src/lib/layout.test.ts
+8
-5
@@ -155,24 +155,27 @@ describe("isPrimarySidebarPinned", () => {
155
156
describe("deriveWorkspacePaneLayout", () => {
157
it.each([
158
- { width: 1_194, height: 834, suppressed: false },
159
- { width: 1_032, height: 1_376, suppressed: true },
158
+ { width: 1_194, height: 834, horizontalSafeArea: 0, fraction: 0.4, suppressed: false },
159
+ { width: 1_032, height: 1_376, horizontalSafeArea: 0, fraction: 0.4, suppressed: true },
160
+ // The unfolded Duo's system bar leaves no room for the sidebar beside even the narrowest inspector.
161
+ { width: 951, height: 669, horizontalSafeArea: 76, fraction: 0, suppressed: true },
162
])(
163
"steps the sidebar aside for the native inspector only when the page gets too narrow ($width wide)",
162
- ({ width, height, suppressed }) => {
164
+ ({ width, height, horizontalSafeArea, fraction, suppressed }) => {
165
const layout = deriveLayout({ width, height });
166
for (const primarySidebarPreferredVisible of [true, false]) {
167
expect(
168
deriveWorkspacePaneLayout({
169
layout,
170
viewportWidth: width,
171
+ horizontalSafeArea,
172
nativeWorkspace: true,
173
primarySidebarPreferredVisible,
174
auxiliaryPanePreferredVisible: true,
175
nativeInspectorWidth: nativeInspectorColumnWidth({
176
viewportWidth: width,
174
- horizontalSafeArea: 0,
175
- fraction: 0.4,
177
+ horizontalSafeArea,
178
+ fraction,
179
}),
180
}),
181
).toMatchObject({
apps/mobile/src/lib/layout.ts
+7
-1
@@ -218,6 +218,8 @@ export function isPrimarySidebarPinned(input: {
218
export function deriveWorkspacePaneLayout(input: {
219
readonly layout: Layout;
220
readonly viewportWidth: number;
221
+ /** Width UIKit keeps out of its columns, such as the Duo's system bar. */
222
+ readonly horizontalSafeArea?: number;
223
readonly nativeWorkspace?: boolean;
224
/** Whether the sidebar floats over the content rather than taking its room; medium by default. */
225
readonly primarySidebarFloats?: boolean;
@@ -251,7 +253,11 @@ export function deriveWorkspacePaneLayout(input: {
253
auxiliaryPaneVisible &&
254
inspectorWidth !== null &&
255
input.layout.listPaneWidth !== null &&
254
- viewportWidth - input.layout.listPaneWidth - (input.layout.listPaneGap ?? 0) - inspectorWidth <
256
+ viewportWidth -
257
+ (input.nativeWorkspace ? (input.horizontalSafeArea ?? 0) : 0) -
258
+ input.layout.listPaneWidth -
259
+ (input.layout.listPaneGap ?? 0) -
260
+ inspectorWidth <
261
(input.nativeWorkspace ? NATIVE_INSPECTOR_MIN_MAIN_WIDTH : FILE_INSPECTOR_MIN_MAIN_WIDTH);
262
const primarySidebarVisible =
263
preferredPrimarySidebarVisible && !primarySidebarSuppressedByAuxiliary;