Skip to content

Commit f69e6fd

Browse files
fix(mobile): Android opens label and author filters like the branch picker
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent dd7c0ca commit f69e6fd

2 files changed

Lines changed: 59 additions & 49 deletions

File tree

‎apps/mobile/src/Stack.tsx‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,13 +684,18 @@ const RootStackConfig = createWorkspaceStackNavigator({
684684
}),
685685
PullRequestFilterSearch: createNativeStackScreen({
686686
screen: PullRequestFilterSearchScreen,
687-
options: {
688-
...DETAIL_HEADER_OPTIONS,
689-
...HORIZONTAL_FORM_SHEET_OPTIONS,
690-
sheetAllowedDetents: formSheetDetents(0.75),
691-
sheetGrabberVisible: true,
692-
headerBackVisible: false,
693-
},
687+
// Android pushes it like the branch picker; a formSheet there leaves the list's header
688+
// peeking above it once the keyboard opens.
689+
options:
690+
Platform.OS === "android"
691+
? { presentation: "card", headerShown: false }
692+
: {
693+
...DETAIL_HEADER_OPTIONS,
694+
...HORIZONTAL_FORM_SHEET_OPTIONS,
695+
sheetAllowedDetents: formSheetDetents(0.75),
696+
sheetGrabberVisible: true,
697+
headerBackVisible: false,
698+
},
694699
}),
695700
PullRequestDiscussion: createNativeStackScreen({
696701
screen: PullRequestDiscussionScreen,

‎apps/mobile/src/features/pull-requests/PullRequestFilterSearchScreen.tsx‎

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { AsyncResult, Atom } from "effect/reactivity";
1111
import { useRef, useState } from "react";
1212
import { FlatList, Platform, View, type TextInputInstance } from "react-native";
1313

14+
import { AndroidScreenHeader } from "../../components/ui/AndroidScreenHeader";
1415
import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
1516
import { EmptyState } from "../../components/ui/EmptyState";
1617
import { SearchField } from "../../components/ui/SearchField";
@@ -179,48 +180,12 @@ export function PullRequestFilterSearchScreen({
179180
}
180181
/>
181182
);
182-
return (
183-
<View className="flex-1 bg-sheet">
184-
<SheetHeader
185-
title={kind === "labels" ? "Filter by label" : "Filter by author"}
186-
onClose={() => navigation.goBack()}
187-
accessibilityLabel={kind === "labels" ? "Close label filter" : "Close author filter"}
188-
/>
189-
{Platform.OS === "ios" ? (
190-
<>
191-
<NativeStackScreenOptions
192-
options={{
193-
unstable_headerToolbarItems: integratedSearch
194-
? () => [
195-
createNativeMailSearchToolbarItem({
196-
placeholder,
197-
onSearchTextChange: setQuery,
198-
showsSearchDismissButton: true,
199-
searchTextChangeId: "pr-filter-option-search",
200-
}),
201-
]
202-
: undefined,
203-
headerSearchBarOptions: integratedSearch
204-
? undefined
205-
: {
206-
placeholder,
207-
allowToolbarIntegration: true,
208-
autoCapitalize: "none",
209-
hideNavigationBar: false,
210-
obscureBackground: false,
211-
onChangeText: (event) => setQuery(event.nativeEvent.text),
212-
onCancelButtonPress: () => setQuery(""),
213-
},
214-
}}
215-
/>
216-
{integratedSearch ? null : (
217-
<Toolbar placement="bottom">
218-
<Toolbar.SearchBarSlot />
219-
</Toolbar>
220-
)}
221-
</>
222-
) : (
223-
<View className="px-4 pb-3 pt-1">
183+
const title = kind === "labels" ? "Filter by label" : "Filter by author";
184+
if (Platform.OS === "android") {
185+
return (
186+
<View className="flex-1 bg-sheet" collapsable={false}>
187+
<AndroidScreenHeader title={title} hideBottomBorder onBack={() => navigation.goBack()} />
188+
<View className="bg-header px-4 pb-3 pt-1">
224189
<SearchField
225190
inputRef={searchRef}
226191
accessibilityLabel={placeholder}
@@ -232,6 +197,46 @@ export function PullRequestFilterSearchScreen({
232197
value={query}
233198
/>
234199
</View>
200+
{list}
201+
</View>
202+
);
203+
}
204+
return (
205+
<View className="flex-1 bg-sheet">
206+
<SheetHeader
207+
title={title}
208+
onClose={() => navigation.goBack()}
209+
accessibilityLabel={kind === "labels" ? "Close label filter" : "Close author filter"}
210+
/>
211+
<NativeStackScreenOptions
212+
options={{
213+
unstable_headerToolbarItems: integratedSearch
214+
? () => [
215+
createNativeMailSearchToolbarItem({
216+
placeholder,
217+
onSearchTextChange: setQuery,
218+
showsSearchDismissButton: true,
219+
searchTextChangeId: "pr-filter-option-search",
220+
}),
221+
]
222+
: undefined,
223+
headerSearchBarOptions: integratedSearch
224+
? undefined
225+
: {
226+
placeholder,
227+
allowToolbarIntegration: true,
228+
autoCapitalize: "none",
229+
hideNavigationBar: false,
230+
obscureBackground: false,
231+
onChangeText: (event) => setQuery(event.nativeEvent.text),
232+
onCancelButtonPress: () => setQuery(""),
233+
},
234+
}}
235+
/>
236+
{integratedSearch ? null : (
237+
<Toolbar placement="bottom">
238+
<Toolbar.SearchBarSlot />
239+
</Toolbar>
235240
)}
236241
{list}
237242
</View>

0 commit comments

Comments
 (0)