The best way to control Claude Code, Codex and more from any computer or phone
refactor(mobile): adopt shared loading indicators across screens (#20001)
Julius Marminge committed
Oct 15, 2026 at 15:51 UTC
f3280793fa50765a6181609d746e756179d839f1
15 files changed
+48
-43
apps/mobile/src/components/AndroidScreenHeader.tsx
+3
-2
@@ -1,6 +1,7 @@
1
+import { AppActivityIndicator } from "./AppActivityIndicator";
2
import { Column, Text as NativeText, RNHostView } from "@expo/ui/jetpack-compose";
3
import { useState, type ReactNode } from "react";
3
-import { ActivityIndicator, View } from "react-native";
4
+import { View } from "react-native";
5
6
import type { AppSymbolName } from "./AppSymbol";
7
import { NativeAppBar } from "./NativeAppBar.android";
@@ -127,7 +128,7 @@ export function AndroidScreenHeader(props: {
128
accessibilityLabel={action.accessibilityLabel}
129
className="size-12 items-center justify-center"
130
>
130
- <ActivityIndicator colorClassName="accent-header-foreground" />
131
+ <AppActivityIndicator colorClassName="accent-header-foreground" />
132
</View>
133
) : (
134
<AndroidHeaderIconButton
apps/mobile/src/components/AppBar.tsx
+3
-2
@@ -1,6 +1,7 @@
1
+import { AppActivityIndicator } from "./AppActivityIndicator";
2
import type { HeaderBarButtonMailSearchToolbarItem } from "react-native-screens";
3
import { useId } from "react";
3
-import { ActivityIndicator, Platform, View } from "react-native";
4
+import { Platform, View } from "react-native";
5
import { createNativeHeaderMenu } from "./nativeHeaderMenu.ios";
6
import { ScreenHeaderButton } from "./ScreenHeaderButton";
7
import { NativeHeaderToolbar, NativeStackScreenOptions } from "../native/StackHeader";
@@ -155,7 +156,7 @@ export function AppBar(props: AppBarProps) {
156
accessibilityLabel={action.accessibilityLabel}
157
className="size-9 items-center justify-center"
158
>
158
- <ActivityIndicator color={action.tintColor} />
159
+ <AppActivityIndicator color={action.tintColor} />
160
</View>
161
</NativeHeaderToolbar.Custom>
162
) : (
apps/mobile/src/features/browser/BrowserPreviewRouteScreen.tsx
+3
-2
@@ -1,3 +1,4 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import * as Dialog from "../../components/Dialog";
3
import { useIsFocused, useNavigation, type StaticScreenProps } from "@react-navigation/native";
4
import { createNativeStackNavigator } from "@react-navigation/native-stack";
@@ -9,7 +10,7 @@ import {
10
} from "@t3tools/contracts";
11
import { normalizePreviewUrl } from "@t3tools/shared/preview";
12
import { useCallback, useEffect, useRef, useState } from "react";
12
-import { ActivityIndicator, AppState, Platform, TextInput, View } from "react-native";
13
+import { AppState, Platform, TextInput, View } from "react-native";
14
import { useSafeAreaInsets } from "react-native-safe-area-context";
15
16
import { ControlPill } from "../../components/ControlPill";
@@ -197,7 +198,7 @@ function BrowserPreviewScreen({
198
) : (
199
<View className="flex-1 items-center justify-center">
200
{focused && foreground ? (
200
- <ActivityIndicator color={themeVariables["--color-icon"]} />
201
+ <AppActivityIndicator color={themeVariables["--color-icon"]} />
202
) : null}
203
</View>
204
)}
apps/mobile/src/features/browser/PreviewStreamWebView.tsx
+4
-3
@@ -1,3 +1,4 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import * as Dialog from "../../components/Dialog";
3
import previewStreamScript from "@t3tools/mobile-preview-stream";
4
import {
@@ -19,7 +20,7 @@ import {
20
useState,
21
type Ref,
22
} from "react";
22
-import { ActivityIndicator, Platform, Pressable, TextInput, View } from "react-native";
23
+import { Platform, Pressable, TextInput, View } from "react-native";
24
import { WebView } from "react-native-webview";
25
import * as Clipboard from "expo-clipboard";
26
@@ -134,7 +135,7 @@ export function PreviewStreamWebView(
135
: "flex-1 items-center justify-center gap-4 px-6"
136
}
137
>
137
- {props.compact || !error ? <ActivityIndicator colorClassName="accent-icon" /> : null}
138
+ {props.compact || !error ? <AppActivityIndicator colorClassName="accent-icon" /> : null}
139
{!props.compact && (
140
<>
141
<AppText
@@ -502,7 +503,7 @@ function PreviewStreamDocumentView({
503
className="absolute inset-0 items-center justify-center gap-4 px-6"
504
style={{ backgroundColor: background }}
505
>
505
- {status === "connecting" ? <ActivityIndicator colorClassName="accent-icon" /> : null}
506
+ {status === "connecting" ? <AppActivityIndicator colorClassName="accent-icon" /> : null}
507
{compact ? null : (
508
<AppText
509
accessibilityLiveRegion="polite"
apps/mobile/src/features/pull-requests/PullRequestDiscussionScreen.tsx
+3
-2
@@ -1,9 +1,10 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import { useAtomRefresh } from "@effect/atom-react";
3
import { useNavigation, type StaticScreenProps } from "@react-navigation/native";
4
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
5
import type { PullRequestThreadComment } from "@t3tools/contracts";
6
import { useRef, useState } from "react";
6
-import { ActivityIndicator, Platform, ScrollView, View } from "react-native";
7
+import { Platform, ScrollView, View } from "react-native";
8
import { KeyboardAvoidingView, useKeyboardState } from "react-native-keyboard-controller";
9
import { NativeScrollViewMarker as ScrollViewMarker } from "../../native/NativeScrollViewMarker";
10
import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -163,7 +164,7 @@ function Discussion({ params }: { params: PullRequestParams & { readonly discuss
164
paddingBottom: canReply ? composerHeight + bottomInset + 24 : 24,
165
}}
166
>
166
- {activity.isPending && !thread ? <ActivityIndicator /> : null}
167
+ {activity.isPending && !thread ? <AppActivityIndicator /> : null}
168
{thread ? (
169
<View className="gap-2 pb-4">
170
<Text selectable className="font-mono text-xs text-foreground-muted">
apps/mobile/src/features/pull-requests/PullRequestFiles.tsx
+3
-2
@@ -1,10 +1,11 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import { PullRequestSectionHeading } from "./PullRequestSectionHeading";
3
import { AnimatedLegendList } from "@legendapp/list/reanimated";
4
import Animated from "react-native-reanimated";
5
import { PR_ROW_LAYOUT, PR_ROW_ENTER, PR_ROW_EXIT } from "./pullRequestAnimations";
6
import { useNavigation } from "@react-navigation/native";
7
import { useState } from "react";
7
-import { ActivityIndicator, Pressable, View } from "react-native";
8
+import { Pressable, View } from "react-native";
9
import { AppText as Text } from "../../components/AppText";
10
import { EmptyState } from "../../components/EmptyState";
11
import { Menu } from "../../components/Menu";
@@ -261,7 +262,7 @@ export function usePullRequestFilesContent(props: {
262
className="min-h-11 items-center justify-center rounded-xl bg-grouped-card px-4 py-3"
263
>
264
{result.isPending ? (
264
- <ActivityIndicator />
265
+ <AppActivityIndicator />
266
) : (
267
<Text className="text-sm font-t3-medium">
268
{result.error ? "Retry loading files" : "Load more files"}
apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx
+3
-2
@@ -1,10 +1,11 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import * as Dialog from "../../components/Dialog";
3
import { useAtomRefresh, useAtomSet, useAtomValue } from "@effect/atom-react";
4
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
5
import type { PullRequestDetail, PullRequestMergeMethod } from "@t3tools/contracts";
6
import { AsyncResult } from "effect/reactivity";
7
import { useRef, useState } from "react";
7
-import { ActivityIndicator, Platform, Pressable, View } from "react-native";
8
+import { Platform, Pressable, View } from "react-native";
9
import { AppText as Text } from "../../components/AppText";
10
import { SymbolView } from "../../components/AppSymbol";
11
import { Menu } from "../../components/Menu";
@@ -196,7 +197,7 @@ export function PullRequestMergeControls(props: {
197
className="min-h-11 min-w-0 flex-1 flex-row items-center justify-center gap-2 px-3 py-2 active:opacity-70"
198
>
199
{busy || checkingStack ? (
199
- <ActivityIndicator size="small" colorClassName="accent-icon-muted" />
200
+ <AppActivityIndicator size="small" colorClassName="accent-icon-muted" />
201
) : (
202
<SymbolView
203
name="arrow.triangle.merge"
apps/mobile/src/features/pull-requests/PullRequestPresentation.tsx
+3
-2
@@ -1,6 +1,7 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import type { PullRequestActor } from "@t3tools/contracts";
3
import { Image } from "expo-image";
3
-import { ActivityIndicator, View } from "react-native";
4
+import { View } from "react-native";
5
6
import { AppText as Text } from "../../components/AppText";
7
import { cn } from "../../lib/cn";
@@ -11,7 +12,7 @@ export function PullRequestReadStatus(props: {
12
readonly error: string | null;
13
}) {
14
return props.pending ? (
14
- <ActivityIndicator className="my-12" colorClassName="accent-icon" />
15
+ <AppActivityIndicator className="my-12" colorClassName="accent-icon" />
16
) : props.error ? (
17
<EmptyState title="Couldn't load this pull request" detail={props.error} variant="plain" />
18
) : null;
apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsx
+4
-4
@@ -1,3 +1,4 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import { usePullRequestConnected } from "./usePullRequestConnected";
3
import { useAtomValue } from "@effect/atom-react";
4
import { useNavigation, type StaticScreenProps } from "@react-navigation/native";
@@ -5,7 +6,6 @@ import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime"
6
import type { PullRequestReviewerCandidate } from "@t3tools/contracts";
7
import { useEffect, useMemo, useRef, useState } from "react";
8
import {
8
- ActivityIndicator,
9
FlatList,
10
Platform,
11
Pressable,
@@ -231,7 +231,7 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
231
</Text>
232
</View>
233
{pending === id ? (
234
- <ActivityIndicator />
234
+ <AppActivityIndicator />
235
) : item.isRequested ? (
236
<View className="flex-row items-center gap-1.5">
237
<Text className="text-xs text-foreground-muted">Requested</Text>
@@ -245,7 +245,7 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
245
}}
246
ListEmptyComponent={
247
result.isPending && !result.data ? (
248
- <ActivityIndicator className="my-8" />
248
+ <AppActivityIndicator className="my-8" />
249
) : (
250
<View className="px-4 py-6">
251
<EmptyState
@@ -281,7 +281,7 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
281
>
282
{!pr ? (
283
detail.isPending ? (
284
- <ActivityIndicator />
284
+ <AppActivityIndicator />
285
) : (
286
<Text className="text-danger-foreground">
287
{detail.error ?? "Couldn't load this pull request."}
apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
+2
-2
@@ -1,3 +1,4 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import { Chip } from "../../components/Chip";
3
import { pullRequestTabOffset } from "./pullRequestTabScroll";
4
import { guideFocusedRows, type GuideDiffFocus } from "./guide/guideDiffFocus";
@@ -49,7 +50,6 @@ import { PullRequestOverviewLoading } from "./PullRequestOverviewLoading";
50
import { pullRequestStatus } from "./pullRequestStatus";
51
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
52
import {
52
- ActivityIndicator,
53
Linking,
54
Platform,
55
Pressable,
@@ -1208,7 +1208,7 @@ export function PullRequestFileRouteScreen({
1208
) : null}
1209
{result.nextCursor && result.isPending && data.rows.length && !seekingFile ? (
1210
<View className="flex-row items-center justify-center gap-2 py-2">
1211
- <ActivityIndicator size="small" />
1211
+ <AppActivityIndicator size="small" />
1212
<Text className="text-xs text-foreground-muted">Loading more files…</Text>
1213
</View>
1214
) : null}
apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx
+3
-3
@@ -1,10 +1,10 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import { LegendList, type LegendListRef } from "@legendapp/list/react-native";
3
import { useNavigation } from "@react-navigation/native";
4
import { use, useCallback, useEffect, useMemo, useRef, useState } from "react";
5
import { ProjectId } from "@t3tools/contracts";
6
import { useAtomValue } from "@effect/atom-react";
7
import {
7
- ActivityIndicator,
8
Keyboard,
9
Platform,
10
Pressable,
@@ -317,7 +317,7 @@ export function PullRequestsScreen(
317
ListFooterComponent={
318
result.loadingMore ? (
319
<View className="items-center py-5">
320
- <ActivityIndicator
320
+ <AppActivityIndicator
321
colorClassName="accent-icon"
322
accessibilityLabel="Loading more pull requests"
323
/>
@@ -337,7 +337,7 @@ export function PullRequestsScreen(
337
ListEmptyComponent={
338
result.isPending && connectedTargets.length > 0 ? (
339
<View className="items-center py-12">
340
- <ActivityIndicator colorClassName="accent-icon" />
340
+ <AppActivityIndicator colorClassName="accent-icon" />
341
</View>
342
) : (
343
<View className="px-8 py-12">
apps/mobile/src/features/threads/HtmlRenderWebView.tsx
+4
-3
@@ -1,3 +1,4 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import { useNavigation } from "@react-navigation/native";
3
import type { EnvironmentId, ThreadId } from "@t3tools/contracts";
4
import {
@@ -9,7 +10,7 @@ import {
10
type HtmlRenderTheme,
11
} from "@t3tools/shared/htmlRender";
12
import { useEffect, useMemo, useRef, useState } from "react";
12
-import { ActivityIndicator, Platform, Pressable, View, type ColorValue } from "react-native";
13
+import { Platform, Pressable, View, type ColorValue } from "react-native";
14
import { WebView, type WebViewMessageEvent } from "react-native-webview";
15
16
import { SymbolView } from "../../components/AppSymbol";
@@ -184,7 +185,7 @@ export function HtmlRenderWebView(props: {
185
/>
186
{loaded ? null : (
187
<View pointerEvents="none" className="absolute inset-0 items-center justify-center">
187
- <ActivityIndicator />
188
+ <AppActivityIndicator />
189
</View>
190
)}
191
</View>
@@ -263,7 +264,7 @@ export function ThreadHtmlRender(props: {
264
</Pressable>
265
) : (
266
<View className="flex-1 items-center justify-center">
266
- <ActivityIndicator />
267
+ <AppActivityIndicator />
268
</View>
269
)}
270
{uri !== null && !failed ? (
apps/mobile/src/features/threads/McpAppWebView.tsx
+3
-2
@@ -1,3 +1,4 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import * as Dialog from "../../components/Dialog";
3
import type { EnvironmentId, ThreadId, TurnItemId } from "@t3tools/contracts";
4
import {
@@ -22,7 +23,7 @@ import * as Predicate from "effect/Predicate";
23
import Constants from "expo-constants";
24
import { useNavigation } from "@react-navigation/native";
25
import { useEffect, useMemo, useRef, useState } from "react";
25
-import { ActivityIndicator, Platform, Pressable, View } from "react-native";
26
+import { Platform, Pressable, View } from "react-native";
27
import { useSafeAreaInsets } from "react-native-safe-area-context";
28
import { WebView, type WebViewMessageEvent } from "react-native-webview";
29
@@ -605,7 +606,7 @@ export function ThreadMcpApp(props: {
606
) : null}
607
{uri !== null && !loaded && !crashed && !navigatedAway ? (
608
<View pointerEvents="none" className="absolute inset-0 items-center justify-center">
608
- <ActivityIndicator />
609
+ <AppActivityIndicator />
610
</View>
611
) : null}
612
</View>
apps/mobile/src/features/usage/UsageRouteScreen.tsx
+3
-2
@@ -1,3 +1,4 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import { ChatGptUsageSummary } from "./ChatGptUsageSummary";
3
import { ScreenScrollView as ScrollView } from "../../components/ScreenScrollView";
4
import { EnvironmentId, USAGE_CONTRACT_VERSION, type UsageProviderKind } from "@t3tools/contracts";
@@ -27,7 +28,7 @@ import {
28
makeWindow,
29
} from "@t3tools/shared/usageFormat";
30
import { useCallback, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from "react";
30
-import { ActivityIndicator, Platform, Pressable, RefreshControl, View } from "react-native";
31
+import { Platform, Pressable, RefreshControl, View } from "react-native";
32
import Animated, {
33
FadeIn,
34
ReduceMotion,
@@ -430,7 +431,7 @@ function UsageUpdating({
431
pointerEvents="none"
432
className="absolute right-4 top-4 h-5 max-w-[55%] flex-row items-center gap-1.5"
433
>
433
- <ActivityIndicator size="small" colorClassName="accent-adaptive-sky-600-400" />
434
+ <AppActivityIndicator size="small" colorClassName="accent-adaptive-sky-600-400" />
435
<Text className="shrink text-sm text-adaptive-sky-600-400" numberOfLines={1}>
436
{label}
437
</Text>
apps/mobile/src/features/voice-input/GlobalVoiceInputControl.tsx
+4
-10
@@ -1,12 +1,6 @@
1
+import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2
import { useEffect, useRef, useState, type ReactNode, type RefObject } from "react";
2
-import {
3
- ActivityIndicator,
4
- Linking,
5
- Platform,
6
- Pressable,
7
- useWindowDimensions,
8
- View,
9
-} from "react-native";
3
+import { Linking, Platform, Pressable, useWindowDimensions, View } from "react-native";
4
import Animated, {
5
Easing,
6
Extrapolation,
@@ -154,7 +148,7 @@ function EdgeDictationPill(props: { readonly collapseRef: RefObject<(() => void)
148
/>
149
</>
150
) : (
157
- <ActivityIndicator size="small" colorClassName="accent-icon-muted" />
151
+ <AppActivityIndicator size="small" colorClassName="accent-icon-muted" />
152
)}
153
</Pressable>
154
</Animated.View>
@@ -243,7 +237,7 @@ function EdgeDictationPill(props: { readonly collapseRef: RefObject<(() => void)
237
accessibilityLabel={presentation.statusLabel ?? undefined}
238
className="size-[30px] items-center justify-center"
239
>
246
- <ActivityIndicator size="small" colorClassName="accent-icon-muted" />
240
+ <AppActivityIndicator size="small" colorClassName="accent-icon-muted" />
241
</View>
242
)}
243
</Animated.View>