@devries-cameron20 / t3code-1 / commits / a71a6c37d1
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

refactor(mobile): reuse shared search fields (#21946)

Julius Marminge committed Oct 19, 2026 at 15:04 UTC a71a6c37d14154c8cb355242d569e8a1dbeec706
2 files changed +16 -17
apps/mobile/src/features/settings/SettingsOpenSourceLicensesRouteScreen.tsx
+9 -8
@@ -1,3 +1,4 @@
1 +import { SearchField } from "../../components/ui/SearchField";
2 import { Toolbar } from "../../components/ui/Toolbar";
3 import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
4 import { LegendList } from "@legendapp/list/react-native";
@@ -9,12 +10,12 @@ import {
10 thirdPartyLicenseEntryKey,
11 type ThirdPartyLicenseEntry,
12 } from "@t3tools/shared/thirdPartyLicenses";
12 -import { useCallback, useMemo, useState } from "react";
13 -import { Linking, Platform, Pressable, View } from "react-native";
13 +import { useCallback, useMemo, useRef, useState } from "react";
14 +import { Linking, Platform, Pressable, type TextInputInstance, View } from "react-native";
15 import { useSafeAreaInsets } from "react-native-safe-area-context";
16
17 import { SymbolView } from "../../components/ui/AppSymbol";
17 -import { AppText as Text, AppTextInput as TextInput } from "../../components/ui/AppText";
18 +import { AppText as Text } from "../../components/ui/AppText";
19 import { ListRow } from "../../components/ui/ListRow";
20 import { SettingsScreen } from "./components/SettingsScreen";
21 import { NativeStackScreenOptions } from "../../native/StackHeader";
@@ -52,6 +53,7 @@ function LicenseRow(props: {
53 }
54
55 export function SettingsOpenSourceLicensesRouteScreen() {
56 + const searchRef = useRef<TextInputInstance>(null);
57 const navigation = useNavigation();
58 const insets = useSafeAreaInsets();
59 const [query, setQuery] = useState("");
@@ -153,14 +155,13 @@ export function SettingsOpenSourceLicensesRouteScreen() {
155 ListHeaderComponent={
156 Platform.OS !== "ios" ? (
157 <View className="px-5 pt-4 pb-5">
156 - <TextInput
158 + <SearchField
159 + inputRef={searchRef}
160 + autoFocus={false}
161 accessibilityLabel="Search open-source licenses"
158 - autoCapitalize="none"
159 - autoCorrect={false}
160 - clearButtonMode="while-editing"
162 + clearAccessibilityLabel="Clear package search"
163 onChangeText={setQuery}
164 placeholder="Search packages"
163 - returnKeyType="search"
165 value={query}
166 />
167 </View>
apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx
+7 -9
@@ -1,3 +1,4 @@
1 +import { SearchField } from "../../components/ui/SearchField";
2 import { Button } from "../../components/ui/Button";
3 import { Toolbar } from "../../components/ui/Toolbar";
4 import * as Dialog from "../../components/ui/Dialog";
@@ -15,7 +16,7 @@ import {
16 import * as Haptics from "expo-haptics";
17 import { useNavigation } from "@react-navigation/native";
18 import { useEffect, useRef, useState, type ReactNode } from "react";
18 -import { Platform, Pressable, ScrollView, TextInput, View } from "react-native";
19 +import { Platform, Pressable, ScrollView, View } from "react-native";
20 import { useSafeAreaInsets } from "react-native-safe-area-context";
21
22 import { AndroidScreenHeader } from "../../components/ui/AndroidScreenHeader";
@@ -397,6 +398,7 @@ export function BranchPickerScreen(props: {
398 readonly onChangeStartFromOrigin: (value: boolean) => void;
399 };
400 }) {
401 + const searchRef = useRef<import("react-native").TextInputInstance>(null);
402 const navigation = useNavigation();
403 const insets = useSafeAreaInsets();
404 const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
@@ -516,17 +518,13 @@ export function BranchPickerScreen(props: {
518 onBack={() => navigation.goBack()}
519 />
520 <View className="bg-header px-4 pb-3 pt-1">
519 - <TextInput
520 - autoCapitalize="none"
521 - autoCorrect={false}
521 + <SearchField
522 + inputRef={searchRef}
523 + autoFocus={false}
524 accessibilityLabel="Find a branch"
523 - className="h-12 rounded-full border border-input-border bg-input px-4 font-sans text-base text-foreground"
524 - selectionColorClassName="accent-focus/32"
525 - cursorColorClassName="accent-focus"
526 - selectionHandleColorClassName="accent-focus"
525 + clearAccessibilityLabel="Clear branch search"
526 onChangeText={props.onQueryChange}
527 placeholder="Find a branch"
529 - placeholderTextColorClassName="accent-placeholder"
528 value={props.query}
529 />
530 </View>