Skip to content
TypeScript

fix(mobile): Android PR filter chips no longer crowd the sheet corner (#20889)

Nick Anisimovf5e505a4317a
diff --git a/apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx b/apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx
index 2030409f2ef..be9b6ccff0e 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx
@@ -1,6 +1,6 @@
import { sortProjectsByGroupOrder } from "@t3tools/client-runtime/state/project-grouping";
import { useMemo } from "react";
-import { ScrollView } from "react-native";
+import { Platform, ScrollView } from "react-native";
import type { MenuProps } from "../../components/ui/Menu.types";
import { ListFilterMenu } from "../workspace/ListFilterMenu";
import { useProjects, useThreadShells } from "../../state/entities";
@@ -24,6 +24,12 @@ const SORTS = {
created: "Newest created",
oldest: "Oldest updated",
} as const;
+// On Android the row sits under ScreenContent's 28dp corner. A 12dp inset keeps the
+// 16dp chip radius concentric with it (28 - 12 = 16).
+const ROW_STYLE =
+ Platform.OS === "android"
+ ? { paddingHorizontal: 12, paddingTop: 12, paddingBottom: 8, gap: 8 }
+ : { paddingHorizontal: 16, paddingTop: 2, paddingBottom: 10, gap: 8 };
const id = (field: string, value: string) => JSON.stringify([field, value]);
function choices(field: string, options: Readonly<Record<string, string>>, selected: string) {
return Object.entries(options).map(([value, title]) => ({
@@ -222,11 +228,7 @@ export function PullRequestListFilters(props: {
...new Set([...(author && author !== "me" ? [author] : []), ...props.authors]),
].slice(0, 60);
return (
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- contentContainerStyle={{ paddingHorizontal: 16, paddingTop: 2, paddingBottom: 10, gap: 8 }}
- >
+ <ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={ROW_STYLE}>
<ListFilterMenu
label={count ? String(count) : "Filters"}
icon