Skip to content

Commit 89fe509

Browse files
fix(mobile): the iPhone Duo's inspector panes use the full column (#23150)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 83a8501 commit 89fe509

7 files changed

Lines changed: 32 additions & 34 deletions

File tree

‎apps/mobile/src/features/files/thread-file-navigator-pane.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { useEnvironmentQuery } from "../../state/query";
2121
import { useEnvironmentPresentation } from "../../state/presentation";
2222
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
2323
import { FileTreeBrowser } from "./FileTreeBrowser";
24+
import { NativeInspectorContent } from "../../native/NativeInspectorContent";
2425
import { useFileTreeEntries } from "./useFileTreeEntries";
2526
import { preloadWorkspaceFileContents } from "./preload-workspace-file";
2627
import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
@@ -120,7 +121,7 @@ export function ThreadFileNavigatorPane(props: {
120121
scrollEdgeEffects={headerScrollEdgeEffects}
121122
style={{ backgroundColor: sheetColor, flex: 1 }}
122123
>
123-
{fileTree}
124+
<NativeInspectorContent>{fileTree}</NativeInspectorContent>
124125
<ScreenStackHeaderConfig
125126
backgroundColor="rgba(0,0,0,0)"
126127
color={foregroundColor}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ function WorkspaceColumns(
305305
</Split.Column>
306306
<Split.Inspector>
307307
<Split.HeaderConfig hidden />
308-
<ColumnContent>
308+
{/* Inspector panes host their own native stacks, which UIKit insets for the Duo's
309+
vertical bar wherever they sit, so each pane insets its own content instead. */}
310+
<ColumnContent insetHorizontally={false}>
309311
<View className="flex-1 bg-screen">{inspector.render?.()}</View>
310312
</ColumnContent>
311313
</Split.Inspector>

‎apps/mobile/src/features/review/ReviewSheet.tsx‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
} from "react-native";
3131
import { useSafeAreaInsets } from "react-native-safe-area-context";
3232
import { useNativeColumnLayoutMetrics } from "../../native/native-layout-metrics";
33+
import { NativeInspectorContent } from "../../native/NativeInspectorContent";
3334

3435
import { AppText as Text } from "../../components/ui/AppText";
3536
import { SymbolView } from "../../components/ui/AppSymbol";
@@ -40,7 +41,6 @@ import { environmentCatalog } from "../../connection/catalog";
4041
import { useEnvironmentPresentation } from "../../state/presentation";
4142
import { useAtomCommand } from "../../state/use-atom-command";
4243
import { useUniwindTheme } from "../../lib/useUniwindTheme";
43-
import { IOS_NAV_BAR_HEIGHT } from "../../lib/layoutMetrics";
4444
import { useThreadDraftForThread } from "../../state/use-thread-composer-state";
4545
import { EnvironmentConnectionNotice } from "../connection/EnvironmentConnectionNotice";
4646
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
@@ -307,7 +307,6 @@ function ReviewFileNavigator({
307307
onSelectFile,
308308
ref,
309309
}: ReviewFileNavigatorProps) {
310-
const insets = useSafeAreaInsets();
311310
const theme = useUniwindTheme();
312311
const sheetColor = theme["--color-sheet"];
313312
const foregroundColor = theme["--color-foreground"];
@@ -359,15 +358,8 @@ function ReviewFileNavigator({
359358
data={files}
360359
extraData={selectedFileId}
361360
keyExtractor={(file) => file.id}
362-
contentContainerStyle={{
363-
paddingHorizontal: 8,
364-
paddingBottom: 8,
365-
366-
paddingTop: Platform.OS === "ios" ? insets.top + IOS_NAV_BAR_HEIGHT + 8 : 8,
367-
}}
368-
scrollIndicatorInsets={
369-
Platform.OS === "ios" ? { top: insets.top + IOS_NAV_BAR_HEIGHT } : undefined
370-
}
361+
contentInsetAdjustmentBehavior={Platform.OS === "ios" ? "automatic" : "never"}
362+
contentContainerStyle={{ paddingHorizontal: 8, paddingVertical: 8 }}
371363
renderItem={renderFile}
372364
/>
373365
);
@@ -384,7 +376,7 @@ function ReviewFileNavigator({
384376
scrollEdgeEffects={headerScrollEdgeEffects}
385377
style={{ backgroundColor: sheetColor, flex: 1 }}
386378
>
387-
{fileList}
379+
<NativeInspectorContent>{fileList}</NativeInspectorContent>
388380
<ScreenStackHeaderConfig
389381
backgroundColor="rgba(0,0,0,0)"
390382
color={foregroundColor}

‎apps/mobile/src/features/threads/git/GitOverviewSheet.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Platform, Pressable, RefreshControl, ScrollView, View } from "react-nat
2020

2121
import { ScreenStack } from "react-native-screens";
2222
import { useSafeAreaInsets } from "react-native-safe-area-context";
23-
import { NativeSheetContent } from "../../../native/NativeSheetContent";
23+
import { NativeInspectorContent } from "../../../native/NativeInspectorContent";
2424
import { NativeHeader, NativeScreen } from "../../../native/ThemedScreenStack";
2525
import {
2626
AndroidHeaderIconButton,
@@ -349,7 +349,7 @@ function GitOverviewSheetContent(props: GitOverviewSheetProps) {
349349
scrollEdgeEffects={HEADER_SCROLL_EDGE_EFFECTS}
350350
className="flex-1 bg-sheet"
351351
>
352-
<NativeSheetContent>{content}</NativeSheetContent>
352+
<NativeInspectorContent>{content}</NativeInspectorContent>
353353
<NativeHeader
354354
backgroundColor="rgba(0,0,0,0)"
355355
tintColorClassName="accent-foreground"

‎apps/mobile/src/features/threads/thread-inspector-content-stack.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect, useState, type ReactNode } from "react";
22
import { View } from "react-native";
33

44
import { RenderErrorBoundary, RenderFailureView } from "../../components/RenderErrorBoundary";
5+
import { NativeInspectorContent } from "../../native/NativeInspectorContent";
56

67
export type ThreadInspectorMode = "route" | "git" | "files";
78

@@ -33,7 +34,9 @@ function InspectorContentPane(props: {
3334
<RenderErrorBoundary
3435
resetKeys={props.resetKeys}
3536
renderFallback={(fallback) => (
36-
<RenderFailureView {...fallback} title="The inspector couldn't be displayed" />
37+
<NativeInspectorContent>
38+
<RenderFailureView {...fallback} title="The inspector couldn't be displayed" />
39+
</NativeInspectorContent>
3740
)}
3841
>
3942
{props.children}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { ReactNode } from "react";
2+
import { SafeAreaView } from "react-native-safe-area-context";
3+
4+
import { useNativeWorkspaceColumnsSupported } from "./NativeWorkspaceColumns";
5+
6+
// Pads with the inspector column's insets, which the column leaves to its panes so their
7+
// native headers lay out against the vertical bar themselves.
8+
export function NativeInspectorContent(props: { readonly children: ReactNode }) {
9+
const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
10+
if (!usesNativeWorkspaceColumns) return <>{props.children}</>;
11+
12+
return (
13+
<SafeAreaView edges={["left", "right"]} style={{ flex: 1 }}>
14+
{props.children}
15+
</SafeAreaView>
16+
);
17+
}

‎apps/mobile/src/native/NativeSheetContent.tsx‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)