@devries-cameron20 / t3code Mirror · read-only / commits / f6503f0e71
Fork 0

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, 07:00 UTC

fix(mobile): shorten the iOS undo toast and balance its insets (#29775)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

shivam committed Nov 3, 2026 at 06:29 UTC f6503f0e717f5d577a897149b4ceeb3d1bf00b3a
2 files changed +18 -5
apps/mobile/src/components/ui/Button.tsx
+3 -1
@@ -14,6 +14,7 @@ export interface ButtonProps {
14 readonly loading?: boolean;
15 readonly tone?: "primary" | "secondary" | "danger" | "text" | "contrast";
16 readonly fullWidth?: boolean;
17 + readonly size?: "default" | "compact";
18 }
19
20 const TONE_CLASS_NAMES = {
@@ -36,7 +37,8 @@ export function Button(props: ButtonProps) {
37 disabled={disabled}
38 onPress={props.onPress}
39 className={cn(
39 - "min-h-12 flex-row items-center justify-center gap-2 rounded-full px-6 active:opacity-70",
40 + "flex-row items-center justify-center gap-2 rounded-full active:opacity-70",
41 + props.size === "compact" ? "min-h-10 px-5" : "min-h-12 px-6",
42 props.fullWidth ? "w-full" : "self-start",
43 disabled ? "bg-subtle-strong" : containerClassName,
44 )}
apps/mobile/src/components/ui/Toast.tsx
+15 -4
@@ -1,3 +1,4 @@
1 +import { cn } from "../../lib/cn";
2 import { MOBILE_MOTION, MOBILE_SHAPE } from "../../lib/designTokens";
3 import { useCallback, useEffect, useLayoutEffect, useState } from "react";
4 import { AccessibilityInfo, Platform, StyleSheet, View, useWindowDimensions } from "react-native";
@@ -45,7 +46,7 @@ export function Toast(props: ToastProps) {
46 function ToastContent(props: ToastProps & { readonly glassReady?: boolean }) {
47 const { fontScale } = useWindowDimensions();
48 const { colorScheme } = useControlTheme();
48 - const borderRadius = Platform.OS === "ios" ? 31 : MOBILE_SHAPE.toast;
49 + const borderRadius = Platform.OS === "ios" ? 28 : MOBILE_SHAPE.toast;
50 // Explicit single-line notices reserve the action's width and truncate the text.
51 const inlineAction = props.singleLine || (!props.description && fontScale < 1.5);
52 const message =
@@ -53,7 +54,11 @@ function ToastContent(props: ToastProps & { readonly glassReady?: boolean }) {
54 ? `${props.message}: ${props.description}`
55 : props.message;
56 const action = props.action ? (
56 - <Button label={props.action.label} onPress={props.action.onPress} />
57 + <Button
58 + label={props.action.label}
59 + onPress={props.action.onPress}
60 + size={Platform.OS === "ios" ? "compact" : "default"}
61 + />
62 ) : null;
63 // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- announces the toast message to VoiceOver through AccessibilityInfo
64 useEffect(() => {
@@ -64,10 +69,16 @@ function ToastContent(props: ToastProps & { readonly glassReady?: boolean }) {
69 key={props.glassReady === false ? "entering" : "settled"}
70 chrome={Platform.OS === "ios" && colorScheme === "dark" ? "none" : undefined}
71 tintColor={Platform.OS === "ios" ? null : undefined}
67 - className={Platform.OS === "ios" ? "bg-transparent p-3" : "p-3"}
72 + className={Platform.OS === "ios" ? "bg-transparent p-2" : "p-3"}
73 style={{ borderRadius }}
74 >
70 - <View className="flex-row items-center gap-3">
75 + <View
76 + className={cn(
77 + "flex-row items-center gap-3",
78 + // Match the leading inset to the action label's, which sits inside the button's padding.
79 + Platform.OS === "ios" && inlineAction && action && "pl-5",
80 + )}
81 + >
82 {props.busy ? (
83 <AppActivityIndicator />
84 ) : (