diff --git a/apps/mobile/src/features/threads/thread-list-items.tsx b/apps/mobile/src/features/threads/thread-list-items.tsx index b9d4dd50d29d8d407c54d68c90dd56b706d15bfe..5ab2251875ce88fbf2f4d07b4e45d73ce792030d 100644 --- a/apps/mobile/src/features/threads/thread-list-items.tsx +++ b/apps/mobile/src/features/threads/thread-list-items.tsx @@ -18,6 +18,7 @@ import { ControlPillMenu } from "../../components/ControlPill"; import { EnvironmentMachineSymbol } from "../../components/EnvironmentMachineSymbol"; import { ProjectFavicon } from "../../components/ProjectFavicon"; import { cn } from "../../lib/cn"; +import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic"; import { HOME_HORIZONTAL_INSET } from "../../lib/layoutMetrics"; import { relativeTime } from "../../lib/time"; import { useUniwindTheme } from "../../lib/useUniwindTheme"; @@ -547,6 +548,7 @@ export const ThreadListRow = memo(function ThreadListRow(props: { : []), THREAD_ROW_MENU_ACTIONS[0]!, THREAD_ROW_MENU_ACTIONS[1]!, + { id: "copy-thread-id", title: "Copy thread ID", image: "doc.on.doc" }, ...buildThreadTitleRegenerationMenuItems({ supported: props.titleRegenerationSupported, isRegenerating: thread.titleRegeneration != null, @@ -569,6 +571,9 @@ export const ThreadListRow = memo(function ThreadListRow(props: { if (nativeEvent.event === "new-thread-on-branch") onNewThreadOnBranch(thread); if (nativeEvent.event === "archive") handleArchive(); if (nativeEvent.event === "rename") handleRename(); + if (nativeEvent.event === "copy-thread-id") { + copyTextWithHaptic(thread.id, { target: "thread-id" }); + } if (nativeEvent.event === "regenerate-title") handleRegenerateTitle(); if (nativeEvent.event === "delete") handleDelete(); }, 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 fa406271198f12ab4a330b31a679d7a8241e32ff..a1b16ee21ffd8a9b930b78de07dcf45b5534bdfc 100644 --- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx +++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx @@ -24,6 +24,7 @@ import { ProjectFavicon } from "../../components/ProjectFavicon"; import { ProviderInstanceIcon } from "../../components/ProviderIcon"; import type { ThreadRowProviderInstance } from "./thread-provider-instance"; import { cn } from "../../lib/cn"; +import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic"; import { relativeTime } from "../../lib/time"; import { useUniwindTheme } from "../../lib/useUniwindTheme"; import type { PendingNewTask } from "../../state/use-pending-new-tasks"; @@ -670,6 +671,9 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { if (nativeEvent.event === "archive") handleArchive(); if (nativeEvent.event === "rename") handleRename(); if (nativeEvent.event === "regenerate-title") handleRegenerateTitle(); + if (nativeEvent.event === "copy-thread-id") { + copyTextWithHaptic(thread.id, { target: "thread-id" }); + } if (nativeEvent.event === "delete") handleDelete(); if (nativeEvent.event === "snooze:custom") { setCustomSnoozeOpen(true); @@ -1165,6 +1169,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { }, ] : []), + { id: "copy-thread-id", title: "Copy thread ID", image: "doc.on.doc" }, ...(snoozedRow ? snoozedMenuActions : !props.settlementSupported