The best way to control Claude Code, Codex and more from any computer or phone
refactor(mobile): adopt shared controls and add component catalog (#18541)
Julius Marminge committed
Oct 15, 2026 at 15:46 UTC
e64cee0a92eac49b2d1848f301a7ded2f688e862
23 files changed
+672
-260
apps/mobile/src/Stack.tsx
+10
@@ -1,3 +1,4 @@
1
+import { ComponentCatalogScreen } from "./features/development/ComponentCatalogScreen";
2
import { PullRequestGuideStopScreen } from "./features/pull-requests/guide/PullRequestGuideScreen";
3
import { PullRequestInlineCommentScreen } from "./features/pull-requests/PullRequestInlineCommentScreen";
4
import { PullRequestDiscussionScreen } from "./features/pull-requests/PullRequestDiscussionScreen";
@@ -716,6 +717,15 @@ const RootStackConfig = createWorkspaceStackNavigator({
717
headerShown: false,
718
},
719
screens: {
720
+ ...(__DEV__
721
+ ? {
722
+ ComponentCatalog: createNativeStackScreen({
723
+ screen: ComponentCatalogScreen,
724
+ linking: "dev/components",
725
+ options: { title: "UI components" },
726
+ }),
727
+ }
728
+ : {}),
729
Home: createNativeStackScreen({
730
screen: WorkspaceRootScreen,
731
linking: "",
apps/mobile/src/components/Button.android.tsx
+3
-3
@@ -13,13 +13,13 @@ import {
13
import { defaultMinSize, fillMaxWidth, size } from "@expo/ui/jetpack-compose/modifiers";
14
import { View } from "react-native";
15
16
-import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
16
+import { useControlTheme } from "./useControlTheme";
17
import { useScaledTextRole } from "../features/settings/appearance/useScaledTextRole";
18
import type { ButtonProps } from "./Button";
19
import { useAndroidControlSizing } from "./useAndroidControlSizing";
20
21
export function Button(props: ButtonProps) {
22
- const { themeAppearance, themeVariables: colors } = useAppearancePreferences();
22
+ const { colorScheme, colors } = useControlTheme();
23
const typography = useScaledTextRole("footnote");
24
const { scale, mediumIconSize } = useAndroidControlSizing();
25
const tone = props.tone ?? "secondary";
@@ -64,7 +64,7 @@ export function Button(props: ButtonProps) {
64
<View importantForAccessibility="no-hide-descendants">
65
<Host
66
matchContents={props.fullWidth ? { vertical: true } : true}
67
- colorScheme={themeAppearance}
67
+ colorScheme={colorScheme}
68
ignoreSafeAreaKeyboardInsets
69
style={props.fullWidth ? { width: "100%" } : { alignSelf: "flex-start" }}
70
>
apps/mobile/src/components/Chip.tsx
new
+90
@@ -0,0 +1,90 @@
1
+import { GlassView } from "expo-glass-effect";
2
+import { Pressable, View } from "react-native";
3
+import { withUniwind } from "uniwind";
4
+
5
+import { cn } from "../lib/cn";
6
+import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../native/native-glass";
7
+import { AppText } from "./AppText";
8
+import { SymbolView, type AppSymbolName } from "./AppSymbol";
9
+
10
+const ChipGlass = withUniwind(GlassView, {
11
+ style: { fromClassName: "className" },
12
+ tintColor: { fromClassName: "tintColorClassName", styleProperty: "accentColor" },
13
+});
14
+
15
+/** Compact labels and filter triggers. Menu owners can wrap the non-pressable form. */
16
+export function Chip(props: {
17
+ readonly label: string;
18
+ readonly selected?: boolean;
19
+ readonly icon?: AppSymbolName;
20
+ readonly trailingIcon?: AppSymbolName;
21
+ readonly size?: "small" | "default";
22
+ readonly glass?: boolean;
23
+ readonly colorScheme?: "light" | "dark";
24
+ readonly onPress?: () => void;
25
+ readonly accessibilityLabel?: string;
26
+ readonly disabled?: boolean;
27
+}) {
28
+ const small = props.size === "small";
29
+ const layout = cn(
30
+ "flex-row items-center gap-1.5 rounded-2xl px-3",
31
+ small ? "py-1" : "min-h-8 py-1.5",
32
+ );
33
+ const iconColor = props.selected ? "accent-primary-foreground" : "accent-icon-muted";
34
+ const content = (
35
+ <>
36
+ {props.icon ? (
37
+ <SymbolView name={props.icon} size={15} tintColorClassName={iconColor} />
38
+ ) : null}
39
+ <AppText
40
+ numberOfLines={small ? undefined : 1}
41
+ className={cn(
42
+ "shrink",
43
+ !small && "max-w-[180px]",
44
+ small ? "text-2xs" : "text-sm font-t3-medium",
45
+ props.selected ? "text-primary-foreground" : "text-foreground-muted",
46
+ )}
47
+ >
48
+ {props.label}
49
+ </AppText>
50
+ {props.trailingIcon ? (
51
+ <SymbolView name={props.trailingIcon} size={11} tintColorClassName={iconColor} />
52
+ ) : null}
53
+ </>
54
+ );
55
+ const body =
56
+ props.glass && NATIVE_LIQUID_GLASS_SUPPORTED ? (
57
+ <ChipGlass
58
+ isInteractive
59
+ colorScheme={props.colorScheme}
60
+ tintColorClassName={props.selected ? "accent-primary" : undefined}
61
+ className={layout}
62
+ >
63
+ {content}
64
+ </ChipGlass>
65
+ ) : (
66
+ <View
67
+ className={cn(
68
+ layout,
69
+ props.selected ? "bg-primary" : small ? "bg-grouped-card" : "bg-subtle",
70
+ )}
71
+ >
72
+ {content}
73
+ </View>
74
+ );
75
+ return props.onPress ? (
76
+ <Pressable
77
+ accessibilityRole="button"
78
+ accessibilityLabel={props.accessibilityLabel ?? props.label}
79
+ accessibilityState={{ selected: props.selected, disabled: Boolean(props.disabled) }}
80
+ disabled={props.disabled}
81
+ onPress={props.onPress}
82
+ hitSlop={6}
83
+ className={props.disabled ? "opacity-45" : "active:opacity-70"}
84
+ >
85
+ {body}
86
+ </Pressable>
87
+ ) : (
88
+ body
89
+ );
90
+}
apps/mobile/src/components/ErrorBanner.tsx
+2
-7
@@ -1,10 +1,5 @@
1
-import { View } from "react-native";
1
+import { Notice } from "./Notice";
2
3
-import { AppText as Text } from "./AppText";
3
export function ErrorBanner(props: { readonly message: string }) {
5
- return (
6
- <View className="rounded-2xl border border-danger-border bg-danger px-3.5 py-3">
7
- <Text className="font-t3-medium text-sm text-danger-foreground">{props.message}</Text>
8
- </View>
9
- );
4
+ return <Notice tone="danger" message={props.message} />;
5
}
apps/mobile/src/components/MaterialIconButton.android.tsx
+3
-3
@@ -7,7 +7,7 @@ import {
7
import { size } from "@expo/ui/jetpack-compose/modifiers";
8
import { View } from "react-native";
9
10
-import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
10
+import { useControlTheme } from "./useControlTheme";
11
import { useAndroidControlSizing } from "./useAndroidControlSizing";
12
import { SymbolView, type AppSymbolName } from "./AppSymbol";
13
@@ -20,7 +20,7 @@ export function MaterialIconButton(props: {
20
readonly variant?: "standard" | "primary" | "tonal" | "danger";
21
readonly tintColorClassName?: string;
22
}) {
23
- const { themeAppearance, themeVariables: colors } = useAppearancePreferences();
23
+ const { colorScheme, colors } = useControlTheme();
24
const { iconSize, buttonSize } = useAndroidControlSizing();
25
const variant = props.variant ?? "standard";
26
const Component =
@@ -58,7 +58,7 @@ export function MaterialIconButton(props: {
58
>
59
<View importantForAccessibility="no-hide-descendants">
60
<Host
61
- colorScheme={themeAppearance}
61
+ colorScheme={colorScheme}
62
ignoreSafeAreaKeyboardInsets
63
style={{ width: buttonSize, height: buttonSize }}
64
>
apps/mobile/src/components/MaterialSearchField.tsx
+3
-1
@@ -6,12 +6,14 @@ import { useAndroidControlSizing } from "./useAndroidControlSizing";
6
7
export function MaterialSearchField({
8
inputRef,
9
+ autoFocus = true,
10
accessibilityLabel,
11
clearAccessibilityLabel,
12
placeholder,
13
value,
14
onChangeText,
15
}: {
16
+ readonly autoFocus?: boolean;
17
readonly inputRef: RefObject<TextInputInstance | null>;
18
readonly accessibilityLabel: string;
19
readonly clearAccessibilityLabel: string;
@@ -37,7 +39,7 @@ export function MaterialSearchField({
39
<TextInput
40
ref={inputRef}
41
accessibilityLabel={accessibilityLabel}
40
- autoFocus
42
+ autoFocus={autoFocus}
43
autoCapitalize="none"
44
autoCorrect={false}
45
returnKeyType="search"
apps/mobile/src/components/MaterialSwitch.android.tsx
+3
-3
@@ -2,11 +2,11 @@ import { Host, Switch as ComposeSwitch } from "@expo/ui/jetpack-compose";
2
import { View } from "react-native";
3
import type { ThemedSwitchProps } from "./MaterialSwitch.types";
4
5
-import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
5
+import { useControlTheme } from "./useControlTheme";
6
7
/** Material's native switch, with the same palette and accessibility contract as our RN controls. */
8
export function MaterialSwitch(props: ThemedSwitchProps) {
9
- const { themeAppearance, themeVariables: colors } = useAppearancePreferences();
9
+ const { colorScheme, colors } = useControlTheme();
10
const toggle = () => {
11
if (!props.disabled) props.onValueChange?.(!props.value);
12
};
@@ -25,7 +25,7 @@ export function MaterialSwitch(props: ThemedSwitchProps) {
25
>
26
<View importantForAccessibility="no-hide-descendants">
27
<Host
28
- colorScheme={themeAppearance}
28
+ colorScheme={colorScheme}
29
ignoreSafeAreaKeyboardInsets
30
style={{ width: 52, height: 48 }}
31
>
apps/mobile/src/components/Notice.tsx
new
+85
@@ -0,0 +1,85 @@
1
+import { useEffect } from "react";
2
+import { AccessibilityInfo, Platform, Pressable, View } from "react-native";
3
+
4
+import { cn } from "../lib/cn";
5
+import { AppText } from "./AppText";
6
+import { SymbolView, type AppSymbolName } from "./AppSymbol";
7
+import { GlassSurface } from "./GlassSurface";
8
+
9
+/** Inline feedback or a dismissible notice positioned by its owning screen. */
10
+export function Notice(props: {
11
+ readonly message: string;
12
+ readonly tone?: "default" | "danger";
13
+ readonly icon?: AppSymbolName;
14
+ readonly iconTone?: "default" | "danger";
15
+ readonly floating?: boolean;
16
+ readonly onDismiss?: () => void;
17
+ readonly dismissLabel?: string;
18
+}) {
19
+ const danger = props.tone === "danger";
20
+ useEffect(() => {
21
+ // Live regions reach TalkBack; VoiceOver needs an explicit announcement.
22
+ if (Platform.OS === "ios") AccessibilityInfo.announceForAccessibility(props.message);
23
+ }, [props.message]);
24
+
25
+ const content = (
26
+ <View className="flex-row items-start gap-3">
27
+ {props.icon ? (
28
+ <View className="pt-0.5">
29
+ <SymbolView
30
+ name={props.icon}
31
+ size={16}
32
+ tintColorClassName={
33
+ danger || props.iconTone === "danger"
34
+ ? "accent-danger-foreground"
35
+ : "accent-icon-muted"
36
+ }
37
+ />
38
+ </View>
39
+ ) : null}
40
+ <AppText
41
+ selectable
42
+ accessibilityLiveRegion="polite"
43
+ className={cn(
44
+ "min-w-0 flex-1 text-sm",
45
+ danger ? "text-danger-foreground" : "text-foreground",
46
+ !props.floating && "font-t3-medium",
47
+ )}
48
+ >
49
+ {props.message}
50
+ </AppText>
51
+ {props.onDismiss ? (
52
+ <Pressable
53
+ accessibilityRole="button"
54
+ accessibilityLabel={props.dismissLabel ?? "Dismiss message"}
55
+ onPress={props.onDismiss}
56
+ hitSlop={10}
57
+ className="min-h-6 min-w-6 items-center justify-center active:opacity-60"
58
+ >
59
+ <SymbolView
60
+ name="xmark"
61
+ size={14}
62
+ tintColorClassName={danger ? "accent-danger-foreground" : "accent-icon-muted"}
63
+ />
64
+ </Pressable>
65
+ ) : null}
66
+ </View>
67
+ );
68
+ if (props.floating && Platform.OS === "ios")
69
+ return (
70
+ <GlassSurface className="p-4" style={{ borderRadius: 20 }}>
71
+ {content}
72
+ </GlassSurface>
73
+ );
74
+ return (
75
+ <View
76
+ className={cn(
77
+ "rounded-2xl border px-3.5 py-3",
78
+ danger ? "border-danger-border bg-danger" : "border-border bg-card",
79
+ props.floating && "p-4",
80
+ )}
81
+ >
82
+ {content}
83
+ </View>
84
+ );
85
+}
apps/mobile/src/components/NumberField.android.tsx
new
+44
@@ -0,0 +1,44 @@
1
+import { View } from "react-native";
2
+
3
+import { AppText } from "./AppText";
4
+import { MaterialIconButton } from "./MaterialIconButton";
5
+import type { NumberFieldProps } from "./NumberField";
6
+
7
+export function NumberField(props: NumberFieldProps) {
8
+ const adjust = (amount: number) => {
9
+ if (props.disabled) return;
10
+ const next = Math.max(props.min, Math.min(props.max, props.value + amount));
11
+ if (next !== props.value) props.onValueChange(next);
12
+ };
13
+
14
+ return (
15
+ <View className="shrink-0 flex-row items-center">
16
+ {/* Match the 32dp switch track while retaining 48dp button touch targets. */}
17
+ <View
18
+ pointerEvents="none"
19
+ className="absolute inset-x-0 rounded-full bg-subtle"
20
+ style={{ height: 32 }}
21
+ />
22
+ <MaterialIconButton
23
+ icon="minus"
24
+ accessibilityLabel={`Decrease ${props.label}`}
25
+ disabled={props.disabled || props.value <= props.min}
26
+ onPress={() => adjust(-1)}
27
+ />
28
+ <AppText
29
+ className="min-w-8 text-center text-base"
30
+ style={{ fontVariant: ["tabular-nums"] }}
31
+ accessibilityLabel={`${props.label}: ${props.formatValue?.(props.value) ?? props.value}`}
32
+ accessibilityLiveRegion="polite"
33
+ >
34
+ {props.value}
35
+ </AppText>
36
+ <MaterialIconButton
37
+ icon="plus"
38
+ accessibilityLabel={`Increase ${props.label}`}
39
+ disabled={props.disabled || props.value >= props.max}
40
+ onPress={() => adjust(1)}
41
+ />
42
+ </View>
43
+ );
44
+}
apps/mobile/src/components/NumberField.ios.tsx
renamed
+13
-19
@@ -11,26 +11,18 @@ import {
11
presentationBackground,
12
tag,
13
} from "@expo/ui/swift-ui/modifiers";
14
-import {
15
- MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
16
- MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
17
-} from "@t3tools/contracts";
14
import { useState } from "react";
15
20
-import { useAppearancePreferences } from "../appearance/AppearancePreferencesProvider";
21
-import type { AutoSettleDaysFieldProps } from "./AutoSettleDaysField";
22
-
23
-const days = Array.from(
24
- { length: MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS - MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS + 1 },
25
- (_, index) => MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS + index,
26
-);
16
+import { useControlTheme } from "./useControlTheme";
17
+import type { NumberFieldProps } from "./NumberField";
18
28
-export function AutoSettleDaysField(props: AutoSettleDaysFieldProps) {
29
- const { themeAppearance, themeVariables: colors, appearance } = useAppearancePreferences();
19
+export function NumberField(props: NumberFieldProps) {
20
+ const { colorScheme, colors, fontSize } = useControlTheme();
21
+ const values = Array.from({ length: props.max - props.min + 1 }, (_, index) => props.min + index);
22
const [open, setOpen] = useState(false);
23
const [draft, setDraft] = useState(props.value);
24
return (
33
- <Host matchContents colorScheme={themeAppearance} seedColor={colors["--color-primary"]}>
25
+ <Host matchContents colorScheme={colorScheme} seedColor={colors["--color-primary"]}>
26
<Popover isPresented={open} onIsPresentedChange={setOpen}>
27
<Popover.Trigger>
28
<Button
@@ -42,10 +34,12 @@ export function AutoSettleDaysField(props: AutoSettleDaysFieldProps) {
34
modifiers={[
35
buttonStyle("bordered"),
36
disabled(props.disabled),
45
- accessibilityLabel(`Days before auto-settle: ${props.value}`),
37
+ accessibilityLabel(
38
+ `${props.label}: ${props.formatValue?.(props.value) ?? props.value}`,
39
+ ),
40
frame({ minWidth: 64, minHeight: 44 }),
41
foregroundStyle(colors["--color-primary-text"]),
48
- font({ size: appearance.baseFontSize }),
42
+ font({ size: fontSize }),
43
]}
44
>
45
<Text>{String(props.value)}</Text>
@@ -60,17 +54,17 @@ export function AutoSettleDaysField(props: AutoSettleDaysFieldProps) {
54
]}
55
>
56
<Picker
63
- label="Days before auto-settle"
57
+ label={props.label}
58
selection={draft}
59
onSelectionChange={setDraft}
60
modifiers={[pickerStyle("wheel"), frame({ height: 180 })]}
61
>
68
- {days.map((value) => (
62
+ {values.map((value) => (
63
<Text
64
key={value}
65
modifiers={[tag(value), foregroundStyle(colors["--color-foreground"])]}
66
>
73
- {`${value} ${value === 1 ? "day" : "days"}`}
67
+ {props.formatValue?.(value) ?? String(value)}
68
</Text>
69
))}
70
</Picker>
apps/mobile/src/components/NumberField.tsx
new
+47
@@ -0,0 +1,47 @@
1
+import { useState } from "react";
2
+import { AppTextInput } from "./AppText";
3
+
4
+export interface NumberFieldProps {
5
+ readonly label: string;
6
+ readonly min: number;
7
+ readonly max: number;
8
+ readonly formatValue?: (value: number) => string;
9
+ readonly value: number;
10
+ readonly onValueChange: (value: number) => void;
11
+ readonly disabled?: boolean;
12
+}
13
+
14
+export function NumberField(props: NumberFieldProps) {
15
+ const [draft, setDraft] = useState<string | null>(null);
16
+ const commit = () => {
17
+ if (props.disabled) {
18
+ setDraft(null);
19
+ return;
20
+ }
21
+ const text = (draft ?? "").trim();
22
+ setDraft(null);
23
+ // Validate the whole input; decimals and trailing text must not become whole days.
24
+ const parsed = /^\d+$/.test(text) ? Number(text) : Number.NaN;
25
+ if (
26
+ Number.isInteger(parsed) &&
27
+ parsed >= props.min &&
28
+ parsed <= props.max &&
29
+ parsed !== props.value
30
+ ) {
31
+ props.onValueChange(parsed);
32
+ }
33
+ };
34
+ return (
35
+ <AppTextInput
36
+ className="min-h-10 w-20 rounded-xl px-3 py-2 text-center text-base"
37
+ keyboardType="number-pad"
38
+ returnKeyType="done"
39
+ value={draft ?? String(props.value)}
40
+ onChangeText={setDraft}
41
+ onBlur={commit}
42
+ onSubmitEditing={commit}
43
+ accessibilityLabel={props.label}
44
+ editable={!props.disabled}
45
+ />
46
+ );
47
+}
apps/mobile/src/components/SliderRow.android.tsx
renamed
+7
-11
@@ -4,17 +4,13 @@ import * as Haptics from "expo-haptics";
4
import { useRef, type ComponentProps } from "react";
5
import { View } from "react-native";
6
7
-import { AppText as Text } from "../../../../components/AppText";
8
-import { SymbolView } from "../../../../components/AppSymbol";
9
-import { useAppearancePreferences } from "../AppearancePreferencesProvider";
10
-import type { FontSizeSliderRow as SharedFontSizeSliderRow } from "./FontSizeSliderRow.shared";
7
+import { AppText as Text } from "./AppText";
8
+import { SymbolView } from "./AppSymbol";
9
+import { useControlTheme } from "./useControlTheme";
10
+import type { SliderRow as SharedSliderRow } from "./SliderRow";
11
12
-export function FontSizeSliderRow(props: ComponentProps<typeof SharedFontSizeSliderRow>) {
13
- const {
14
- themeAppearance,
15
- systemColorsActive,
16
- themeVariables: colors,
17
- } = useAppearancePreferences();
12
+export function SliderRow(props: ComponentProps<typeof SharedSliderRow>) {
13
+ const { colorScheme, systemColorsActive, colors } = useControlTheme();
14
const draft = useRef(props.value);
15
const commit = (value: number) => {
16
if (props.disabled) return;
@@ -52,7 +48,7 @@ export function FontSizeSliderRow(props: ComponentProps<typeof SharedFontSizeSli
48
>
49
<View importantForAccessibility="no-hide-descendants">
50
<Host
55
- colorScheme={themeAppearance}
51
+ colorScheme={colorScheme}
52
seedColor={systemColorsActive ? undefined : colors["--color-primary"]}
53
style={{ height: 48, width: "100%" }}
54
>
apps/mobile/src/components/SliderRow.tsx
renamed
+24
-18
@@ -1,5 +1,5 @@
1
import * as Haptics from "expo-haptics";
2
-import { SymbolView } from "../../../../components/AppSymbol";
2
+import { SymbolView } from "./AppSymbol";
3
import { useCallback, useEffect, useMemo, useRef } from "react";
4
import { View, type AccessibilityActionEvent } from "react-native";
5
import { Gesture, GestureDetector } from "react-native-gesture-handler";
@@ -11,7 +11,7 @@ import Animated, {
11
} from "react-native-reanimated";
12
import type { ComponentProps } from "react";
13
14
-import { AppText as Text } from "../../../../components/AppText";
14
+import { AppText as Text } from "./AppText";
15
16
type SymbolName = ComponentProps<typeof SymbolView>["name"];
17
@@ -24,9 +24,11 @@ function clampFraction(value: number): number {
24
return Math.min(1, Math.max(0, value));
25
}
26
27
-export function FontSizeSliderRow(props: {
27
+export function SliderRow(props: {
28
readonly disabled?: boolean;
29
readonly icon: SymbolName;
30
+ readonly minimumIcon?: SymbolName;
31
+ readonly maximumIcon?: SymbolName;
32
readonly label: string;
33
readonly valueLabel: string;
34
readonly min: number;
@@ -146,13 +148,15 @@ export function FontSizeSliderRow(props: {
148
<Text className="text-base font-t3-medium text-foreground-muted">{props.valueLabel}</Text>
149
</View>
150
<View className="flex-row items-center gap-3">
149
- <SymbolView
150
- name="textformat.size.smaller"
151
- size={15}
152
- tintColorClassName={"accent-icon-muted"}
153
- type="monochrome"
154
- weight="regular"
155
- />
151
+ {props.minimumIcon ? (
152
+ <SymbolView
153
+ name={props.minimumIcon}
154
+ size={15}
155
+ tintColorClassName={"accent-icon-muted"}
156
+ type="monochrome"
157
+ weight="regular"
158
+ />
159
+ ) : null}
160
<GestureDetector gesture={gesture}>
161
<View
162
accessible
@@ -180,7 +184,7 @@ export function FontSizeSliderRow(props: {
184
/>
185
</View>
186
<Animated.View
183
- className="absolute left-0 rounded-full border-border bg-primary-foreground"
187
+ className="absolute left-0 rounded-full border-border bg-primary"
188
style={[
189
{
190
borderWidth: 1,
@@ -198,13 +202,15 @@ export function FontSizeSliderRow(props: {
202
/>
203
</View>
204
</GestureDetector>
201
- <SymbolView
202
- name="textformat.size.larger"
203
- size={22}
204
- tintColorClassName={"accent-icon-muted"}
205
- type="monochrome"
206
- weight="regular"
207
- />
205
+ {props.maximumIcon ? (
206
+ <SymbolView
207
+ name={props.maximumIcon}
208
+ size={22}
209
+ tintColorClassName={"accent-icon-muted"}
210
+ type="monochrome"
211
+ weight="regular"
212
+ />
213
+ ) : null}
214
</View>
215
</View>
216
);
apps/mobile/src/components/useControlTheme.ts
new
+13
@@ -0,0 +1,13 @@
1
+import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
2
+
3
+/** Palette and type size for native controls hosted outside the RN style tree. */
4
+export function useControlTheme() {
5
+ const { themeAppearance, themeVariables, systemColorsActive, appearance } =
6
+ useAppearancePreferences();
7
+ return {
8
+ colorScheme: themeAppearance,
9
+ colors: themeVariables,
10
+ systemColorsActive,
11
+ fontSize: appearance.baseFontSize,
12
+ };
13
+}
apps/mobile/src/dependency-graph.test.ts
+1
-1
@@ -269,7 +269,7 @@ describe("mobile dependency graph", () => {
269
["lib", "features", 7, "lib must not add imports from features"],
270
// components -> features: mostly the appearance preferences provider
271
// and the layout toolbar bridges.
272
- ["components", "features", 33, "components must not add imports from features"],
272
+ ["components", "features", 31, "components must not add imports from features"],
273
// native -> features: native glue reading appearance/keyboard/review features.
274
["native", "features", 8, "native must not add imports from features"],
275
// lib -> state: attachment/session plumbing that predates the cycle
apps/mobile/src/features/development/ComponentCatalogScreen.tsx
new
+272
@@ -0,0 +1,272 @@
1
+import { useNavigation } from "@react-navigation/native";
2
+import { useRef, useState } from "react";
3
+import { Alert, Platform, View, type TextInputInstance } from "react-native";
4
+
5
+import { AppText, AppTextInput } from "../../components/AppText";
6
+import { AppSheet } from "../../components/AppSheet";
7
+import { Chip } from "../../components/Chip";
8
+import { ControlPillMenu } from "../../components/ControlPillMenu";
9
+import { ListActionRow } from "../../components/ListActionRow";
10
+import { ListChoiceRow } from "../../components/ListChoiceRow";
11
+import { ListRow } from "../../components/ListRow";
12
+import { ListSection } from "../../components/ListSection";
13
+import { ListToggleRow } from "../../components/ListToggleRow";
14
+import { Button } from "../../components/Button";
15
+import { MaterialIconButton } from "../../components/MaterialIconButton";
16
+import { MaterialFloatingActionButton } from "../../components/MaterialFloatingActionButton";
17
+import { MaterialSearchField } from "../../components/MaterialSearchField";
18
+import { LoadingStrip } from "../../components/LoadingStrip";
19
+import { Notice } from "../../components/Notice";
20
+import { NumberField } from "../../components/NumberField";
21
+import { ScreenHeader } from "../../components/ScreenHeader";
22
+import { ScreenScrollView } from "../../components/ScreenScrollView";
23
+import { SegmentedControl } from "../../components/SegmentedControl";
24
+import { SliderRow } from "../../components/SliderRow";
25
+import { showConfirmDialog } from "../../components/ConfirmDialogHost";
26
+import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
27
+import { MOBILE_THEME_IDS } from "../../lib/mobileTheme";
28
+
29
+const CHOICES = [
30
+ { value: "overview", label: "Overview" },
31
+ { value: "activity", label: "Activity" },
32
+];
33
+
34
+/** Development-only, real controls with local state and no environment commands. */
35
+export function ComponentCatalogScreen() {
36
+ const navigation = useNavigation();
37
+ const appearance = useAppearancePreferences();
38
+ const [page, setPage] = useState("controls");
39
+ const [tab, setTab] = useState("overview");
40
+ const [enabled, setEnabled] = useState(true);
41
+ const [value, setValue] = useState(3);
42
+ const [text, setText] = useState("");
43
+ const [search, setSearch] = useState("");
44
+ const [sheet, setSheet] = useState(false);
45
+ const [notice, setNotice] = useState(true);
46
+ const searchRef = useRef<TextInputInstance>(null);
47
+ const announceAction = () => setNotice(true);
48
+ const confirm = () => {
49
+ if (Platform.OS === "ios")
50
+ Alert.alert("Discard changes?", "This example only changes local catalog state.", [
51
+ { text: "Cancel", style: "cancel" },
52
+ { text: "Discard", style: "destructive", onPress: () => setText("") },
53
+ ]);
54
+ else
55
+ showConfirmDialog({
56
+ title: "Discard changes?",
57
+ message: "This example only changes local catalog state.",
58
+ confirmText: "Discard",
59
+ destructive: true,
60
+ onConfirm: () => setText(""),
61
+ });
62
+ };
63
+ return (
64
+ <View className="flex-1 bg-screen">
65
+ <ScreenHeader title="UI components" onBack={() => navigation.goBack()} sidebar={false} />
66
+ <ScreenScrollView
67
+ contentInsetAdjustmentBehavior="automatic"
68
+ contentContainerStyle={{ padding: 16, gap: 20, paddingBottom: 40 }}
69
+ keyboardShouldPersistTaps="handled"
70
+ >
71
+ <View className="gap-3">
72
+ <AppText className="text-sm text-foreground-muted">Theme preview</AppText>
73
+ <View className="flex-row flex-wrap gap-2">
74
+ {MOBILE_THEME_IDS.filter(
75
+ (id) => id !== "material-you" || appearance.systemColorsAvailable,
76
+ ).map((id) => (
77
+ <Chip
78
+ key={id}
79
+ label={id}
80
+ selected={appearance.themeId === id}
81
+ onPress={() => appearance.setThemeIdForBothAppearances(id)}
82
+ />
83
+ ))}
84
+ </View>
85
+ <SegmentedControl
86
+ options={[
87
+ { value: "light", label: "Light" },
88
+ { value: "dark", label: "Dark" },
89
+ ]}
90
+ selected={appearance.themeAppearance}
91
+ onSelect={appearance.setThemeMode}
92
+ size="compact"
93
+ />
94
+ </View>
95
+ <SegmentedControl
96
+ options={[
97
+ { value: "controls", label: "Controls" },
98
+ { value: "forms", label: "Forms" },
99
+ { value: "feedback", label: "Feedback" },
100
+ ]}
101
+ selected={page}
102
+ onSelect={setPage}
103
+ size="compact"
104
+ />
105
+ {page === "controls" ? (
106
+ <>
107
+ <View className="gap-3">
108
+ <AppText className="text-lg font-t3-semibold">Lists and selection</AppText>
109
+ <ListSection>
110
+ <ListRow icon="folder" label="Projects" detail="4" onPress={() => setSheet(true)} />
111
+ <ListToggleRow
112
+ icon="bell.badge"
113
+ label="Notifications"
114
+ description="Updates from your active threads"
115
+ value={enabled}
116
+ onValueChange={setEnabled}
117
+ />
118
+ <ListChoiceRow label="Selected option" selected onPress={announceAction} />
119
+ <ListActionRow
120
+ icon="trash"
121
+ label="Discard changes"
122
+ tone="danger"
123
+ onPress={confirm}
124
+ />
125
+ </ListSection>
126
+ <SegmentedControl
127
+ options={CHOICES}
128
+ selected={tab}
129
+ onSelect={setTab}
130
+ size="compact"
131
+ role="tab"
132
+ />
133
+ <View className="flex-row flex-wrap gap-2">
134
+ <Chip
135
+ label="Selected filter"
136
+ selected={enabled}
137
+ onPress={() => setEnabled(!enabled)}
138
+ />
139
+ <Chip label="Label" size="small" />
140
+ <Chip label="Disabled" disabled onPress={announceAction} />
141
+ </View>
142
+ </View>
143
+ <View className="gap-3">
144
+ <AppText className="text-lg font-t3-semibold">Buttons</AppText>
145
+ <View className="flex-row flex-wrap gap-2">
146
+ <Button label="Primary" tone="primary" onPress={announceAction} />
147
+ <Button label="Secondary" onPress={announceAction} />
148
+ <Button label="Contrast" tone="contrast" onPress={announceAction} />
149
+ </View>
150
+ <View className="flex-row flex-wrap gap-2">
151
+ <Button label="Disabled" disabled onPress={announceAction} />
152
+ <Button label="Loading" loading onPress={announceAction} />
153
+ <MaterialIconButton
154
+ accessibilityLabel="Open example sheet"
155
+ icon="plus"
156
+ variant="tonal"
157
+ onPress={() => setSheet(true)}
158
+ />
159
+ </View>
160
+ </View>
161
+ </>
162
+ ) : null}
163
+ {page === "forms" ? (
164
+ <View className="gap-3">
165
+ <AppText className="text-lg font-t3-semibold">Forms</AppText>
166
+ <AppTextInput
167
+ accessibilityLabel="Example name"
168
+ placeholder="Name"
169
+ value={text}
170
+ onChangeText={setText}
171
+ />
172
+ <View className="flex-row">
173
+ <MaterialSearchField
174
+ inputRef={searchRef}
175
+ accessibilityLabel="Search examples"
176
+ clearAccessibilityLabel="Clear examples search"
177
+ placeholder="Search examples"
178
+ value={search}
179
+ onChangeText={setSearch}
180
+ autoFocus={false}
181
+ />
182
+ </View>
183
+ <View className="flex-row items-center justify-between">
184
+ <AppText>Count</AppText>
185
+ <NumberField
186
+ label="Example count"
187
+ min={1}
188
+ max={10}
189
+ value={value}
190
+ onValueChange={setValue}
191
+ />
192
+ </View>
193
+ <ListSection>
194
+ <SliderRow
195
+ icon="textformat.size"
196
+ label="Example slider"
197
+ valueLabel={String(value)}
198
+ min={1}
199
+ max={10}
200
+ step={1}
201
+ value={value}
202
+ onChange={setValue}
203
+ />
204
+ </ListSection>
205
+ </View>
206
+ ) : null}
207
+ {page === "feedback" ? (
208
+ <View className="gap-3">
209
+ <AppText className="text-lg font-t3-semibold">Feedback and presentation</AppText>
210
+ <Notice message="This action could not finish. Try again." tone="danger" />
211
+ {notice ? (
212
+ <Notice
213
+ message="Changes are ready to review."
214
+ icon="checkmark.circle"
215
+ floating
216
+ onDismiss={() => setNotice(false)}
217
+ />
218
+ ) : (
219
+ <Button label="Show notice" onPress={announceAction} />
220
+ )}
221
+ <View className="flex-row flex-wrap gap-2">
222
+ <Button label="Sheet" onPress={() => setSheet(true)} />
223
+ <Button label="Dialog" onPress={confirm} />
224
+ <ControlPillMenu
225
+ title="Example menu"
226
+ actions={[
227
+ { id: "copy", title: "Copy", image: "doc.on.doc" },
228
+ { id: "discard", title: "Discard", attributes: { destructive: true } },
229
+ ]}
230
+ onPressAction={({ nativeEvent }) =>
231
+ nativeEvent.event === "discard" ? confirm() : announceAction()
232
+ }
233
+ >
234
+ <Chip label="Menu" trailingIcon="chevron.down" />
235
+ </ControlPillMenu>
236
+ </View>
237
+ <View className="relative h-3 overflow-hidden rounded-full bg-subtle">
238
+ <LoadingStrip progress={0.6} />
239
+ </View>
240
+ <View className="items-start">
241
+ <MaterialFloatingActionButton
242
+ label="New thread"
243
+ icon="plus"
244
+ variant="extended"
245
+ tone="primary"
246
+ onPress={() => setSheet(true)}
247
+ />
248
+ </View>
249
+ </View>
250
+ ) : null}
251
+ </ScreenScrollView>
252
+ {sheet ? (
253
+ <AppSheet title="Example sheet" onClose={() => setSheet(false)}>
254
+ <View className="p-4">
255
+ <ListSection>
256
+ <ListChoiceRow
257
+ label="Overview"
258
+ selected={tab === "overview"}
259
+ onPress={() => setTab("overview")}
260
+ />
261
+ <ListChoiceRow
262
+ label="Activity"
263
+ selected={tab === "activity"}
264
+ onPress={() => setTab("activity")}
265
+ />
266
+ </ListSection>
267
+ </View>
268
+ </AppSheet>
269
+ ) : null}
270
+ </View>
271
+ );
272
+}
apps/mobile/src/features/pull-requests/PullRequestOverviewLoading.tsx
+2
-4
@@ -1,7 +1,7 @@
1
+import { Chip } from "../../components/Chip";
2
import { PullRequestSectionHeading } from "./PullRequestSectionHeading";
3
import type { PullRequestListEntry } from "@t3tools/contracts";
4
import { View } from "react-native";
4
-import { AppText as Text } from "../../components/AppText";
5
import { PullRequestCardGroup, PullRequestCardRow } from "./PullRequestControls";
6
import { PullRequestStackCard } from "./PullRequestStackCard";
7
import type { PullRequestParams } from "./usePullRequestDiff";
@@ -91,9 +91,7 @@ export function PullRequestOverviewLoading({
91
{summary.labels.length ? (
92
<View className="flex-row flex-wrap gap-2">
93
{summary.labels.map((label) => (
94
- <View key={label.name} className="rounded-full bg-grouped-card px-3 py-1">
95
- <Text className="text-2xs text-foreground-muted">{label.name}</Text>
96
- </View>
94
+ <Chip key={label.name} label={label.name} size="small" />
95
))}
96
</View>
97
) : null}
apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
+2
-3
@@ -1,3 +1,4 @@
1
+import { Chip } from "../../components/Chip";
2
import { pullRequestTabOffset } from "./pullRequestTabScroll";
3
import { guideFocusedRows, type GuideDiffFocus } from "./guide/guideDiffFocus";
4
import { PullRequestGuideContent } from "./guide/PullRequestGuideScreen";
@@ -259,9 +260,7 @@ function PullRequestOverview(props: {
260
{pr.labels.length ? (
261
<Animated.View layout={PR_ROW_LAYOUT} className="flex-row flex-wrap gap-2">
262
{pr.labels.map((label) => (
262
- <View key={label.name} className="rounded-full bg-grouped-card px-3 py-1">
263
- <Text className="text-2xs text-foreground-muted">{label.name}</Text>
264
- </View>
263
+ <Chip key={label.name} label={label.name} size="small" />
264
))}
265
</Animated.View>
266
) : null}
apps/mobile/src/features/settings/appearance/components/FontSizeSliderRow.tsx
+14
-1
@@ -1 +1,14 @@
1
-export { FontSizeSliderRow } from "./FontSizeSliderRow.shared";
1
+import type { ComponentProps } from "react";
2
+import { SliderRow } from "../../../../components/SliderRow";
3
+
4
+export function FontSizeSliderRow(
5
+ props: Omit<ComponentProps<typeof SliderRow>, "minimumIcon" | "maximumIcon">,
6
+) {
7
+ return (
8
+ <SliderRow
9
+ {...props}
10
+ minimumIcon="textformat.size.smaller"
11
+ maximumIcon="textformat.size.larger"
12
+ />
13
+ );
14
+}
apps/mobile/src/features/settings/components/AutoSettleDaysField.android.tsx
deleted
-51
@@ -1,51 +0,0 @@
1
-import {
2
- MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
3
- MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
4
-} from "@t3tools/contracts";
5
-import { View } from "react-native";
6
-
7
-import { AppText } from "../../../components/AppText";
8
-import { MaterialIconButton } from "../../../components/MaterialIconButton";
9
-import type { AutoSettleDaysFieldProps } from "./AutoSettleDaysField";
10
-
11
-export function AutoSettleDaysField(props: AutoSettleDaysFieldProps) {
12
- const adjust = (amount: number) => {
13
- if (props.disabled) return;
14
- const next = Math.max(
15
- MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
16
- Math.min(MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS, props.value + amount),
17
- );
18
- if (next !== props.value) props.onValueChange(next);
19
- };
20
-
21
- return (
22
- <View className="shrink-0 flex-row items-center">
23
- {/* Match the 32dp switch track while retaining 48dp button touch targets. */}
24
- <View
25
- pointerEvents="none"
26
- className="absolute inset-x-0 rounded-full bg-subtle"
27
- style={{ height: 32 }}
28
- />
29
- <MaterialIconButton
30
- icon="minus"
31
- accessibilityLabel="Decrease days before auto-settle"
32
- disabled={props.disabled || props.value <= MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS}
33
- onPress={() => adjust(-1)}
34
- />
35
- <AppText
36
- className="min-w-8 text-center text-base"
37
- style={{ fontVariant: ["tabular-nums"] }}
38
- accessibilityLabel={`${props.value} ${props.value === 1 ? "day" : "days"} before auto-settle`}
39
- accessibilityLiveRegion="polite"
40
- >
41
- {props.value}
42
- </AppText>
43
- <MaterialIconButton
44
- icon="plus"
45
- accessibilityLabel="Increase days before auto-settle"
46
- disabled={props.disabled || props.value >= MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS}
47
- onPress={() => adjust(1)}
48
- />
49
- </View>
50
- );
51
-}
apps/mobile/src/features/settings/components/AutoSettleDaysField.tsx
+12
-37
@@ -1,48 +1,23 @@
1
-import { useState } from "react";
1
import {
2
MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
3
MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS,
4
} from "@t3tools/contracts";
5
+import type { ComponentProps } from "react";
6
+import { NumberField } from "../../../components/NumberField";
7
7
-import { AppTextInput } from "../../../components/AppText";
8
-
9
-export interface AutoSettleDaysFieldProps {
10
- readonly value: number;
11
- readonly onValueChange: (value: number) => void;
12
- readonly disabled?: boolean;
13
-}
8
+export type AutoSettleDaysFieldProps = Pick<
9
+ ComponentProps<typeof NumberField>,
10
+ "value" | "onValueChange" | "disabled"
11
+>;
12
13
export function AutoSettleDaysField(props: AutoSettleDaysFieldProps) {
16
- const [draft, setDraft] = useState<string | null>(null);
17
- const commit = () => {
18
- if (props.disabled) {
19
- setDraft(null);
20
- return;
21
- }
22
- const text = (draft ?? "").trim();
23
- setDraft(null);
24
- // Validate the whole input; decimals and trailing text must not become whole days.
25
- const parsed = /^\d+$/.test(text) ? Number(text) : Number.NaN;
26
- if (
27
- Number.isInteger(parsed) &&
28
- parsed >= MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS &&
29
- parsed <= MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS &&
30
- parsed !== props.value
31
- ) {
32
- props.onValueChange(parsed);
33
- }
34
- };
14
return (
36
- <AppTextInput
37
- className="min-h-10 w-20 rounded-xl px-3 py-2 text-center text-base"
38
- keyboardType="number-pad"
39
- returnKeyType="done"
40
- value={draft ?? String(props.value)}
41
- onChangeText={setDraft}
42
- onBlur={commit}
43
- onSubmitEditing={commit}
44
- accessibilityLabel="Days before auto-settle"
45
- editable={!props.disabled}
15
+ <NumberField
16
+ {...props}
17
+ min={MIN_SIDEBAR_AUTO_SETTLE_AFTER_DAYS}
18
+ max={MAX_SIDEBAR_AUTO_SETTLE_AFTER_DAYS}
19
+ label="Days before auto-settle"
20
+ formatValue={(value) => `${value} ${value === 1 ? "day" : "days"}`}
21
/>
22
);
23
}
apps/mobile/src/features/threads/ComposerErrorNotice.tsx
+11
-45
@@ -1,55 +1,21 @@
1
-import { useEffect } from "react";
2
-import { AccessibilityInfo, Platform, Pressable, View } from "react-native";
3
-
4
-import { AppText as Text } from "../../components/AppText";
5
-import { SymbolView } from "../../components/AppSymbol";
1
+import { View } from "react-native";
2
+import { Notice } from "../../components/Notice";
3
4
/** Why the thread's last message did not send, above the composer until dismissed. */
8
-export function ComposerErrorNotice({
9
- message,
10
- onDismiss,
11
-}: {
5
+export function ComposerErrorNotice(props: {
6
readonly message: string;
7
readonly onDismiss: () => void;
8
}) {
15
- // accessibilityLiveRegion below only reaches TalkBack; VoiceOver needs an
16
- // explicit announcement.
17
- useEffect(() => {
18
- if (Platform.OS === "ios") {
19
- AccessibilityInfo.announceForAccessibility(message);
20
- }
21
- }, [message]);
9
return (
10
<View className="px-4 pb-3">
24
- <View className="flex-row items-start gap-3 rounded-[20px] border-continuous bg-card p-4">
25
- <SymbolView
26
- name="exclamationmark.circle"
27
- size={16}
28
- tintColorClassName="accent-danger-foreground"
29
- type="monochrome"
30
- />
31
- <Text
32
- selectable
33
- accessibilityLiveRegion="polite"
34
- className="min-w-0 flex-1 text-sm text-foreground"
35
- >
36
- {message}
37
- </Text>
38
- <Pressable
39
- accessibilityLabel="Dismiss error"
40
- accessibilityRole="button"
41
- hitSlop={12}
42
- onPress={onDismiss}
43
- className="p-1 active:opacity-60"
44
- >
45
- <SymbolView
46
- name="xmark"
47
- size={14}
48
- tintColorClassName="accent-icon-muted"
49
- type="monochrome"
50
- />
51
- </Pressable>
52
- </View>
11
+ <Notice
12
+ message={props.message}
13
+ icon="exclamationmark.circle"
14
+ iconTone="danger"
15
+ floating
16
+ onDismiss={props.onDismiss}
17
+ dismissLabel="Dismiss error"
18
+ />
19
</View>
20
);
21
}
apps/mobile/src/features/workspace/ListFilterMenu.tsx
+11
-53
@@ -1,21 +1,9 @@
1
-import { GlassView } from "expo-glass-effect";
2
-import { Pressable, View } from "react-native";
3
-import { withUniwind } from "uniwind";
4
-import { AppText as Text } from "../../components/AppText";
5
-import { SymbolView } from "../../components/AppSymbol";
1
+import { Pressable } from "react-native";
2
+import { Chip } from "../../components/Chip";
3
import { ControlPillMenu } from "../../components/ControlPillMenu";
4
import type { ControlPillMenuProps } from "../../components/ControlPillMenu.types";
8
-import { cn } from "../../lib/cn";
9
-import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass";
5
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
6
12
-const FilterGlass = withUniwind(GlassView, {
13
- style: { fromClassName: "className" },
14
- tintColor: { fromClassName: "tintColorClassName", styleProperty: "accentColor" },
15
-});
16
-
17
-const PILL = "h-8 flex-row items-center gap-1.5 rounded-full px-3";
18
-
7
/** A visible filter with a native menu containing only that filter's choices. */
8
export function ListFilterMenu(props: {
9
readonly label: string;
@@ -26,33 +14,6 @@ export function ListFilterMenu(props: {
14
readonly onSelect: (id: string) => void;
15
}) {
16
const { themeAppearance } = useAppearancePreferences();
29
- const content = (
30
- <>
31
- {props.icon ? (
32
- <SymbolView
33
- name="line.3.horizontal.decrease"
34
- size={15}
35
- tintColorClassName={props.active ? "accent-primary-foreground" : "accent-icon-muted"}
36
- />
37
- ) : null}
38
- <Text
39
- numberOfLines={1}
40
- className={cn(
41
- "max-w-[180px] text-sm font-t3-medium",
42
- props.active ? "text-primary-foreground" : "text-foreground-muted",
43
- )}
44
- >
45
- {props.label}
46
- </Text>
47
- {!props.icon ? (
48
- <SymbolView
49
- name="chevron.down"
50
- size={11}
51
- tintColorClassName={props.active ? "accent-primary-foreground" : "accent-icon-muted"}
52
- />
53
- ) : null}
54
- </>
55
- );
17
return (
18
<ControlPillMenu
19
title={props.accessibilityLabel}
@@ -62,20 +23,17 @@ export function ListFilterMenu(props: {
23
<Pressable
24
accessibilityRole="button"
25
accessibilityLabel={props.accessibilityLabel}
26
+ accessibilityState={{ selected: Boolean(props.active) }}
27
hitSlop={6}
28
>
67
- {NATIVE_LIQUID_GLASS_SUPPORTED ? (
68
- <FilterGlass
69
- isInteractive
70
- colorScheme={themeAppearance}
71
- tintColorClassName={props.active ? "accent-primary" : undefined}
72
- className={PILL}
73
- >
74
- {content}
75
- </FilterGlass>
76
- ) : (
77
- <View className={cn(PILL, props.active ? "bg-primary" : "bg-subtle")}>{content}</View>
78
- )}
29
+ <Chip
30
+ label={props.label}
31
+ selected={props.active}
32
+ icon={props.icon ? "line.3.horizontal.decrease" : undefined}
33
+ trailingIcon={props.icon ? undefined : "chevron.down"}
34
+ glass
35
+ colorScheme={themeAppearance}
36
+ />
37
</Pressable>
38
</ControlPillMenu>
39
);