@@ -31,7 +31,7 @@ import { canSnooze } from "@t3tools/client-runtime/state/thread-settled";
3131import { threadChipCopyTarget } from "@t3tools/client-runtime/thread-reference" ;
3232import type { MenuAction } from "@react-native-menu/menu" ;
3333import { 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" ;
3535import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable" ;
3636
3737import type { ThreadListProvider } from "../../state/thread-list-environments" ;
@@ -637,7 +637,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
637637 const metadataTypography = useScaledTextRole ( "label" ) ;
638638 const projectIconSize = titleTypography . fontSize * 1.25 * fontScale ;
639639 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 ;
641646 const {
642647 thread,
643648 variant,
@@ -1079,6 +1084,16 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
10791084 isRegeneratingTitle && "opacity-55" ,
10801085 ) }
10811086 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+ }
10821097 >
10831098 { thread . title }
10841099 </ Text >
0 commit comments