Skip to content

Commit 0d4aa9e

Browse files
PR Batch Testerclaude
andcommitted
fix(mobile): Android commit sheet scrolls to the commit buttons
The inline header's Compose close button is a nested-scrolling view, and Material's sheet coordinates drags with the first one in native order, so swipes on the changed-files list were taken by the sheet instead of the ScrollView. Render the content before the header on Android and reverse the column, matching Sheet.android.tsx. Fixes #28259 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 15fe283 commit 0d4aa9e

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,31 @@ export function GitCommitSheet(_props: GitCommitSheetProps) {
6767
});
6868
};
6969

70+
const android = Platform.OS === "android";
71+
const header = (
72+
<SheetHeader
73+
presentation={android ? "inline" : "native"}
74+
title="Commit changes"
75+
subtitle={gitStatus.data?.refName ?? "(detached HEAD)"}
76+
onCancel={() => navigation.goBack()}
77+
accessibilityLabel="Cancel commit"
78+
/>
79+
);
80+
7081
return (
82+
// Material sheet drags follow the first nested-scrolling native view, and the inline
83+
// header's Compose button is one, so Android renders content first and reverses the column.
7184
<View
7285
collapsable={false}
73-
className="bg-sheet ios:flex-1"
74-
style={Platform.OS === "android" ? { maxHeight: windowHeight * 0.92 } : undefined}
86+
className="bg-sheet ios:flex-1 android:flex-col-reverse"
87+
style={android ? { maxHeight: windowHeight * 0.92 } : undefined}
7588
>
76-
{Platform.OS === "android" ? (
89+
{android ? (
7790
<NativeStackScreenOptions
7891
options={{ sheetCornerRadius: 28, sheetAllowedDetents: "fitToContents" }}
7992
/>
8093
) : null}
81-
<SheetHeader
82-
presentation={Platform.OS === "android" ? "inline" : "native"}
83-
title="Commit changes"
84-
subtitle={gitStatus.data?.refName ?? "(detached HEAD)"}
85-
onCancel={() => navigation.goBack()}
86-
accessibilityLabel="Cancel commit"
87-
/>
94+
{android ? null : header}
8895
<ScreenContent fitToContents>
8996
<ScrollView
9097
nestedScrollEnabled
@@ -228,6 +235,7 @@ export function GitCommitSheet(_props: GitCommitSheetProps) {
228235
</View>
229236
</ScrollView>
230237
</ScreenContent>
238+
{android ? header : null}
231239
</View>
232240
);
233241
}

0 commit comments

Comments
 (0)