feat(mobile): add copy thread ID to thread list actions (#12228)
This commit is contained in:
1 parent
818add08fc
commit
7a2cce8268
2 files changed
+10
No files matched your search
@@ -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();
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user