The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 00:15 UTC
fix(mobile): show Agent behavior icon on Android (#12316)
Julius Marminge committed
Sep 17, 2026 at 14:03 UTC
6deac7a924e6d90eef400cd218703cd3ad00a383
4 files changed
+48
-20
apps/mobile/src/components/AppSymbol.ios.tsx
+4
-3
@@ -1,14 +1,15 @@
1
-import { SymbolView as ExpoSymbolView, type SymbolViewProps } from "expo-symbols";
1
+import { SymbolView as ExpoSymbolView } from "expo-symbols";
2
import { withUniwind } from "uniwind";
3
+import type { AppSymbolViewProps } from "./AppSymbol";
4
5
export type { SFSymbol } from "expo-symbols";
5
-export type AppSymbolName = SymbolViewProps["name"];
6
+export type { AppSymbolName } from "./AppSymbol";
7
8
/**
9
* Keep the iOS implementation isolated from the Android Tabler fallback so
10
* Metro does not initialize the icon package when iOS renders SF Symbols.
11
*/
11
-function AppSymbolView(props: SymbolViewProps) {
12
+function AppSymbolView(props: AppSymbolViewProps) {
13
return <ExpoSymbolView {...props} />;
14
}
15
apps/mobile/src/components/AppSymbol.tsx
+39
-10
@@ -4,11 +4,14 @@ import type { Icon } from "@tabler/icons-react-native/types";
4
* the entire Tabler icon set in Metro.
5
*/
6
import IconAdjustmentsHorizontal from "@tabler/icons-react-native/IconAdjustmentsHorizontal";
7
+import IconAlignLeft from "@tabler/icons-react-native/IconAlignLeft";
8
import IconAlertCircle from "@tabler/icons-react-native/IconAlertCircle";
9
import IconAlertTriangle from "@tabler/icons-react-native/IconAlertTriangle";
10
import IconApps from "@tabler/icons-react-native/IconApps";
11
import IconArchive from "@tabler/icons-react-native/IconArchive";
12
import IconArrowBackUp from "@tabler/icons-react-native/IconArrowBackUp";
13
+import IconArrowDown from "@tabler/icons-react-native/IconArrowDown";
14
+import IconArrowForwardUp from "@tabler/icons-react-native/IconArrowForwardUp";
15
import IconArrowLeft from "@tabler/icons-react-native/IconArrowLeft";
16
import IconArrowDownCircle from "@tabler/icons-react-native/IconArrowDownCircle";
17
import IconArrowRightCircle from "@tabler/icons-react-native/IconArrowRightCircle";
@@ -30,15 +33,17 @@ import IconChevronDown from "@tabler/icons-react-native/IconChevronDown";
33
import IconChevronLeft from "@tabler/icons-react-native/IconChevronLeft";
34
import IconChevronRight from "@tabler/icons-react-native/IconChevronRight";
35
import IconChevronUp from "@tabler/icons-react-native/IconChevronUp";
36
+import IconCircle from "@tabler/icons-react-native/IconCircle";
37
import IconCircleCheck from "@tabler/icons-react-native/IconCircleCheck";
38
import IconCircleXFilled from "@tabler/icons-react-native/IconCircleXFilled";
39
import IconTicket from "@tabler/icons-react-native/IconTicket";
40
import IconClock from "@tabler/icons-react-native/IconClock";
41
import IconCode from "@tabler/icons-react-native/IconCode";
42
import IconCopy from "@tabler/icons-react-native/IconCopy";
39
-import IconDeviceDesktop from "@tabler/icons-react-native/IconDeviceDesktop";
43
import IconDatabase from "@tabler/icons-react-native/IconDatabase";
44
+import IconDeviceDesktop from "@tabler/icons-react-native/IconDeviceDesktop";
45
import IconDeviceLaptop from "@tabler/icons-react-native/IconDeviceLaptop";
46
+import IconDeviceMobile from "@tabler/icons-react-native/IconDeviceMobile";
47
import IconDots from "@tabler/icons-react-native/IconDots";
48
import IconDotsVertical from "@tabler/icons-react-native/IconDotsVertical";
49
import IconDotsCircleHorizontal from "@tabler/icons-react-native/IconDotsCircleHorizontal";
@@ -62,13 +67,15 @@ import IconLayoutColumns from "@tabler/icons-react-native/IconLayoutColumns";
67
import IconLayoutSidebar from "@tabler/icons-react-native/IconLayoutSidebar";
68
import IconLayoutSidebarRight from "@tabler/icons-react-native/IconLayoutSidebarRight";
69
import IconLetterSpacing from "@tabler/icons-react-native/IconLetterSpacing";
65
-import IconMenu2 from "@tabler/icons-react-native/IconMenu2";
70
+import IconMicrophone from "@tabler/icons-react-native/IconMicrophone";
71
import IconLink from "@tabler/icons-react-native/IconLink";
72
+import IconMenu2 from "@tabler/icons-react-native/IconMenu2";
73
import IconMessage from "@tabler/icons-react-native/IconMessage";
74
import IconMinus from "@tabler/icons-react-native/IconMinus";
75
import IconMoon from "@tabler/icons-react-native/IconMoon";
76
import IconNetwork from "@tabler/icons-react-native/IconNetwork";
77
import IconPalette from "@tabler/icons-react-native/IconPalette";
78
+import IconPencil from "@tabler/icons-react-native/IconPencil";
79
import IconPhoto from "@tabler/icons-react-native/IconPhoto";
80
import IconPin from "@tabler/icons-react-native/IconPin";
81
import IconPinnedOff from "@tabler/icons-react-native/IconPinnedOff";
@@ -97,13 +104,14 @@ import IconUserCircle from "@tabler/icons-react-native/IconUserCircle";
104
import IconWifiOff from "@tabler/icons-react-native/IconWifiOff";
105
import IconWorld from "@tabler/icons-react-native/IconWorld";
106
import IconX from "@tabler/icons-react-native/IconX";
100
-import type { SFSymbol, SymbolViewProps } from "expo-symbols";
107
+import type { AndroidSymbol, SFSymbol, SymbolViewProps } from "expo-symbols";
108
import { withUniwind } from "uniwind";
109
103
-const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
110
+const ANDROID_ICON_BY_SF_SYMBOL = {
111
"arrow.branch": IconGitBranch,
112
"arrow.left": IconArrowLeft,
113
"arrow.clockwise": IconRefresh,
114
+ "arrow.down": IconArrowDown,
115
"arrow.down.circle": IconArrowDownCircle,
116
"arrow.right.circle": IconArrowRightCircle,
117
"arrow.triangle.branch": IconGitBranch,
@@ -117,6 +125,7 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
125
"arrow.up.right": IconArrowUpRight,
126
"arrow.up.right.circle": IconArrowUpRightCircle,
127
"arrow.uturn.backward": IconArrowBackUp,
128
+ "arrow.uturn.forward": IconArrowForwardUp,
129
archivebox: IconArchive,
130
"archivebox.fill": IconArchive,
131
"bell.badge": IconBellRinging,
@@ -127,6 +136,7 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
136
"chart.bar.xaxis": IconChartBar,
137
checkmark: IconCheck,
138
"checkmark.circle": IconCircleCheck,
139
+ circle: IconCircle,
140
clock: IconClock,
141
ticket: IconTicket,
142
cloud: IconCloud,
@@ -143,11 +153,13 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
153
moon: IconMoon,
154
"ellipsis.circle": IconDotsCircleHorizontal,
155
"exclamationmark.triangle": IconAlertTriangle,
156
+ "exclamationmark.circle": IconAlertCircle,
157
eye: IconEye,
158
folder: IconFolder,
159
"folder.badge.plus": IconFolderPlus,
160
"folder.fill": IconFolder,
161
gearshape: IconSettings,
162
+ globe: IconWorld,
163
hammer: IconHammer,
164
"info.circle": IconInfoCircle,
165
internaldrive: IconDatabase,
@@ -162,7 +174,9 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
174
macmini: IconServer,
175
macstudio: IconDeviceDesktop,
176
magnifyingglass: IconSearch,
177
+ mic: IconMicrophone,
178
paintbrush: IconPalette,
179
+ pencil: IconPencil,
180
"person.crop.circle": IconUserCircle,
181
photo: IconPhoto,
182
pin: IconPin,
@@ -187,6 +201,7 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
201
"sun.max": IconSun,
202
"stop.fill": IconPlayerStopFilled,
203
terminal: IconTerminal2,
204
+ "text.alignleft": IconAlignLeft,
205
"text.bubble": IconMessage,
206
"text.word.spacing": IconLetterSpacing,
207
"textformat.size": IconTypography,
@@ -197,13 +212,14 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
212
"wifi.slash": IconWifiOff,
213
xmark: IconX,
214
"xmark.circle.fill": IconCircleXFilled,
200
-};
215
+} satisfies Partial<Record<SFSymbol, Icon>>;
216
+const SF_ICON_LOOKUP: Partial<Record<SFSymbol, Icon>> = ANDROID_ICON_BY_SF_SYMBOL;
217
218
// Callers can pass `{ ios, android }` names where `android` is a Material
219
// icon name (the raw expo-symbols contract). Resolve those here too so the
220
// android key keeps working through this wrapper — it wins over the SF map
221
// when both match (e.g. folder vs folder_open for expanded project groups).
206
-const ANDROID_ICON_BY_MATERIAL_NAME: Record<string, Icon> = {
222
+const ANDROID_ICON_BY_MATERIAL_NAME = {
223
auto_awesome: IconSparkles,
224
bolt: IconBolt,
225
build: IconTool,
@@ -222,21 +238,34 @@ const ANDROID_ICON_BY_MATERIAL_NAME: Record<string, Icon> = {
238
keyboard_arrow_up: IconChevronUp,
239
keyboard_hide: IconKeyboardHide,
240
more_vert: IconDotsVertical,
241
+ merge: IconGitMerge,
242
public: IconWorld,
243
remove: IconMinus,
244
+ smartphone: IconDeviceMobile,
245
terminal: IconTerminal2,
246
visibility: IconEye,
229
-};
247
+} satisfies Partial<Record<AndroidSymbol, Icon>>;
248
249
export type { SFSymbol } from "expo-symbols";
232
-export type AppSymbolName = SymbolViewProps["name"];
250
+export type AppSymbolName =
251
+ | keyof typeof ANDROID_ICON_BY_SF_SYMBOL
252
+ | {
253
+ ios: SFSymbol;
254
+ android: keyof typeof ANDROID_ICON_BY_MATERIAL_NAME;
255
+ };
256
+
257
+export type AppSymbolViewProps = Omit<SymbolViewProps, "name"> & { name: AppSymbolName };
258
+
259
+export function isAppSymbolName(name: string): name is Extract<AppSymbolName, string> {
260
+ return Object.prototype.hasOwnProperty.call(ANDROID_ICON_BY_SF_SYMBOL, name);
261
+}
262
234
-function AppSymbolView(props: SymbolViewProps) {
263
+function AppSymbolView(props: AppSymbolViewProps) {
264
const materialName = typeof props.name === "string" ? undefined : props.name.android;
265
const sfSymbol = typeof props.name === "string" ? props.name : props.name.ios;
266
const AndroidIcon =
267
(materialName ? ANDROID_ICON_BY_MATERIAL_NAME[materialName] : undefined) ??
239
- (sfSymbol ? ANDROID_ICON_BY_SF_SYMBOL[sfSymbol] : undefined);
268
+ (sfSymbol ? SF_ICON_LOOKUP[sfSymbol] : undefined);
269
270
if (!AndroidIcon) {
271
return props.fallback ?? null;
apps/mobile/src/components/EnvironmentMachineSymbol.tsx
+2
-4
@@ -1,9 +1,7 @@
1
import type { EnvironmentMachineKind } from "@t3tools/contracts";
2
-import type { SFSymbol } from "expo-symbols";
2
+import { SymbolView, type AppSymbolName } from "./AppSymbol";
3
4
-import { SymbolView } from "./AppSymbol";
5
-
6
-const SYMBOL_BY_KIND: Record<EnvironmentMachineKind, SFSymbol> = {
4
+const SYMBOL_BY_KIND: Record<EnvironmentMachineKind, AppSymbolName> = {
5
server: "server.rack",
6
cloud: "cloud",
7
linux: "terminal",
apps/mobile/src/components/MaterialMenuPopup.android.tsx
+3
-3
@@ -12,7 +12,7 @@ import { View } from "react-native";
12
13
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
14
import type { MaterialMenuPopupProps } from "./MaterialMenuPopup";
15
-import { SymbolView, type AppSymbolName } from "./AppSymbol";
15
+import { isAppSymbolName, SymbolView, type AppSymbolName } from "./AppSymbol";
16
17
function MenuIcon(props: {
18
readonly name: AppSymbolName;
@@ -96,10 +96,10 @@ export function MaterialMenuPopup(props: MaterialMenuPopupProps) {
96
) : null}
97
</Column>
98
</DropdownMenuItem.Text>
99
- {action.image ? (
99
+ {action.image && isAppSymbolName(action.image) ? (
100
<DropdownMenuItem.LeadingIcon>
101
<MenuIcon
102
- name={action.image as AppSymbolName}
102
+ name={action.image}
103
destructive={action.attributes?.destructive}
104
disabled={action.attributes?.disabled}
105
/>