Skip to content

Commit 9c80bd3

Browse files
committed
fix(mobile): keep Android thread title spacing consistent
1 parent 9826dbb commit 9c80bd3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/mobile/src/features/threads/thread-list-v2-items.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
635635
const metadataTypography = useScaledTextRole("label");
636636
const projectIconSize = titleTypography.fontSize * 1.25 * fontScale;
637637
const machineIconSize = metadataTypography.fontSize * fontScale;
638-
const titleLineHeight = titleTypography.lineHeight * fontScale;
638+
// Android's nonlinear system text scaling can differ from the fontScale estimate.
639+
const [titleLineHeight, setTitleLineHeight] = useState(titleTypography.lineHeight * fontScale);
639640
const {
640641
thread,
641642
variant,
@@ -1062,6 +1063,10 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
10621063
: rowAppearance.foregroundClassName,
10631064
)}
10641065
numberOfLines={2}
1066+
onTextLayout={({ nativeEvent }) => {
1067+
const firstLine = nativeEvent.lines[0];
1068+
if (firstLine) setTitleLineHeight(firstLine.height);
1069+
}}
10651070
>
10661071
{thread.title}
10671072
</Text>

0 commit comments

Comments
 (0)