@@ -11,7 +11,7 @@ import {
1111 effectiveSnoozed ,
1212 type ChangeRequestStateLike ,
1313} from "@t3tools/client-runtime/state/thread-settled" ;
14- import type { ScopedThreadRef } from "@t3tools/contracts" ;
14+ import type { ScopedThreadRef , ThreadId } from "@t3tools/contracts" ;
1515import { useCallback } from "react" ;
1616
1717import { resolveSnoozePresets , snoozeWakeDescription } from "../components/Sidebar.snooze" ;
@@ -95,6 +95,12 @@ export function useThreadActionMenu(input: {
9595 } ,
9696 onError : ( error ) => failureToast ( "Failed to copy branch" , error ) ,
9797 } ) ;
98+ const { copyToClipboard : copyThreadIdToClipboard } = useCopyToClipboard < { threadId : ThreadId } > ( {
99+ onCopy : ( { threadId } ) => {
100+ toastManager . add ( { type : "success" , title : "Thread ID copied" , description : threadId } ) ;
101+ } ,
102+ onError : ( error ) => failureToast ( "Failed to copy thread ID" , error ) ,
103+ } ) ;
98104
99105 const openMenu = useCallback (
100106 ( position : { x : number ; y : number } ) => {
@@ -242,6 +248,9 @@ export function useThreadActionMenu(input: {
242248 copyBranchToClipboard ( thread . branch , { branch : thread . branch } ) ;
243249 }
244250 return ;
251+ case "copy-thread-id" :
252+ copyThreadIdToClipboard ( thread . id , { threadId : thread . id } ) ;
253+ return ;
245254 case "delete" : {
246255 if ( confirmThreadDelete ) {
247256 const confirmed = await settlePromise ( ( ) =>
@@ -279,6 +288,7 @@ export function useThreadActionMenu(input: {
279288 confirmThreadDelete ,
280289 copyBranchToClipboard ,
281290 copyPathToClipboard ,
291+ copyThreadIdToClipboard ,
282292 deleteThread ,
283293 handleNewThread ,
284294 markThreadUnread ,
0 commit comments