@devries-cameron20 / t3code-1 / commits / 96505418e6
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): give drafts the current thread card layout (#28789)

Alex committed Nov 1, 2026 at 13:46 UTC 96505418e6e5756c705d0d11adc48a0d5df2a921
1 file changed +94 -50
apps/mobile/src/features/threads/thread-list-v2-items.tsx
+94 -50
@@ -364,11 +364,22 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
364 readonly simultaneousSwipeGesture?: ComponentProps<typeof ThreadSwipeable>["simultaneousWith"];
365 }) {
366 const { pendingTask, onSelectPendingTask, onDeletePendingTask } = props;
367 - const { width: windowWidth } = useWindowDimensions();
367 + const { width: windowWidth, fontScale } = useWindowDimensions();
368 + const titleTypography = useScaledTextRole("body");
369 + const metadataTypography = useScaledTextRole("label");
370 + const projectIconSize = titleTypography.fontSize * 1.25 * fontScale;
371 + const machineIconSize = metadataTypography.fontSize * fontScale;
372 + // Android's nonlinear system text scaling can differ from the fontScale estimate.
373 + const [androidTitleLineHeight, setTitleLineHeight] = useState(
374 + titleTypography.lineHeight * fontScale,
375 + );
376 + const titleLineHeight =
377 + Platform.OS === "android" ? androidTitleLineHeight : titleTypography.lineHeight * fontScale;
378 const dormant = useSwipeRowDormant(props.activationKey);
379 const theme = useUniwindTheme();
380 const sidebarPane = props.pane === "sidebar";
371 - const rowAppearance = getThreadListV2RowAppearance(theme, sidebarPane, props.selected ?? false);
381 + const selected = props.selected ?? false;
382 + const rowAppearance = getThreadListV2RowAppearance(theme, sidebarPane, selected);
383 const isDraft = pendingTask.kind === "draft";
384 const deleteLabel = isDraft ? "Discard" : "Delete";
385 const handleDelete = useCallback(
@@ -416,72 +427,112 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
427 [onDeletePendingTask, pendingTask],
428 );
429
430 + const titleTextInset = props.project ? projectIconSize + 8 : 0;
431 const rowContent = (
432 <>
421 - <View className="flex-row items-center gap-1.5">
433 + <View className="flex-row items-start gap-2">
434 {props.project ? (
423 - <ProjectFavicon
424 - environmentId={pendingTask.environmentId}
425 - faviconPath={props.project.faviconPath}
426 - projectIcon={props.project.projectIcon}
427 - size={15}
428 - projectTitle={props.project.title}
429 - workspaceRoot={props.project.workspaceRoot}
430 - />
435 + <View className="justify-center" style={{ height: titleLineHeight }}>
436 + <ProjectFavicon
437 + environmentId={pendingTask.environmentId}
438 + faviconPath={props.project.faviconPath}
439 + projectIcon={props.project.projectIcon}
440 + size={projectIconSize}
441 + projectTitle={projectTitle}
442 + workspaceRoot={props.project.workspaceRoot}
443 + />
444 + </View>
445 ) : null}
446 <Text
447 className={cn(
434 - "flex-1 text-sm font-t3-medium text-foreground-muted",
435 - sidebarPane && "text-drawer-foreground-muted",
448 + "flex-1 text-base font-t3-medium",
449 + selected
450 + ? selectedThreadRowColors.foregroundClassName
451 + : rowAppearance.foregroundClassName,
452 )}
437 - numberOfLines={1}
453 + numberOfLines={2}
454 + onTextLayout={
455 + Platform.OS === "android"
456 + ? ({ nativeEvent }) => {
457 + const firstLine = nativeEvent.lines[0];
458 + if (firstLine && Math.abs(firstLine.height - titleLineHeight) > 0.5) {
459 + setTitleLineHeight(firstLine.height);
460 + }
461 + }
462 + : undefined
463 + }
464 >
439 - {projectTitle}
465 + {pendingTask.title}
466 </Text>
467 {isDraft ? (
442 - <View className="flex-row items-center gap-1">
468 + <View className="flex-row items-center gap-1" style={{ minHeight: titleLineHeight }}>
469 <SymbolView
470 name="square.and.pencil"
445 - size={10}
446 - tintColorClassName="accent-adaptive-amber-700-300"
471 + size={13}
472 + tintColorClassName={
473 + selected
474 + ? selectedThreadRowColors.iconTintClassName
475 + : "accent-adaptive-amber-700-300"
476 + }
477 type="monochrome"
478 + weight="semibold"
479 />
449 - <Text className="text-xs text-adaptive-amber-700-300">Draft</Text>
480 + <Text
481 + className={cn(
482 + "text-xs font-t3-bold",
483 + selected
484 + ? selectedThreadRowColors.foregroundClassName
485 + : "text-adaptive-amber-700-300",
486 + )}
487 + >
488 + Draft
489 + </Text>
490 </View>
451 - ) : (
491 + ) : null}
492 + </View>
493 + {!isDraft ? (
494 + <View className="mt-1" style={{ paddingLeft: titleTextInset }}>
495 <Text
496 className={cn(
454 - "text-xs text-foreground-tertiary",
455 - sidebarPane && "text-drawer-foreground-muted",
497 + "text-xs",
498 + selected
499 + ? selectedThreadRowColors.foregroundClassName
500 + : rowAppearance.tertiaryForegroundClassName,
501 )}
502 >
503 Sends on reconnect
504 </Text>
460 - )}
461 - </View>
462 - <Text
463 - className={cn(
464 - "mt-1 text-base font-t3-medium text-foreground",
465 - sidebarPane && "text-drawer-foreground",
466 - )}
467 - numberOfLines={1}
468 - >
469 - {pendingTask.title}
470 - </Text>
505 + </View>
506 + ) : null}
507 {branch || props.environmentLabel ? (
472 - <View className="mt-1 flex-row items-center gap-1">
508 + <View className="mt-1 flex-row items-center gap-1" style={{ paddingLeft: titleTextInset }}>
509 + {props.environmentLabel && props.environmentMachine ? (
510 + <EnvironmentMachineSymbol
511 + kind={props.environmentMachine}
512 + size={machineIconSize}
513 + tintColorClassName={
514 + selected
515 + ? selectedThreadRowColors.mutedIconTintClassName
516 + : rowAppearance.tertiaryIconTintClassName
517 + }
518 + />
519 + ) : null}
520 <Text
521 className={cn(
522 "shrink text-xs text-foreground-muted",
476 - sidebarPane && "text-drawer-foreground-muted",
523 + selected
524 + ? selectedThreadRowColors.mutedForegroundClassName
525 + : rowAppearance.mutedForegroundClassName,
526 )}
527 numberOfLines={1}
528 >
529 {branch ? (
530 <Text
531 className={cn(
483 - "text-xs text-foreground-muted",
484 - sidebarPane && "text-drawer-foreground-muted",
532 + "text-xs",
533 + selected
534 + ? selectedThreadRowColors.mutedForegroundClassName
535 + : rowAppearance.mutedForegroundClassName,
536 )}
537 style={{ fontFamily: MONO_FONT }}
538 >
@@ -492,23 +543,16 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
543 {props.environmentLabel ? (
544 <Text
545 className={cn(
495 - "text-xs text-foreground-tertiary",
496 - sidebarPane && "text-drawer-foreground-muted",
546 + "text-xs",
547 + selected
548 + ? selectedThreadRowColors.mutedForegroundClassName
549 + : rowAppearance.tertiaryForegroundClassName,
550 )}
551 >
552 {props.environmentLabel}
553 </Text>
554 ) : null}
555 </Text>
503 - {props.environmentLabel && props.environmentMachine ? (
504 - <EnvironmentMachineSymbol
505 - kind={props.environmentMachine}
506 - size={11}
507 - tintColorClassName={
508 - sidebarPane ? "accent-drawer-foreground-muted" : "accent-foreground-tertiary"
509 - }
510 - />
511 - ) : null}
556 </View>
557 ) : null}
558 </>
@@ -562,8 +606,8 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
606 rowContent
607 ) : (
608 <View>
565 - <View className="px-5 py-2.5">{rowContent}</View>
566 - {props.showTrailingDivider !== false ? (
609 + <View className={THREAD_LIST_V2_ROW_CONTENT_CLASS_NAME}>{rowContent}</View>
610 + {THREAD_LIST_V2_ROW_DIVIDERS && props.showTrailingDivider !== false ? (
611 <View className="ml-5 h-px bg-border-subtle" />
612 ) : null}
613 </View>