Skip to content

Commit 22dc1da

Browse files
feat(pull-requests): label and author filters search the host (#23924)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 3046545 commit 22dc1da

37 files changed

Lines changed: 1614 additions & 241 deletions

‎apps/mobile/src/Stack.tsx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
import { PullRequestFilesSheet } from "./features/pull-requests/PullRequestFiles";
3535
import { PullRequestReviewSheet } from "./features/pull-requests/PullRequestReviewSheet";
3636
import { PullRequestReviewersScreen } from "./features/pull-requests/PullRequestReviewersScreen";
37+
import { PullRequestFilterSearchScreen } from "./features/pull-requests/PullRequestFilterSearchScreen";
3738
import {
3839
RenderErrorBoundary,
3940
RenderFailureView,
@@ -689,6 +690,21 @@ const RootStackConfig = createWorkspaceStackNavigator({
689690
headerBackVisible: false,
690691
},
691692
}),
693+
PullRequestFilterSearch: createNativeStackScreen({
694+
screen: PullRequestFilterSearchScreen,
695+
// Android pushes it like the branch picker; a formSheet there leaves the list's header
696+
// peeking above it once the keyboard opens.
697+
options:
698+
Platform.OS === "android"
699+
? { presentation: "card", headerShown: false }
700+
: {
701+
...DETAIL_HEADER_OPTIONS,
702+
...HORIZONTAL_FORM_SHEET_OPTIONS,
703+
sheetAllowedDetents: formSheetDetents(0.75),
704+
sheetGrabberVisible: true,
705+
headerBackVisible: false,
706+
},
707+
}),
692708
PullRequestDiscussion: createNativeStackScreen({
693709
screen: PullRequestDiscussionScreen,
694710
options: DETAIL_HEADER_OPTIONS,

‎apps/mobile/src/components/ui/AppSymbol.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import IconChevronLeft from "@tabler/icons-react-native/IconChevronLeft";
3939
import IconChevronRight from "@tabler/icons-react-native/IconChevronRight";
4040
import IconChevronUp from "@tabler/icons-react-native/IconChevronUp";
4141
import IconCircle from "@tabler/icons-react-native/IconCircle";
42+
import IconCircleFilled from "@tabler/icons-react-native/IconCircleFilled";
4243
import IconCircleCheck from "@tabler/icons-react-native/IconCircleCheck";
4344
import IconCircleDashed from "@tabler/icons-react-native/IconCircleDashed";
4445
import IconCircleDot from "@tabler/icons-react-native/IconCircleDot";
@@ -176,6 +177,7 @@ const ANDROID_ICON_BY_SF_SYMBOL = {
176177
"checkmark.circle": IconCircleCheck,
177178
"checkmark.circle.fill": IconCircleCheck,
178179
circle: IconCircle,
180+
"circle.fill": IconCircleFilled,
179181
"circle.dashed": IconCircleDashed,
180182
"circle.inset.filled": IconCircleDot,
181183
"circle.dashed.inset.filled": IconCircleDot,

‎apps/mobile/src/components/ui/MenuPopup.android.tsx‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Text,
99
} from "@expo/ui/jetpack-compose";
1010
import { defaultMinSize, padding, size, width } from "@expo/ui/jetpack-compose/modifiers";
11+
import type { MenuAction } from "@react-native-menu/menu";
1112
import { Pressable } from "react-native";
1213
import { resolveScaledTextRole } from "../../lib/appearancePreferences";
1314

@@ -21,6 +22,7 @@ import { isAppSymbolName, SymbolView, type AppSymbolName } from "./AppSymbol";
2122
// row's action itself; the row stays the accessible element.
2223
function MenuIcon(props: {
2324
readonly name: AppSymbolName;
25+
readonly color?: MenuAction["imageColor"];
2426
readonly onPress: () => void;
2527
readonly destructive?: boolean;
2628
readonly disabled?: boolean;
@@ -40,13 +42,15 @@ function MenuIcon(props: {
4042
name={props.name}
4143
size={iconSize}
4244
type="monochrome"
43-
tintColorClassName={
44-
props.disabled
45-
? "accent-icon-subtle"
46-
: props.destructive
47-
? "accent-danger-foreground"
48-
: "accent-foreground"
49-
}
45+
{...(typeof props.color === "string" && !props.disabled
46+
? { tintColor: props.color }
47+
: {
48+
tintColorClassName: props.disabled
49+
? "accent-icon-subtle"
50+
: props.destructive
51+
? "accent-danger-foreground"
52+
: "accent-foreground",
53+
})}
5054
/>
5155
</Pressable>
5256
</RNHostView>
@@ -96,6 +100,7 @@ export function MenuPopup(props: MenuPopupProps) {
96100
<DropdownMenuItem.LeadingIcon>
97101
<MenuIcon
98102
name={action.image}
103+
color={action.imageColor}
99104
onPress={() => props.onPress(action)}
100105
destructive={action.attributes?.destructive}
101106
disabled={action.attributes?.disabled}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import type { ReactNode } from "react";
2+
import { Platform, Pressable, View } from "react-native";
3+
4+
import { cn } from "../../lib/cn";
5+
import { SymbolView, type AppSymbolName } from "./AppSymbol";
6+
import { AppText as Text } from "./AppText";
7+
import { NavigationRow } from "./NavigationRow";
8+
9+
/** A picker row in a grouped list; the first and last rows round the group's corners. */
10+
export function SelectionRow(props: {
11+
readonly icon?: AppSymbolName;
12+
/** Drawn where the icon goes, for marks a symbol can't express (a label's color dot). */
13+
readonly leading?: ReactNode;
14+
readonly onPress: () => void;
15+
readonly disabled?: boolean;
16+
readonly selected: boolean;
17+
/** "checkbox" when several rows can be selected at once. */
18+
readonly role?: "radio" | "checkbox";
19+
readonly isFirst?: boolean;
20+
readonly isLast?: boolean;
21+
readonly subtitle?: string;
22+
readonly title: string;
23+
}) {
24+
const role = props.role ?? "radio";
25+
const row =
26+
Platform.OS === "android" ? (
27+
<NavigationRow
28+
className="bg-grouped-card"
29+
title={props.title}
30+
subtitle={props.subtitle}
31+
leading={
32+
props.icon ? (
33+
<SymbolView name={props.icon} size={24} tintColorClassName="accent-icon-muted" />
34+
) : (
35+
props.leading
36+
)
37+
}
38+
trailing={
39+
props.selected ? (
40+
<SymbolView name="checkmark" size={20} tintColorClassName="accent-focus" />
41+
) : null
42+
}
43+
accessibilityRole={role}
44+
accessibilityState={{ checked: props.selected }}
45+
disabled={props.disabled}
46+
onPress={props.onPress}
47+
/>
48+
) : (
49+
<Pressable
50+
accessibilityLabel={[props.title, props.subtitle].filter(Boolean).join(", ")}
51+
accessibilityRole={role}
52+
accessibilityState={{ checked: props.selected }}
53+
className={cn(
54+
"min-h-14 flex-row items-center gap-3 bg-grouped-card px-4 py-3 active:bg-subtle",
55+
!props.isLast && "border-b border-border-subtle",
56+
)}
57+
disabled={props.disabled}
58+
onPress={props.onPress}
59+
style={{ opacity: props.disabled ? 0.45 : 1 }}
60+
>
61+
{props.icon ? (
62+
<SymbolView
63+
name={props.icon}
64+
size={17}
65+
tintColorClassName="accent-icon-muted"
66+
type="monochrome"
67+
/>
68+
) : (
69+
(props.leading ?? null)
70+
)}
71+
<View className="min-w-0 flex-1 gap-0.5">
72+
<Text className="text-base font-t3-medium text-foreground" numberOfLines={1}>
73+
{props.title}
74+
</Text>
75+
{props.subtitle ? (
76+
<Text className="text-xs text-foreground-muted" numberOfLines={1}>
77+
{props.subtitle}
78+
</Text>
79+
) : null}
80+
</View>
81+
{props.selected ? (
82+
<SymbolView
83+
name="checkmark"
84+
size={16}
85+
tintColorClassName="accent-icon"
86+
type="monochrome"
87+
weight="semibold"
88+
/>
89+
) : null}
90+
</Pressable>
91+
);
92+
if (!props.isFirst && !props.isLast) return row;
93+
return (
94+
<View
95+
className={cn(
96+
"overflow-hidden",
97+
props.isFirst && (Platform.OS === "android" ? "rounded-t-[28px]" : "rounded-t-2xl"),
98+
props.isLast && (Platform.OS === "android" ? "rounded-b-[28px]" : "rounded-b-2xl"),
99+
)}
100+
>
101+
{row}
102+
</View>
103+
);
104+
}

0 commit comments

Comments
 (0)