Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): add Copy Thread ID to the sidebar and chat header thread context menu #5574

MergedUtkarshUsername(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/5574/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 4 changed files with 26 additions and 2 deletions (loading 1).

x
0 of 4 viewed, 4 left
23 additions and 1 deletionapps/web/src/components/Sidebar.tsxModified
View file
@@ -29,7 +29,7 @@
scopeThreadRef,
scopedThreadKey,
} from "@t3tools/client-runtime/environment";
-import type { ScopedThreadRef } from "@t3tools/contracts";
+import type { ScopedThreadRef, ThreadId } from "@t3tools/contracts";
import type { TimestampFormat } from "@t3tools/contracts/settings";
import {
AlarmClockIcon,
@@ -1647,6 +1647,24 @@
+ const { copyToClipboard: copyThreadIdToClipboard } = useCopyToClipboard<{ threadId: ThreadId }>({
+ onCopy: ({ threadId }) => {
+ toastManager.add({
+ type: "success",
+ title: "Thread ID copied",
+ description: threadId,
+ });
+ },
+ onError: (error) => {
+ toastManager.add(
+ stackedThreadToast({
+ type: "error",
+ title: "Failed to copy thread ID",
+ description: error instanceof Error ? error.message : "An error occurred.",
+ }),
+ );