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 22, 18:15 UTC
fix(mobile): remove perpetual reconnect indicator animation (#24273)
Julius Marminge committed
Oct 25, 2026 at 00:55 UTC
3e20b652e2dc84bedaaeb22089886ed45756fce6
1 file changed
+8
-48
apps/mobile/src/features/connection/ConnectionStatusDot.tsx
+8
-48
@@ -1,13 +1,4 @@
1
-import { useEffect } from "react";
1
import { View } from "react-native";
3
-import Animated, {
4
- cancelAnimation,
5
- Easing,
6
- useAnimatedStyle,
7
- useSharedValue,
8
- withRepeat,
9
- withTiming,
10
-} from "react-native-reanimated";
2
3
import type { RemoteClientConnectionState } from "../../lib/connection";
4
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
@@ -50,49 +41,17 @@ function statusDotTone(
41
}
42
}
43
53
-function usePulseAnimation(pulse: boolean) {
54
- const pulseProgress = useSharedValue(0);
55
-
56
- useEffect(() => {
57
- if (pulse) {
58
- pulseProgress.value = withRepeat(
59
- withTiming(1, {
60
- duration: 1100,
61
- easing: Easing.out(Easing.cubic),
62
- }),
63
- -1,
64
- false,
65
- );
66
- return;
67
- }
68
-
69
- cancelAnimation(pulseProgress);
70
- pulseProgress.value = withTiming(0, {
71
- duration: 180,
72
- easing: Easing.out(Easing.quad),
73
- });
74
- }, [pulse, pulseProgress]);
75
-
76
- return pulseProgress;
77
-}
78
-
44
export function ConnectionStatusDot(props: {
45
readonly state: ConnectionStatusDotState;
46
readonly pulse: boolean;
47
readonly size?: number;
48
}) {
84
- const pulseProgress = usePulseAnimation(props.pulse);
49
const { themeAppearance, themeVariables } = useAppearancePreferences();
50
const tone = statusDotTone(props.state, themeVariables, themeAppearance === "dark");
51
const dotSize = props.size ?? 10;
52
const haloSize = dotSize + 4;
53
const containerSize = haloSize + 4;
54
91
- const haloStyle = useAnimatedStyle(() => ({
92
- opacity: props.pulse ? 0.14 + (1 - pulseProgress.value) * 0.3 : 0,
93
- transform: [{ scale: 0.78 + pulseProgress.value * 1.16 }],
94
- }));
95
-
55
return (
56
<View
57
style={{
@@ -102,18 +61,19 @@ export function ConnectionStatusDot(props: {
61
justifyContent: "center",
62
}}
63
>
105
- <Animated.View
106
- style={[
107
- haloStyle,
108
- {
64
+ {/* Looping Reanimated updates can starve React commits while commit pausing is disabled. */}
65
+ {props.pulse ? (
66
+ <View
67
+ style={{
68
position: "absolute",
69
width: haloSize,
70
height: haloSize,
71
borderRadius: haloSize / 2,
72
backgroundColor: tone.haloColor,
114
- },
115
- ]}
116
- />
73
+ opacity: 0.3,
74
+ }}
75
+ />
76
+ ) : null}
77
<View
78
style={{
79
width: dotSize,