Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions apps/mobile/src/features/threads/git/GitOverviewSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ function GitOverviewSheetContent(props: GitOverviewSheetProps) {
setIsRefreshing(false);
};

// An Android bottom sheet reads a RefreshControl's list as unable to scroll up and drags itself
// instead, so Android sheets omit it; status still refreshes in the background.
const inAndroidSheet =
Platform.OS === "android" && (!isInspector || closeInspectorSheet !== null);

const content = (
<NativeScrollView
nestedScrollEnabled
Expand All @@ -241,7 +246,9 @@ function GitOverviewSheetContent(props: GitOverviewSheetProps) {
gap: Platform.OS === "android" ? 8 : 14,
}}
refreshControl={
<RefreshControl refreshing={isRefreshing} onRefresh={() => void handleRefresh()} />
inAndroidSheet ? undefined : (
<RefreshControl refreshing={isRefreshing} onRefresh={() => void handleRefresh()} />
)
}
>
<ListSection>
Expand Down Expand Up @@ -344,18 +351,23 @@ function GitOverviewSheetContent(props: GitOverviewSheetProps) {
};

return (
// Material sheet drags follow the first nested-scrolling native view, and the AppBar's
// Compose buttons are some, so Android renders content first and reverses the column.
<View
collapsable={false}
className={cn("flex-1 android:bg-header", isInspector ? "ios:bg-screen" : "ios:bg-sheet")}
className={cn(
"flex-1 android:flex-col-reverse android:bg-header",
isInspector ? "ios:bg-screen" : "ios:bg-sheet",
)}
>
<ScreenContent insetHorizontal={isInspector ? true : undefined}>{content}</ScreenContent>
<AppBar
title={currentBranchLabel}
subtitle={currentStatusSummary}
hideBottomBorder={!isInspector}
onClose={isInspector ? undefined : () => navigation.goBack()}
refresh={refresh}
/>
<ScreenContent insetHorizontal={isInspector ? true : undefined}>{content}</ScreenContent>
</View>
);
}
Loading