diff --git a/apps/mobile/src/features/threads/thread-list-v2-items.tsx b/apps/mobile/src/features/threads/thread-list-v2-items.tsx index 74704ef116354..84e9494759cad 100644 --- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx +++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx @@ -364,11 +364,22 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props readonly simultaneousSwipeGesture?: ComponentProps["simultaneousWith"]; }) { const { pendingTask, onSelectPendingTask, onDeletePendingTask } = props; - const { width: windowWidth } = useWindowDimensions(); + const { width: windowWidth, fontScale } = useWindowDimensions(); + const titleTypography = useScaledTextRole("body"); + const metadataTypography = useScaledTextRole("label"); + const projectIconSize = titleTypography.fontSize * 1.25 * fontScale; + const machineIconSize = metadataTypography.fontSize * fontScale; + // Android's nonlinear system text scaling can differ from the fontScale estimate. + const [androidTitleLineHeight, setTitleLineHeight] = useState( + titleTypography.lineHeight * fontScale, + ); + const titleLineHeight = + Platform.OS === "android" ? androidTitleLineHeight : titleTypography.lineHeight * fontScale; const dormant = useSwipeRowDormant(props.activationKey); const theme = useUniwindTheme(); const sidebarPane = props.pane === "sidebar"; - const rowAppearance = getThreadListV2RowAppearance(theme, sidebarPane, props.selected ?? false); + const selected = props.selected ?? false; + const rowAppearance = getThreadListV2RowAppearance(theme, sidebarPane, selected); const isDraft = pendingTask.kind === "draft"; const deleteLabel = isDraft ? "Discard" : "Delete"; const handleDelete = useCallback( @@ -416,72 +427,112 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props [onDeletePendingTask, pendingTask], ); + const titleTextInset = props.project ? projectIconSize + 8 : 0; const rowContent = ( <> - + {props.project ? ( - + + + ) : null} { + const firstLine = nativeEvent.lines[0]; + if (firstLine && Math.abs(firstLine.height - titleLineHeight) > 0.5) { + setTitleLineHeight(firstLine.height); + } + } + : undefined + } > - {projectTitle} + {pendingTask.title} {isDraft ? ( - + - Draft + + Draft + - ) : ( + ) : null} + + {!isDraft ? ( + Sends on reconnect - )} - - - {pendingTask.title} - + + ) : null} {branch || props.environmentLabel ? ( - + + {props.environmentLabel && props.environmentMachine ? ( + + ) : null} {branch ? ( @@ -492,23 +543,16 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props {props.environmentLabel ? ( {props.environmentLabel} ) : null} - {props.environmentLabel && props.environmentMachine ? ( - - ) : null} ) : null} @@ -562,8 +606,8 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props rowContent ) : ( - {rowContent} - {props.showTrailingDivider !== false ? ( + {rowContent} + {THREAD_LIST_V2_ROW_DIVIDERS && props.showTrailingDivider !== false ? ( ) : null}