The best way to control Claude Code, Codex and more from any computer or phone
feat(mobile): add thread title regeneration (#6253)
Chris Deeming committed
Aug 12, 2026 at 02:43 UTC
d37a9b09b8ea6b014e9ea2d6b00d9b25cde0efc6
9 files changed
+223
-11
apps/mobile/src/features/home/HomeRouteScreen.tsx
+2
@@ -45,6 +45,7 @@ export function HomeRouteScreen() {
45
pinThread,
46
unpinThread,
47
movePinnedThread,
48
+ regenerateThreadTitle,
49
unsettleThread,
50
} = useThreadListActions();
51
const pendingTasks = usePendingNewTasks();
@@ -186,6 +187,7 @@ export function HomeRouteScreen() {
187
onPinThread={pinThread}
188
onUnpinThread={unpinThread}
189
onMovePinnedThread={movePinnedThread}
190
+ onRegenerateThreadTitle={regenerateThreadTitle}
191
onEnvironmentChange={setSelectedEnvironmentId}
192
onProjectChange={setSelectedProjectKey}
193
onOpenSettings={() =>
apps/mobile/src/features/home/HomeScreen.tsx
+24
@@ -115,6 +115,7 @@ interface HomeScreenProps {
115
thread: EnvironmentThreadShell,
116
direction: "up" | "down",
117
) => Promise<boolean>;
118
+ readonly onRegenerateThreadTitle: (thread: EnvironmentThreadShell) => Promise<boolean>;
119
readonly onSelectPendingTask: (pendingTask: PendingNewTask) => void;
120
readonly onDeletePendingTask: (pendingTask: PendingNewTask) => void;
121
readonly onNewThreadInProject: (project: EnvironmentProject) => void;
@@ -538,6 +539,12 @@ export function HomeScreen(props: HomeScreenProps) {
539
},
540
[props.onUnpinThread],
541
);
542
+ const handleRegenerateThreadTitle = useCallback(
543
+ (thread: EnvironmentThreadShell) => {
544
+ void props.onRegenerateThreadTitle(thread);
545
+ },
546
+ [props.onRegenerateThreadTitle],
547
+ );
548
const handleDeleteThread = props.onDeleteThread;
549
const handleUnsettleThread = props.onUnsettleThread;
550
// The settled tail renders in pages; expansion resets when the filter
@@ -615,6 +622,15 @@ export function HomeScreen(props: HomeScreenProps) {
622
}
623
return supported;
624
}, [serverConfigs]);
625
+ const titleRegenerationEnvironmentIds = useMemo(() => {
626
+ const supported = new Set<EnvironmentId>();
627
+ for (const [environmentId, config] of serverConfigs) {
628
+ if (config.environment.capabilities.threadTitleRegeneration === true) {
629
+ supported.add(environmentId);
630
+ }
631
+ }
632
+ return supported;
633
+ }, [serverConfigs]);
634
// Canonical arranged pinned order (reorder-capable threads only) for the
635
// Move up/down position flags. Computed from all shells, not the rendered
636
// list, so search/scope filtering never disables or misdirects a move.
@@ -811,6 +827,8 @@ export function HomeScreen(props: HomeScreenProps) {
827
onSelectThread={props.onSelectThread}
828
onDeleteThread={handleDeleteThread}
829
onArchiveThread={props.onArchiveThread}
830
+ onRegenerateThreadTitle={handleRegenerateThreadTitle}
831
+ titleRegenerationSupported={titleRegenerationEnvironmentIds.has(thread.environmentId)}
832
settlementSupported={settlementEnvironmentIds.has(thread.environmentId)}
833
onSettleThread={handleSettleThread}
834
snoozeSupported={snoozeEnvironmentIds.has(thread.environmentId)}
@@ -842,6 +860,7 @@ export function HomeScreen(props: HomeScreenProps) {
860
arrangedPinnedKeys,
861
handleMovePinnedThread,
862
handlePinThread,
863
+ handleRegenerateThreadTitle,
864
handleSettleThread,
865
handleSnoozeThread,
866
handleUnpinThread,
@@ -863,6 +882,7 @@ export function HomeScreen(props: HomeScreenProps) {
882
snoozeEnvironmentIds,
883
threadListV2Items,
884
threadSearchMatchByKey,
885
+ titleRegenerationEnvironmentIds,
886
toggleSettledShelf,
887
toggleSnoozedShelf,
888
v2ProjectTitleByProjectKey,
@@ -967,6 +987,8 @@ export function HomeScreen(props: HomeScreenProps) {
987
searchQuery={props.searchQuery}
988
onArchiveThread={props.onArchiveThread}
989
onDeleteThread={props.onDeleteThread}
990
+ onRegenerateThreadTitle={handleRegenerateThreadTitle}
991
+ titleRegenerationSupported={titleRegenerationEnvironmentIds.has(thread.environmentId)}
992
onSelectThread={props.onSelectThread}
993
onSwipeableClose={handleSwipeableClose}
994
onSwipeableWillOpen={handleSwipeableWillOpen}
@@ -988,6 +1010,7 @@ export function HomeScreen(props: HomeScreenProps) {
1010
[
1011
handleSwipeableClose,
1012
handleSwipeableWillOpen,
1013
+ handleRegenerateThreadTitle,
1014
projectCwdByKey,
1015
props.onArchiveThread,
1016
props.onDeletePendingTask,
@@ -998,6 +1021,7 @@ export function HomeScreen(props: HomeScreenProps) {
1021
props.searchQuery,
1022
props.savedConnectionsById,
1023
threadSearchMatchByKey,
1024
+ titleRegenerationEnvironmentIds,
1025
updateGroupDisplay,
1026
],
1027
);
apps/mobile/src/features/home/useThreadListActions.ts
+56
@@ -48,6 +48,15 @@ function environmentSupportsPinReorder(environmentId: EnvironmentThreadShell["en
48
);
49
}
50
51
+function environmentSupportsTitleRegeneration(
52
+ environmentId: EnvironmentThreadShell["environmentId"],
53
+) {
54
+ return (
55
+ appAtomRegistry.get(environmentServerConfigsAtom).get(environmentId)?.environment.capabilities
56
+ .threadTitleRegeneration === true
57
+ );
58
+}
59
+
60
type ThreadListAction = "archive" | "unarchive" | "delete" | "settle" | "unsettle";
61
62
const ACTION_VERBS: Record<ThreadListAction, string> = {
@@ -227,13 +236,18 @@ export function useThreadListActions(): {
236
thread: EnvironmentThreadShell,
237
direction: "up" | "down",
238
) => Promise<boolean>;
239
+ readonly regenerateThreadTitle: (thread: EnvironmentThreadShell) => Promise<boolean>;
240
} {
241
const executeAction = useThreadActionExecutor();
242
const snoozeMutation = useAtomCommand(threadEnvironment.snooze, { reportFailure: false });
243
const unsnoozeMutation = useAtomCommand(threadEnvironment.unsnooze, { reportFailure: false });
244
const pinMutation = useAtomCommand(threadEnvironment.pin, { reportFailure: false });
245
const unpinMutation = useAtomCommand(threadEnvironment.unpin, { reportFailure: false });
246
+ const updateThreadMetadata = useAtomCommand(threadEnvironment.updateMetadata, {
247
+ reportFailure: false,
248
+ });
249
const snoozeInFlightThreadKeys = useRef(new Set<string>());
250
+ const titleRegenerationInFlightThreadKeys = useRef(new Set<string>());
251
252
const archiveThread = useCallback(
253
(thread: EnvironmentThreadShell) => {
@@ -405,6 +419,47 @@ export function useThreadListActions(): {
419
},
420
[unpinMutation],
421
);
422
+ const regenerateThreadTitle = useCallback(
423
+ async (thread: EnvironmentThreadShell) => {
424
+ const key = scopedThreadKey(thread.environmentId, thread.id);
425
+ if (
426
+ thread.titleRegeneration != null ||
427
+ titleRegenerationInFlightThreadKeys.current.has(key)
428
+ ) {
429
+ return false;
430
+ }
431
+ if (!environmentSupportsTitleRegeneration(thread.environmentId)) {
432
+ Alert.alert(
433
+ "Could not regenerate title",
434
+ "This environment's server does not support title regeneration yet. Update the server to regenerate thread titles.",
435
+ );
436
+ return false;
437
+ }
438
+
439
+ titleRegenerationInFlightThreadKeys.current.add(key);
440
+ selectionHaptic();
441
+ try {
442
+ const result = await updateThreadMetadata({
443
+ environmentId: thread.environmentId,
444
+ input: { threadId: thread.id, regenerateTitle: true },
445
+ });
446
+ if (result._tag === "Failure") {
447
+ const error = Cause.squash(result.cause);
448
+ Alert.alert(
449
+ "Could not regenerate title",
450
+ error instanceof Error && error.message.trim().length > 0
451
+ ? error.message
452
+ : "The thread title could not be regenerated.",
453
+ );
454
+ return false;
455
+ }
456
+ return true;
457
+ } finally {
458
+ titleRegenerationInFlightThreadKeys.current.delete(key);
459
+ }
460
+ },
461
+ [updateThreadMetadata],
462
+ );
463
464
// Move up / Move down for the pinned block. Computed against the CANONICAL
465
// keyed pinned order (not the rendered list), so the move is valid even
@@ -497,6 +552,7 @@ export function useThreadListActions(): {
552
pinThread,
553
unpinThread,
554
movePinnedThread,
555
+ regenerateThreadTitle,
556
};
557
}
558
apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
+16
@@ -211,6 +211,7 @@ function ThreadNavigationSidebarPane(
211
pinThread,
212
unpinThread,
213
movePinnedThread,
214
+ regenerateThreadTitle,
215
} = useThreadListActions();
216
const threadListV2Enabled = useThreadListV2Enabled();
217
const pendingTasks = usePendingNewTasks();
@@ -505,6 +506,15 @@ function ThreadNavigationSidebarPane(
506
}
507
return supported;
508
}, [serverConfigs]);
509
+ const titleRegenerationEnvironmentIds = useMemo(() => {
510
+ const supported = new Set<EnvironmentId>();
511
+ for (const [environmentId, config] of serverConfigs) {
512
+ if (config.environment.capabilities.threadTitleRegeneration === true) {
513
+ supported.add(environmentId);
514
+ }
515
+ }
516
+ return supported;
517
+ }, [serverConfigs]);
518
// Canonical arranged pinned order for Move up/down flags — computed from
519
// all shells so search/scope filtering never disables a valid move.
520
const arrangedPinnedKeys = useMemo(() => {
@@ -950,6 +960,8 @@ function ThreadNavigationSidebarPane(
960
onSelectThread={handleSelectThread}
961
onDeleteThread={confirmDeleteThread}
962
onArchiveThread={archiveThread}
963
+ onRegenerateThreadTitle={regenerateThreadTitle}
964
+ titleRegenerationSupported={titleRegenerationEnvironmentIds.has(thread.environmentId)}
965
settlementSupported={settlementEnvironmentIds.has(thread.environmentId)}
966
onSettleThread={settleThread}
967
snoozeSupported={snoozeEnvironmentIds.has(thread.environmentId)}
@@ -1067,6 +1079,8 @@ function ThreadNavigationSidebarPane(
1079
fullSwipeWidth={props.width - 20}
1080
onArchiveThread={archiveThread}
1081
onDeleteThread={confirmDeleteThread}
1082
+ onRegenerateThreadTitle={regenerateThreadTitle}
1083
+ titleRegenerationSupported={titleRegenerationEnvironmentIds.has(thread.environmentId)}
1084
onSelectThread={handleSelectThread}
1085
onSwipeableClose={handleSwipeableClose}
1086
onSwipeableWillOpen={handleSwipeableWillOpen}
@@ -1103,6 +1117,7 @@ function ThreadNavigationSidebarPane(
1117
projectByKey,
1118
projectCwdByKey,
1119
projectTitleByProjectKey,
1120
+ regenerateThreadTitle,
1121
props.onNewThreadInProject,
1122
props.searchQuery,
1123
props.selectedThreadKey,
@@ -1110,6 +1125,7 @@ function ThreadNavigationSidebarPane(
1125
savedConnectionsById,
1126
serverConfigs,
1127
threadSearchMatchByKey,
1128
+ titleRegenerationEnvironmentIds,
1129
settleThread,
1130
settlementEnvironmentIds,
1131
showMoreSettled,
apps/mobile/src/features/threads/thread-list-items.tsx
+23
-3
@@ -22,6 +22,7 @@ import type { PendingNewTask } from "../../state/use-pending-new-tasks";
22
import { useThreadPr, type ThreadPr } from "../../state/use-thread-pr";
23
import type { HomeGroupDisplayAction } from "../home/homeListItems";
24
import { ThreadSwipeable } from "../home/thread-swipe-actions";
25
+import { buildThreadTitleRegenerationMenuItems } from "./thread-title-regeneration-menu";
26
import { resolveThreadStatus } from "./threadPresentation";
27
import { ThreadSearchMatchExcerpt } from "./thread-search-match";
28
@@ -430,6 +431,8 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
431
readonly onSelectThread: (thread: EnvironmentThreadShell) => void;
432
readonly onArchiveThread: (thread: EnvironmentThreadShell) => void;
433
readonly onDeleteThread: (thread: EnvironmentThreadShell) => void;
434
+ readonly onRegenerateThreadTitle: (thread: EnvironmentThreadShell) => void;
435
+ readonly titleRegenerationSupported: boolean;
436
readonly onSwipeableWillOpen: (methods: SwipeableMethods) => void;
437
readonly onSwipeableClose: (methods: SwipeableMethods) => void;
438
readonly simultaneousSwipeGesture?: ComponentProps<
@@ -451,7 +454,8 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
454
const pressedBackgroundColor = useThemeColor("--color-subtle");
455
const selectedBackgroundColor = useThemeColor("--color-user-bubble");
456
454
- const { thread, onSelectThread, onArchiveThread, onDeleteThread } = props;
457
+ const { thread, onSelectThread, onArchiveThread, onDeleteThread, onRegenerateThreadTitle } =
458
+ props;
459
const status = resolveThreadStatus(thread);
460
const pr = useThreadPr(thread, props.projectCwd);
461
const timestamp = relativeTime(
@@ -471,6 +475,21 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
475
476
const handleDelete = useCallback(() => onDeleteThread(thread), [onDeleteThread, thread]);
477
const handleArchive = useCallback(() => onArchiveThread(thread), [onArchiveThread, thread]);
478
+ const handleRegenerateTitle = useCallback(
479
+ () => onRegenerateThreadTitle(thread),
480
+ [onRegenerateThreadTitle, thread],
481
+ );
482
+ const menuActions = useMemo<MenuAction[]>(
483
+ () => [
484
+ THREAD_ROW_MENU_ACTIONS[0]!,
485
+ ...buildThreadTitleRegenerationMenuItems({
486
+ supported: props.titleRegenerationSupported,
487
+ isRegenerating: thread.titleRegeneration != null,
488
+ }),
489
+ THREAD_ROW_MENU_ACTIONS[1]!,
490
+ ],
491
+ [props.titleRegenerationSupported, thread.titleRegeneration],
492
+ );
493
const primaryAction = useMemo(
494
() => ({
495
accessibilityLabel: `Archive ${thread.title}`,
@@ -483,9 +502,10 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
502
const handleMenuAction = useCallback(
503
({ nativeEvent }: { readonly nativeEvent: { readonly event: string } }) => {
504
if (nativeEvent.event === "archive") handleArchive();
505
+ if (nativeEvent.event === "regenerate-title") handleRegenerateTitle();
506
if (nativeEvent.event === "delete") handleDelete();
507
},
488
- [handleArchive, handleDelete],
508
+ [handleArchive, handleDelete, handleRegenerateTitle],
509
);
510
511
const statusPill = effectiveStatus ? (
@@ -674,7 +694,7 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
694
// ControlPillMenu injects onLongPress into the row and anchors the
695
// token-styled dropdown to it; taps and swipes are untouched.
696
<ControlPillMenu
677
- actions={THREAD_ROW_MENU_ACTIONS}
697
+ actions={menuActions}
698
onPressAction={handleMenuAction}
699
shouldOpenOnLongPress
700
>
apps/mobile/src/features/threads/thread-list-v2-items.tsx
+45
-8
@@ -27,6 +27,7 @@ import { useThemeColor } from "../../lib/useThemeColor";
27
import type { PendingNewTask } from "../../state/use-pending-new-tasks";
28
import { useThreadPr } from "../../state/use-thread-pr";
29
import { ThreadSwipeable } from "../home/thread-swipe-actions";
30
+import { buildThreadTitleRegenerationMenuItems } from "./thread-title-regeneration-menu";
31
import {
32
resolveThreadListV2SnoozeMenuSelection,
33
resolveThreadListV2SnoozeGateExpiryMs,
@@ -65,8 +66,8 @@ function threadTimeLabel(thread: EnvironmentThreadShell): string {
66
return relativeTime(thread.latestUserMessageAt ?? thread.updatedAt ?? thread.createdAt);
67
}
68
68
-// Menus stay lifecycle-focused: settle/un-settle plus delete. Archive keeps
69
-// its own surface (thread screen / settings) rather than crowding the row.
69
+// Menus keep lifecycle and title regeneration together. Archive keeps its
70
+// own surface (thread screen / settings) rather than crowding v2 rows.
71
const CARD_MENU_ACTIONS: MenuAction[] = [
72
{ id: "settle", title: "Settle", image: "checkmark" },
73
{ id: "delete", title: "Delete", image: "trash", attributes: { destructive: true } },
@@ -341,6 +342,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
342
readonly fullSwipeWidth?: number;
343
readonly onSelectThread: (thread: EnvironmentThreadShell) => void;
344
readonly onDeleteThread: (thread: EnvironmentThreadShell) => void;
345
+ readonly onRegenerateThreadTitle: (thread: EnvironmentThreadShell) => void;
346
readonly onSettleThread: (thread: EnvironmentThreadShell) => void;
347
readonly onSnoozeThread: (thread: EnvironmentThreadShell, snoozedUntil: string) => void;
348
readonly onUnsnoozeThread: (thread: EnvironmentThreadShell) => void;
@@ -355,6 +357,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
357
readonly snoozeSupported: boolean;
358
/** False on servers that predate thread.pin/unpin. */
359
readonly pinningSupported: boolean;
360
+ /** False on servers that predate thread title regeneration. */
361
+ readonly titleRegenerationSupported: boolean;
362
/** False on servers that predate thread.pin.reorder. Gates the pinned
363
Move up / Move down menu items. */
364
readonly pinReorderSupported?: boolean;
@@ -384,6 +388,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
388
variant,
389
onSelectThread,
390
onDeleteThread,
391
+ onRegenerateThreadTitle,
392
onSettleThread,
393
onSnoozeThread,
394
onUnsnoozeThread,
@@ -417,6 +422,10 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
422
const timeLabel = threadTimeLabel(thread);
423
424
const handleDelete = useCallback(() => onDeleteThread(thread), [onDeleteThread, thread]);
425
+ const handleRegenerateTitle = useCallback(
426
+ () => onRegenerateThreadTitle(thread),
427
+ [onRegenerateThreadTitle, thread],
428
+ );
429
const handleSettle = useCallback(() => onSettleThread(thread), [onSettleThread, thread]);
430
const handleSnooze = useCallback(
431
(snoozedUntil: string) => onSnoozeThread(thread, snoozedUntil),
@@ -506,6 +515,14 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
515
props.pinningSupported,
516
],
517
);
518
+ const titleRegenerationMenuItems = useMemo<MenuAction[]>(
519
+ () =>
520
+ buildThreadTitleRegenerationMenuItems({
521
+ supported: props.titleRegenerationSupported,
522
+ isRegenerating: thread.titleRegeneration != null,
523
+ }),
524
+ [props.titleRegenerationSupported, thread.titleRegeneration],
525
+ );
526
const snoozableCardMenuActions = useMemo<MenuAction[]>(
527
() => [
528
{ id: "settle", title: "Settle", image: "checkmark" },
@@ -516,13 +533,31 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
533
subactions: snoozePresetActions,
534
},
535
...pinMenuItem,
536
+ ...titleRegenerationMenuItems,
537
{ id: "delete", title: "Delete", image: "trash", attributes: { destructive: true } },
538
],
521
- [pinMenuItem, snoozePresetActions],
539
+ [pinMenuItem, snoozePresetActions, titleRegenerationMenuItems],
540
);
541
const cardMenuActions = useMemo<MenuAction[]>(
524
- () => [CARD_MENU_ACTIONS[0]!, ...pinMenuItem, ...CARD_MENU_ACTIONS.slice(1)],
525
- [pinMenuItem],
542
+ () => [
543
+ CARD_MENU_ACTIONS[0]!,
544
+ ...pinMenuItem,
545
+ ...titleRegenerationMenuItems,
546
+ ...CARD_MENU_ACTIONS.slice(1),
547
+ ],
548
+ [pinMenuItem, titleRegenerationMenuItems],
549
+ );
550
+ const slimMenuActions = useMemo<MenuAction[]>(
551
+ () => [SLIM_MENU_ACTIONS[0]!, ...titleRegenerationMenuItems, SLIM_MENU_ACTIONS[1]!],
552
+ [titleRegenerationMenuItems],
553
+ );
554
+ const snoozedMenuActions = useMemo<MenuAction[]>(
555
+ () => [SNOOZED_MENU_ACTIONS[0]!, ...titleRegenerationMenuItems, SNOOZED_MENU_ACTIONS[1]!],
556
+ [titleRegenerationMenuItems],
557
+ );
558
+ const legacyMenuActions = useMemo<MenuAction[]>(
559
+ () => [LEGACY_MENU_ACTIONS[0]!, ...titleRegenerationMenuItems, LEGACY_MENU_ACTIONS[1]!],
560
+ [titleRegenerationMenuItems],
561
);
562
const handleMenuAction = useCallback(
563
({ nativeEvent }: { readonly nativeEvent: { readonly event: string } }) => {
@@ -534,6 +569,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
569
if (nativeEvent.event === "move-pin-up") handleMovePinnedUp();
570
if (nativeEvent.event === "move-pin-down") handleMovePinnedDown();
571
if (nativeEvent.event === "archive") handleArchive();
572
+ if (nativeEvent.event === "regenerate-title") handleRegenerateTitle();
573
if (nativeEvent.event === "delete") handleDelete();
574
const snoozeSelection = resolveThreadListV2SnoozeMenuSelection({
575
event: nativeEvent.event,
@@ -549,6 +585,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
585
[
586
handleArchive,
587
handleDelete,
588
+ handleRegenerateTitle,
589
handleMovePinnedDown,
590
handleMovePinnedUp,
591
handlePin,
@@ -890,11 +927,11 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
927
<ControlPillMenu
928
actions={
929
snoozedRow
893
- ? SNOOZED_MENU_ACTIONS
930
+ ? snoozedMenuActions
931
: !props.settlementSupported
895
- ? LEGACY_MENU_ACTIONS
932
+ ? legacyMenuActions
933
: canUnsettle
897
- ? SLIM_MENU_ACTIONS
934
+ ? slimMenuActions
935
: swipeActions.secondary === "snooze"
936
? snoozableCardMenuActions
937
: cardMenuActions
apps/mobile/src/features/threads/thread-title-regeneration-menu.test.ts
new
+36
@@ -0,0 +1,36 @@
1
+import { describe, expect, it } from "vite-plus/test";
2
+
3
+import { buildThreadTitleRegenerationMenuItems } from "./thread-title-regeneration-menu";
4
+
5
+describe("buildThreadTitleRegenerationMenuItems", () => {
6
+ it("hides regeneration when the environment does not advertise support", () => {
7
+ expect(
8
+ buildThreadTitleRegenerationMenuItems({ supported: false, isRegenerating: false }),
9
+ ).toEqual([]);
10
+ });
11
+
12
+ it("offers regeneration for a supported environment", () => {
13
+ expect(
14
+ buildThreadTitleRegenerationMenuItems({ supported: true, isRegenerating: false }),
15
+ ).toEqual([
16
+ {
17
+ id: "regenerate-title",
18
+ title: "Regenerate title",
19
+ image: "arrow.clockwise",
20
+ },
21
+ ]);
22
+ });
23
+
24
+ it("shows and disables the pending state", () => {
25
+ expect(
26
+ buildThreadTitleRegenerationMenuItems({ supported: true, isRegenerating: true }),
27
+ ).toEqual([
28
+ {
29
+ id: "regenerate-title",
30
+ title: "Regenerating…",
31
+ image: "arrow.clockwise",
32
+ attributes: { disabled: true },
33
+ },
34
+ ]);
35
+ });
36
+});
apps/mobile/src/features/threads/thread-title-regeneration-menu.ts
new
+17
@@ -0,0 +1,17 @@
1
+import type { MenuAction } from "@react-native-menu/menu";
2
+
3
+export function buildThreadTitleRegenerationMenuItems(input: {
4
+ readonly supported: boolean;
5
+ readonly isRegenerating: boolean;
6
+}): MenuAction[] {
7
+ if (!input.supported) return [];
8
+
9
+ return [
10
+ {
11
+ id: "regenerate-title",
12
+ title: input.isRegenerating ? "Regenerating…" : "Regenerate title",
13
+ image: "arrow.clockwise",
14
+ ...(input.isRegenerating ? { attributes: { disabled: true } } : {}),
15
+ },
16
+ ];
17
+}
docs/user/thread-sidebar.md
+4
@@ -18,3 +18,7 @@ Dev and Nightly environments can identify themselves with artwork at the top of
18
the send button. Choose **Artwork**, **Version pill**, or **None** in Settings under environment
19
identification. Artwork is recolored to match each built-in theme. Custom themes use the **Version
20
pill** fallback because their colors are not controlled by T3 Code.
21
+
22
+To generate a fresh title from the conversation, open a thread's context menu and choose
23
+**Regenerate title**. While T3 Code is generating it, the action reads **Regenerating…** and cannot
24
+be selected again. The option is hidden when the connected environment needs a server update.