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, 09:30 UTC
fix(mobile): keep Android thread title spacing consistent (#26666)
Co-authored-by: maria-rcks <maria@kuuro.net>
Alex committed
Oct 31, 2026 at 19:07 UTC
6f2e48da3875173272a458497b65cc7cda705c5b
1 file changed
+17
-2
apps/mobile/src/features/threads/thread-list-v2-items.tsx
+17
-2
@@ -31,7 +31,7 @@ import { canSnooze } from "@t3tools/client-runtime/state/thread-settled";
31
import { threadChipCopyTarget } from "@t3tools/client-runtime/thread-reference";
32
import type { MenuAction } from "@react-native-menu/menu";
33
import { memo, useCallback, useMemo, useState, type ComponentProps } from "react";
34
-import { Pressable, useWindowDimensions, View } from "react-native";
34
+import { Platform, Pressable, useWindowDimensions, View } from "react-native";
35
import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable";
36
37
import type { ThreadListProvider } from "../../state/thread-list-environments";
@@ -637,7 +637,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
637
const metadataTypography = useScaledTextRole("label");
638
const projectIconSize = titleTypography.fontSize * 1.25 * fontScale;
639
const machineIconSize = metadataTypography.fontSize * fontScale;
640
- const titleLineHeight = titleTypography.lineHeight * fontScale;
640
+ // Android's nonlinear system text scaling can differ from the fontScale estimate.
641
+ const [androidTitleLineHeight, setTitleLineHeight] = useState(
642
+ titleTypography.lineHeight * fontScale,
643
+ );
644
+ const titleLineHeight =
645
+ Platform.OS === "android" ? androidTitleLineHeight : titleTypography.lineHeight * fontScale;
646
const {
647
thread,
648
variant,
@@ -1079,6 +1084,16 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
1084
isRegeneratingTitle && "opacity-55",
1085
)}
1086
numberOfLines={2}
1087
+ onTextLayout={
1088
+ Platform.OS === "android"
1089
+ ? ({ nativeEvent }) => {
1090
+ const firstLine = nativeEvent.lines[0];
1091
+ if (firstLine && Math.abs(firstLine.height - titleLineHeight) > 0.5) {
1092
+ setTitleLineHeight(firstLine.height);
1093
+ }
1094
+ }
1095
+ : undefined
1096
+ }
1097
>
1098
{thread.title}
1099
</Text>