TypeScript
fix(mobile): thread rows show when a title is regenerating (#26835)
Alex Southwell1d690b4804c0
diff --git a/apps/mobile/src/features/threads/thread-list-v2-items.tsx b/apps/mobile/src/features/threads/thread-list-v2-items.tsxindex 5b0c1fd2f52..3951ffef8ca 100644--- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx+++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx@@ -695,6 +695,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {? { ...workingLabel, label: "Goal" }: workingLabel) ?? (isUnread ? DONE_STATUS_LABEL : undefined);const recede = shouldRecedeThreadRow({ status, selected });+ const isRegeneratingTitle = thread.titleRegeneration != null;+ const rowAccessibilityLabel = `${thread.title}${props.hasQueuedMessages ? ", messages queued to send" : ""}${isRegeneratingTitle ? ", regenerating title" : ""}`;const timeLabel = props.timeLabel;const visitThread = useAtomCommand(threadEnvironment.visit, { reportFailure: false });@@ -845,7 +847,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {{ id: "rename", title: "Rename", image: "square.and.pencil" },...buildThreadTitleRegenerationMenuItems({supported: props.titleRegenerationSupported,- isRegenerating: thread.titleRegeneration != null,+ isRegenerating: isRegeneratingTitle,}),...(canTurnIntoProject? [@@ -858,12 +860,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {]: []),],- [- canTurnIntoProject,- props.titleRegenerationSupported,- thread.runtime,- thread.titleRegeneration,- ],+ [canTurnIntoProject, props.titleRegenerationSupported, thread.runtime, isRegeneratingTitle],);const snoozableCardMenuActions = useMemo<MenuAction[]>(() => [@@ -1079,6 +1076,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {selected? selectedThreadRowColors.foregroundClassName: rowAppearance.foregroundClassName,+ isRegeneratingTitle && "opacity-55",)}numberOfLines={2}>@@ -1299,9 +1297,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {interactionOpacity={rowAppearance.interactionOpacity}className={rowAppearance.className}accessibilityHint={swipeAccessibilityHint}- accessibilityLabel={- props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title- }+ accessibilityLabel={rowAccessibilityLabel}accessibilityRole="button"accessibilityState={{ selected }}accessibilityActions={rowAccessibilityActions}@@ -1332,9 +1328,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {interactionClassName={rowAppearance.interactionClassName}interactionOpacity={rowAppearance.interactionOpacity}accessibilityHint={swipeAccessibilityHint}- accessibilityLabel={- props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title- }+ accessibilityLabel={rowAccessibilityLabel}accessibilityRole="button"accessibilityState={{ selected }}className={rowAppearance.className}@@ -1370,6 +1364,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {selected? selectedThreadRowColors.foregroundClassName: rowAppearance.mutedForegroundClassName,+ isRegeneratingTitle && "opacity-55",)}numberOfLines={1}>