@devries-cameron20 / t3code Mirror · read-only / commits / 81e9368c4a
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 21, 22:15 UTC

fix(mobile): swipe action labels stay whole at larger Android text sizes (#27335)

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

Julius Marminge committed Nov 11, 2026 at 12:00 UTC 81e9368c4a7a3c4aa9a05d3460736775d89da511
1 file changed +21 -3
apps/mobile/src/features/home/thread-swipe-actions.tsx
+21 -3
@@ -21,7 +21,7 @@ import type {
21 StyleProp,
22 ViewStyle,
23 } from "react-native";
24 -import { Pressable, View } from "react-native";
24 +import { Platform, Pressable, View, useWindowDimensions } from "react-native";
25 import ReanimatedSwipeable, {
26 type SwipeableMethods,
27 } from "react-native-gesture-handler/ReanimatedSwipeable";
@@ -41,6 +41,7 @@ import Animated, {
41 } from "react-native-reanimated";
42
43 import { AppText as Text } from "../../components/ui/AppText";
44 +import { useScaledTextRole } from "../settings/appearance/useScaledTextRole";
45 import { SwipeRowActivationContext, type SwipeRowActivation } from "./swipe-row-activation";
46 import { registerThreadDismissal } from "./thread-dismissal";
47
@@ -49,6 +50,8 @@ const ACTION_CIRCLE_SIZE = 36;
50 const ACTION_ICON_SIZE = 15;
51 const COMPACT_ACTION_CIRCLE_SIZE = 28;
52 const COMPACT_ACTION_ICON_SIZE = 13;
53 +// At the default app text size, "Unarchive", the longest label, fills its slot at about 1.12x.
54 +const ACTION_LABEL_MAX_FONT_SCALE = 1.1;
55
56 const THREAD_SWIPE_ACTIONS_WIDTH = ACTION_ITEM_WIDTH * 2;
57 const THREAD_SWIPE_SPRING = {
@@ -545,6 +548,15 @@ function SwipeActionButton(props: {
548 } = props;
549 const circleSize = props.compact ? COMPACT_ACTION_CIRCLE_SIZE : ACTION_CIRCLE_SIZE;
550 const iconSize = props.compact ? COMPACT_ACTION_ICON_SIZE : ACTION_ICON_SIZE;
551 + const { fontScale } = useWindowDimensions();
552 + const labelLineHeight = useScaledTextRole("micro").lineHeight;
553 + // Android scales lineHeight by the full font scale, past maxFontSizeMultiplier.
554 + const labelTextStyle = {
555 + lineHeight:
556 + Platform.OS === "android" && fontScale > ACTION_LABEL_MAX_FONT_SCALE
557 + ? (labelLineHeight * ACTION_LABEL_MAX_FONT_SCALE) / fontScale
558 + : labelLineHeight,
559 + };
560 const actionStyle = useAnimatedStyle(() => {
561 const reveal = Math.max(-translation.value, 0);
562 const entryProgress = interpolate(
@@ -674,13 +686,19 @@ function SwipeActionButton(props: {
686 />
687 </Animated.View>
688 </View>
689 + {/* An offset, not padding: padding would grow the box and move the circle at 1x. */}
690 <Animated.View
691 style={[
679 - { height: 14, justifyContent: "center", paddingTop: props.compact ? 0 : 2 },
692 + { justifyContent: "center", minHeight: 14, top: props.compact ? 0 : 2 },
693 labelStyle,
694 ]}
695 >
683 - <Text className="text-3xs font-t3-medium text-foreground-muted" numberOfLines={1}>
696 + <Text
697 + className="text-3xs font-t3-medium text-foreground-muted"
698 + maxFontSizeMultiplier={ACTION_LABEL_MAX_FONT_SCALE}
699 + numberOfLines={1}
700 + style={labelTextStyle}
701 + >
702 {props.label}
703 </Text>
704 </Animated.View>