The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): share toast motion and bring bottom undo to iOS (#23968)
Alex committed
Oct 25, 2026 at 11:33 UTC
8096799b85bdfd97ce75ad921a88e7f47ddbbf9f
6 files changed
+278
-173
apps/mobile/src/components/ui/GlassSurface.tsx
+3
-2
@@ -25,7 +25,8 @@ interface GlassSurfaceProps extends ViewProps {
25
readonly ref?: Ref<ViewInstance>;
26
readonly children: ReactNode;
27
readonly glassEffectStyle?: "clear" | "regular" | "none";
28
- readonly tintColor?: ColorValue;
28
+ // null leaves UIKit's material untinted instead of applying the theme tint.
29
+ readonly tintColor?: ColorValue | null;
30
readonly tintColorClassName?: string;
31
readonly chrome?: "default" | "none";
32
readonly fallbackColor?: ColorValue;
@@ -71,7 +72,7 @@ export function GlassSurface({
72
className,
73
)}
74
glassEffectStyle={glassEffectStyle}
74
- tintColor={tintColor === undefined ? undefined : String(tintColor)}
75
+ tintColor={tintColor == null ? undefined : String(tintColor)}
76
tintColorClassName={
77
tintColorClassName ?? (tintColor === undefined ? "accent-glass-tint" : undefined)
78
}
apps/mobile/src/components/ui/Toast.tsx
+167
-15
@@ -1,36 +1,71 @@
1
-import { MOBILE_SHAPE } from "../../lib/designTokens";
2
-import { useEffect } from "react";
3
-import { AccessibilityInfo, Platform, View, useWindowDimensions } from "react-native";
1
+import { MOBILE_MOTION, MOBILE_SHAPE } from "../../lib/designTokens";
2
+import { useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react";
3
+import { AccessibilityInfo, Platform, StyleSheet, View, useWindowDimensions } from "react-native";
4
+import { GestureDetector, usePanGesture } from "react-native-gesture-handler";
5
+import Animated, {
6
+ cancelAnimation,
7
+ Easing,
8
+ FadeOut,
9
+ ReduceMotion,
10
+ runOnJS,
11
+ useAnimatedStyle,
12
+ useSharedValue,
13
+ withTiming,
14
+ type EntryAnimationsValues,
15
+} from "react-native-reanimated";
16
17
import { AppText } from "./AppText";
18
import { Button } from "./Button";
19
import { GlassSurface } from "./GlassSurface";
20
+import { useControlTheme } from "./useControlTheme";
21
import { IconButton } from "./IconButton";
22
import { AppActivityIndicator } from "./AppActivityIndicator";
23
import { SymbolView } from "./AppSymbol";
24
12
-export interface ToastProps {
25
+export type ToastProps = {
26
readonly message: string;
27
readonly description?: string;
28
+ readonly singleLine?: boolean;
29
readonly tone?: "default" | "success" | "danger";
30
readonly busy?: boolean;
31
readonly action?: { readonly label: string; readonly onPress: () => void };
18
- readonly onDismiss?: () => void;
19
-}
32
+} & (
33
+ | { readonly dismissMode: "swipe"; readonly onDismiss: () => void }
34
+ | { readonly dismissMode?: "button"; readonly onDismiss?: () => void }
35
+);
36
37
export function Toast(props: ToastProps) {
38
+ return props.dismissMode === "swipe" ? (
39
+ <SwipeableToast {...props} />
40
+ ) : (
41
+ <ToastContent {...props} />
42
+ );
43
+}
44
+
45
+function ToastContent(props: ToastProps & { readonly glassReady?: boolean }) {
46
const { fontScale } = useWindowDimensions();
23
- // A one-line message keeps its action on the same row. Descriptions and
24
- // accessibility text sizes need the full width, so the action moves below.
25
- const inlineAction = !props.description && fontScale < 1.5;
47
+ const { colorScheme } = useControlTheme();
48
+ const borderRadius = Platform.OS === "ios" ? 31 : MOBILE_SHAPE.toast;
49
+ // Explicit single-line notices reserve the action's width and truncate the text.
50
+ const inlineAction = props.singleLine || (!props.description && fontScale < 1.5);
51
+ const message =
52
+ props.singleLine && props.description
53
+ ? `${props.message}: ${props.description}`
54
+ : props.message;
55
const action = props.action ? (
56
<Button label={props.action.label} onPress={props.action.onPress} />
57
) : null;
58
useEffect(() => {
59
if (Platform.OS === "ios") AccessibilityInfo.announceForAccessibility(props.message);
60
}, [props.message]);
32
- return (
33
- <GlassSurface className="p-3" style={{ borderRadius: MOBILE_SHAPE.toast }}>
61
+ const surface = (
62
+ <GlassSurface
63
+ key={props.glassReady === false ? "entering" : "settled"}
64
+ chrome={Platform.OS === "ios" && colorScheme === "dark" ? "none" : undefined}
65
+ tintColor={Platform.OS === "ios" ? null : undefined}
66
+ className={Platform.OS === "ios" ? "bg-transparent p-3" : "p-3"}
67
+ style={{ borderRadius }}
68
+ >
69
<View className="flex-row items-center gap-3">
70
{props.busy ? (
71
<AppActivityIndicator />
@@ -44,21 +79,138 @@ export function Toast(props: ToastProps) {
79
/>
80
)}
81
<View className="min-w-0 flex-1" accessibilityLiveRegion="polite">
47
- <AppText textRole="footnote" className="font-t3-semibold">
48
- {props.message}
82
+ <AppText
83
+ textRole="footnote"
84
+ className="font-t3-semibold"
85
+ numberOfLines={props.singleLine ? 1 : undefined}
86
+ accessibilityLabel={props.singleLine ? message : undefined}
87
+ >
88
+ {message}
89
</AppText>
50
- {props.description ? (
90
+ {props.description && !props.singleLine ? (
91
<AppText textRole="label" className="text-foreground-muted">
92
{props.description}
93
</AppText>
94
) : null}
95
</View>
96
{inlineAction ? action : null}
57
- {props.onDismiss ? (
97
+ {props.onDismiss && props.dismissMode !== "swipe" ? (
98
<IconButton accessibilityLabel="Dismiss message" icon="xmark" onPress={props.onDismiss} />
99
) : null}
100
</View>
101
{action && !inlineAction ? <View className="mt-2 self-end">{action}</View> : null}
102
</GlassSurface>
103
);
104
+ return Platform.OS === "ios" ? (
105
+ <View
106
+ style={{
107
+ borderRadius,
108
+ boxShadow: [
109
+ {
110
+ offsetX: 0,
111
+ offsetY: 0,
112
+ blurRadius: 8,
113
+ color: colorScheme === "dark" ? "rgba(0, 0, 0, 0.22)" : "rgba(0, 0, 0, 0.08)",
114
+ },
115
+ ],
116
+ }}
117
+ >
118
+ {surface}
119
+ </View>
120
+ ) : (
121
+ surface
122
+ );
123
+}
124
+
125
+const SWIPE_TIMING = { duration: 160, reduceMotion: ReduceMotion.System };
126
+const ENTER_TIMING = {
127
+ duration: MOBILE_MOTION.enter,
128
+ easing: Easing.out(Easing.cubic),
129
+ reduceMotion: ReduceMotion.System,
130
+};
131
+const TOAST_EXITING = FadeOut.duration(MOBILE_MOTION.exit).reduceMotion(ReduceMotion.System);
132
+function SwipeableToast(props: ToastProps & { readonly onDismiss: () => void }) {
133
+ const [glassReady, setGlassReady] = useState(Platform.OS !== "ios");
134
+ const finishEntering = useCallback(() => setGlassReady(true), []);
135
+ // UIKit can skip glass on a moving host; remount the surface after entry so its blur installs.
136
+ const toastEntering = useMemo(
137
+ () => (values: EntryAnimationsValues) => {
138
+ "worklet";
139
+ return {
140
+ initialValues: { originY: values.targetOriginY + values.targetHeight + 12 },
141
+ animations: { originY: withTiming(values.targetOriginY, ENTER_TIMING) },
142
+ callback: (finished: boolean) => {
143
+ if (finished) runOnJS(finishEntering)();
144
+ },
145
+ };
146
+ },
147
+ [finishEntering],
148
+ );
149
+ const { onDismiss } = props;
150
+ const translation = useSharedValue(0);
151
+ const width = useSharedValue(0);
152
+ useLayoutEffect(
153
+ () => () => {
154
+ cancelAnimation(translation);
155
+ },
156
+ [translation],
157
+ );
158
+ const gesture = usePanGesture({
159
+ activeOffsetX: [-10, 10],
160
+ failOffsetY: [-12, 12],
161
+ onUpdate: (event) => {
162
+ translation.set(event.translationX);
163
+ },
164
+ onDeactivate: (event) => {
165
+ if (
166
+ !event.canceled &&
167
+ (Math.abs(event.translationX) > width.value * 0.25 ||
168
+ (Math.abs(event.velocityX) > 800 && event.translationX * event.velocityX > 0))
169
+ ) {
170
+ const direction = Math.sign(event.translationX || event.velocityX);
171
+ translation.set(
172
+ withTiming(direction * (width.value + 24), SWIPE_TIMING, (finished) => {
173
+ if (finished) runOnJS(onDismiss)();
174
+ }),
175
+ );
176
+ } else {
177
+ translation.set(withTiming(0, SWIPE_TIMING));
178
+ }
179
+ },
180
+ });
181
+ const animatedStyle = useAnimatedStyle(() => ({
182
+ transform: [{ translateX: translation.value }],
183
+ }));
184
+ return (
185
+ <Animated.View
186
+ className={Platform.OS === "android" ? "overflow-hidden" : undefined}
187
+ pointerEvents="box-none"
188
+ exiting={TOAST_EXITING}
189
+ onAccessibilityEscape={onDismiss}
190
+ onLayout={(event) => {
191
+ width.set(event.nativeEvent.layout.width);
192
+ }}
193
+ >
194
+ <GestureDetector gesture={gesture}>
195
+ <Animated.View collapsable={false} entering={toastEntering} style={animatedStyle}>
196
+ {Platform.OS === "android" ? (
197
+ // Keep the dismiss target separate so TalkBack can also focus the action button.
198
+ <View
199
+ accessible
200
+ accessibilityRole="alert"
201
+ accessibilityLiveRegion="assertive"
202
+ accessibilityLabel={props.message}
203
+ accessibilityActions={[{ name: "dismiss", label: "Dismiss message" }]}
204
+ onAccessibilityAction={({ nativeEvent }) => {
205
+ if (nativeEvent.actionName === "dismiss") onDismiss();
206
+ }}
207
+ pointerEvents="none"
208
+ style={StyleSheet.absoluteFill}
209
+ />
210
+ ) : null}
211
+ <ToastContent {...props} glassReady={glassReady} />
212
+ </Animated.View>
213
+ </GestureDetector>
214
+ </Animated.View>
215
+ );
216
}
apps/mobile/src/features/development/ComponentCatalogScreen.tsx
+25
-16
@@ -4,6 +4,7 @@ import { Progress } from "../../components/ui/Progress";
4
import { useNavigation } from "@react-navigation/native";
5
import { useRef, useState } from "react";
6
import { View, type TextInputInstance } from "react-native";
7
+import { useSafeAreaInsets } from "react-native-safe-area-context";
8
9
import { AppText, AppTextInput } from "../../components/ui/AppText";
10
import { Sheet } from "../../components/ui/Sheet";
@@ -34,6 +35,7 @@ const CHOICES = [
35
];
36
37
export function ComponentCatalogScreen() {
38
+ const insets = useSafeAreaInsets();
39
const navigation = useNavigation();
40
const appearance = useAppearancePreferences();
41
const [page, setPage] = useState("controls");
@@ -204,22 +206,7 @@ export function ComponentCatalogScreen() {
206
<View className="gap-3">
207
<AppText className="text-lg font-t3-semibold">Feedback and presentation</AppText>
208
<Notice message="This action could not finish. Try again." tone="danger" />
207
- {notice ? (
208
- <Toast
209
- message="Changes are ready to review."
210
- tone="success"
211
- action={{
212
- label: "Undo",
213
- onPress: () => {
214
- setNotice(false);
215
- setText("Restored example");
216
- },
217
- }}
218
- onDismiss={() => setNotice(false)}
219
- />
220
- ) : (
221
- <Button label="Show notice" onPress={announceAction} />
222
- )}
209
+ <Button label="Show notice" onPress={announceAction} />
210
<View className="flex-row flex-wrap gap-2">
211
<Button label="Sheet" onPress={() => setSheet(true)} />
212
<Button label="Dialog" onPress={confirm} />
@@ -275,6 +262,28 @@ export function ComponentCatalogScreen() {
262
</View>
263
) : null}
264
</ScreenScrollView>
265
+ {page === "feedback" && notice ? (
266
+ <View
267
+ collapsable={false}
268
+ className="absolute inset-x-3 z-[100]"
269
+ style={{ bottom: insets.bottom + 12 }}
270
+ pointerEvents="box-none"
271
+ >
272
+ <Toast
273
+ message="Changes are ready to review."
274
+ tone="success"
275
+ dismissMode="swipe"
276
+ action={{
277
+ label: "Undo",
278
+ onPress: () => {
279
+ setNotice(false);
280
+ setText("Restored example");
281
+ },
282
+ }}
283
+ onDismiss={() => setNotice(false)}
284
+ />
285
+ </View>
286
+ ) : null}
287
{sheet ? (
288
<Sheet title="Example sheet" onClose={() => setSheet(false)}>
289
<ScreenScrollView
apps/mobile/src/features/home/ThreadUndoNotice.android.tsx
deleted
-128
@@ -1,128 +0,0 @@
1
-import { useLayoutEffect, useState } from "react";
2
-import { StyleSheet, View } from "react-native";
3
-import { GestureDetector, usePanGesture } from "react-native-gesture-handler";
4
-import Animated, {
5
- cancelAnimation,
6
- Easing,
7
- FadeOut,
8
- ReduceMotion,
9
- runOnJS,
10
- useAnimatedStyle,
11
- useSharedValue,
12
- withTiming,
13
- type EntryAnimationsValues,
14
-} from "react-native-reanimated";
15
-import { useSafeAreaInsets } from "react-native-safe-area-context";
16
-import { Toast } from "../../components/ui/Toast";
17
-import { MOBILE_MOTION } from "../../lib/designTokens";
18
-import {
19
- dismissThreadUndoNotice,
20
- readThreadUndoNotice,
21
- useThreadUndoNotice,
22
-} from "./thread-undo-notice";
23
-
24
-const SWIPE_TIMING = { duration: 160, reduceMotion: ReduceMotion.System };
25
-const ENTER_TIMING = {
26
- duration: MOBILE_MOTION.enter,
27
- easing: Easing.out(Easing.cubic),
28
- reduceMotion: ReduceMotion.System,
29
-};
30
-const NOTICE_EXITING = FadeOut.duration(MOBILE_MOTION.exit).reduceMotion(ReduceMotion.System);
31
-const noticeEntering = (values: EntryAnimationsValues) => {
32
- "worklet";
33
- return {
34
- initialValues: { originY: values.targetOriginY + values.targetHeight + 12 },
35
- animations: { originY: withTiming(values.targetOriginY, ENTER_TIMING) },
36
- };
37
-};
38
-
39
-export function ThreadUndoNotice(props: { readonly visible: boolean }) {
40
- const notice = useThreadUndoNotice();
41
- // Replacing a notice must also cancel the native gesture tracking the old one.
42
- const [instance, setInstance] = useState({ notice, key: 0 });
43
- if (instance.notice !== notice) setInstance({ notice, key: instance.key + 1 });
44
- if (!props.visible || notice === null) return null;
45
- return <SwipeableUndoNotice key={instance.key} notice={notice} />;
46
-}
47
-
48
-function SwipeableUndoNotice(props: {
49
- readonly notice: NonNullable<ReturnType<typeof useThreadUndoNotice>>;
50
-}) {
51
- const { notice } = props;
52
- const insets = useSafeAreaInsets();
53
- const translation = useSharedValue(0);
54
- const width = useSharedValue(0);
55
-
56
- useLayoutEffect(
57
- () => () => {
58
- cancelAnimation(translation);
59
- },
60
- [translation],
61
- );
62
-
63
- const dismiss = () => {
64
- // A newer action can replace the notice while the swipe is animating out.
65
- if (readThreadUndoNotice() === notice) dismissThreadUndoNotice();
66
- };
67
- const gesture = usePanGesture({
68
- activeOffsetX: [-10, 10],
69
- failOffsetY: [-12, 12],
70
- onUpdate: (event) => {
71
- translation.set(event.translationX);
72
- },
73
- onDeactivate: (event) => {
74
- if (
75
- !event.canceled &&
76
- (Math.abs(event.translationX) > width.value * 0.25 ||
77
- (Math.abs(event.velocityX) > 800 && event.translationX * event.velocityX > 0))
78
- ) {
79
- const direction = Math.sign(event.translationX || event.velocityX);
80
- translation.set(
81
- withTiming(direction * (width.value + 24), SWIPE_TIMING, (finished) => {
82
- if (finished) runOnJS(dismiss)();
83
- }),
84
- );
85
- } else {
86
- translation.set(withTiming(0, SWIPE_TIMING));
87
- }
88
- },
89
- });
90
- const animatedStyle = useAnimatedStyle(() => ({
91
- transform: [{ translateX: translation.value }],
92
- }));
93
-
94
- // Clip the entrance above navigation; the notice intentionally covers the anchored FAB.
95
- return (
96
- <Animated.View
97
- className="absolute inset-x-3 z-[100] overflow-hidden"
98
- style={{ bottom: insets.bottom + 12 }}
99
- pointerEvents="box-none"
100
- exiting={NOTICE_EXITING}
101
- onLayout={(event) => {
102
- width.set(event.nativeEvent.layout.width);
103
- }}
104
- >
105
- <GestureDetector gesture={gesture}>
106
- <Animated.View collapsable={false} entering={noticeEntering} style={animatedStyle}>
107
- {/* Keep the dismiss target separate so TalkBack can also focus Undo. */}
108
- <View
109
- accessible
110
- accessibilityRole="alert"
111
- accessibilityLiveRegion="assertive"
112
- accessibilityLabel={`${notice.action} thread`}
113
- accessibilityActions={[{ name: "dismiss", label: "Dismiss message" }]}
114
- onAccessibilityAction={({ nativeEvent }) => {
115
- if (nativeEvent.actionName === "dismiss") dismiss();
116
- }}
117
- pointerEvents="none"
118
- style={StyleSheet.absoluteFill}
119
- />
120
- <Toast
121
- message={`${notice.action} thread`}
122
- action={{ label: "Undo", onPress: () => void notice.undo() }}
123
- />
124
- </Animated.View>
125
- </GestureDetector>
126
- </Animated.View>
127
- );
128
-}
apps/mobile/src/features/home/ThreadUndoNotice.tsx
+69
-6
@@ -1,17 +1,76 @@
1
-import { View } from "react-native";
1
+import { useState } from "react";
2
+import { useKeyboardState } from "react-native-keyboard-controller";
3
+import { Platform, View } from "react-native";
4
import { useSafeAreaInsets } from "react-native-safe-area-context";
5
import { Toast } from "../../components/ui/Toast";
4
-import { APP_BAR_HEIGHT } from "../../lib/layoutMetrics";
5
-import { dismissThreadUndoNotice, useThreadUndoNotice } from "./thread-undo-notice";
6
+import {
7
+ useDeviceType,
8
+ useDuoBottomBarInset,
9
+ useNativeLayoutMetrics,
10
+ useNativeColumnLayoutMetrics,
11
+} from "../../native/native-layout-metrics";
12
+import { workspaceSearchBottomClearance } from "../workspace/workspace-tabs-state";
13
+import { useWorkspaceTabs } from "../workspace/WorkspaceTabsContext";
14
+import {
15
+ dismissThreadUndoNotice,
16
+ readThreadUndoNotice,
17
+ useThreadUndoNotice,
18
+} from "./thread-undo-notice";
19
20
export function ThreadUndoNotice(props: { readonly visible: boolean }) {
21
const notice = useThreadUndoNotice();
22
const insets = useSafeAreaInsets();
23
+ const columnMetrics = useNativeColumnLayoutMetrics();
24
+ const rootMetrics = useNativeLayoutMetrics();
25
+ const workspace = useWorkspaceTabs();
26
+ const deviceType = useDeviceType();
27
+ const keyboardHeight = useKeyboardState((keyboard) => keyboard.height);
28
+ const horizontalInsets =
29
+ Platform.OS === "ios"
30
+ ? deviceType === "phone"
31
+ ? { left: 29, right: 23 }
32
+ : { left: 20, right: 20 }
33
+ : { left: 12, right: 12 };
34
+ // The Duo's native tab pill extends above the 48-point toolbar reservation.
35
+ const workspacePadding =
36
+ useDuoBottomBarInset() === undefined
37
+ ? deviceType === "phone" && keyboardHeight === 0
38
+ ? 32
39
+ : 16
40
+ : 8;
41
+ // Replacing a notice must also cancel the native gesture tracking the old one.
42
+ const [instance, setInstance] = useState({ notice, key: 0 });
43
+ if (instance.notice !== notice) setInstance({ notice, key: instance.key + 1 });
44
if (!props.visible || notice === null) return null;
45
+ const foldedResting =
46
+ rootMetrics?.hasHinge &&
47
+ rootMetrics.horizontalSizeClass === "compact" &&
48
+ workspace?.state.tabs.threads.searchMode === "resting";
49
+ const bottom =
50
+ Platform.OS === "ios"
51
+ ? foldedResting
52
+ ? Math.max(rootMetrics.safeArea.bottom, keyboardHeight) + 8
53
+ : rootMetrics?.hasHinge && rootMetrics.verticalBarEdge !== "none"
54
+ ? // The column's safe area already includes UIKit's search toolbar in this posture.
55
+ workspaceSearchBottomClearance({
56
+ bottomInset: rootMetrics.safeArea.bottom,
57
+ bottomBarInset: rootMetrics.bottomBarInset,
58
+ keyboardHeight,
59
+ }) -
60
+ 16 +
61
+ 8
62
+ : Math.max(
63
+ insets.bottom,
64
+ columnMetrics?.safeArea.bottom ?? 0,
65
+ (workspace?.bottomClearance ?? 0) - workspacePadding,
66
+ ) + 8
67
+ : insets.bottom + 12;
68
return (
69
<View
13
- className="absolute inset-x-3 z-[100]"
14
- style={{ top: insets.top + APP_BAR_HEIGHT + 8 }}
70
+ key={instance.key}
71
+ collapsable={false}
72
+ className="absolute z-[100]"
73
+ style={{ bottom, ...horizontalInsets }}
74
pointerEvents="box-none"
75
>
76
<Toast
@@ -22,7 +81,11 @@ export function ThreadUndoNotice(props: { readonly visible: boolean }) {
81
void notice.undo();
82
},
83
}}
25
- onDismiss={dismissThreadUndoNotice}
84
+ dismissMode="swipe"
85
+ onDismiss={() => {
86
+ // A newer action can replace the notice while the swipe is animating out.
87
+ if (readThreadUndoNotice() === notice) dismissThreadUndoNotice();
88
+ }}
89
/>
90
</View>
91
);
apps/mobile/src/features/threads/GitActionProgressOverlay.tsx
+14
-6
@@ -1,10 +1,13 @@
1
import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
2
import { tryOpenExternalUrl } from "../../lib/openExternalUrl";
3
import * as Haptics from "expo-haptics";
4
-import { useEffect, useRef } from "react";
4
+import { HeaderHeightContext } from "@react-navigation/elements";
5
+import { useContext, useEffect, useRef } from "react";
6
+import { Platform } from "react-native";
7
import Animated, { FadeIn, FadeOut, ReduceMotion } from "react-native-reanimated";
8
import { useSafeAreaInsets } from "react-native-safe-area-context";
9
import { Toast } from "../../components/ui/Toast";
10
+import { useToolbarLayout } from "../../components/ui/useToolbarLayout";
11
import { MOBILE_MOTION } from "../../lib/designTokens";
12
import { APP_BAR_HEIGHT } from "../../lib/layoutMetrics";
13
import type { GitActionProgress } from "../../state/use-vcs-action-state";
@@ -17,6 +20,13 @@ export function GitActionProgressOverlay(props: {
20
const { progress, onDismiss } = props;
21
const openPullRequest = props.onOpenPullRequest;
22
const insets = useSafeAreaInsets();
23
+ // Keyboard-copy feedback sits outside the screen's native header context.
24
+ const headerHeight = useContext(HeaderHeightContext) ?? insets.top + APP_BAR_HEIGHT;
25
+ const toolbar = useToolbarLayout();
26
+ const top =
27
+ Platform.OS === "android"
28
+ ? toolbar.paddingTop + toolbar.height + toolbar.paddingBottom + 8
29
+ : headerHeight + 8;
30
const prevPhaseRef = useRef(progress.phase);
31
32
useEffect(() => {
@@ -37,9 +47,6 @@ export function GitActionProgressOverlay(props: {
47
: tryOpenExternalUrl(progress.prUrl, "pull-request"));
48
return;
49
}
40
- if (progress.phase === "success" || progress.phase === "error") {
41
- onDismiss();
42
- }
50
};
51
52
if (progress.phase === "idle") {
@@ -56,10 +63,12 @@ export function GitActionProgressOverlay(props: {
63
entering={FadeIn.duration(MOBILE_MOTION.enter).reduceMotion(ReduceMotion.System)}
64
exiting={FadeOut.duration(MOBILE_MOTION.exit).reduceMotion(ReduceMotion.System)}
65
className="absolute inset-x-3 z-[100]"
59
- style={{ top: insets.top + APP_BAR_HEIGHT + 8 }}
66
+ style={{ top }}
67
pointerEvents="box-none"
68
+ onAccessibilityEscape={onDismiss}
69
>
70
<Toast
71
+ singleLine
72
message={progress.label ?? "Source control"}
73
description={progress.description ?? undefined}
74
tone={
@@ -71,7 +80,6 @@ export function GitActionProgressOverlay(props: {
80
}
81
busy={progress.phase === "running"}
82
action={openLabel ? { label: openLabel, onPress: handlePress } : undefined}
74
- onDismiss={progress.phase === "running" ? undefined : onDismiss}
83
/>
84
</Animated.View>
85
);