@@ -731,7 +731,7 @@ ${sysPrompt}` }], max_tokens: 20, temperature: 0.2 }) });
731731} ;
732732const threadRow = ( t ) => {
733733 const icon = t . type === "folder" ? "folder" : t . type === "file" ? "file-text" : "" ;
734- return `<div class="relative flex items-center gap-2 px-3 py-2 ${ t . pinned ? "bg-yellow-50" : "" } "><button data-open-thread="${ t . id } " data-type="${ t . type || "thread" } " class="flex-1 text-left truncate flex items-center gap-2">${ icon ? `<i data-lucide="${ icon } " class="h-4 w-4"></i>` : "" } ${ t . pinned ? "📌 " : "" } ${ esc ( t . title || "Untitled" ) } ${ t . status === "modified" ? "*" : t . status === "new" ? "+" : "" } </button><button data-thread-menu="${ t . id } " class="h-8 w-8 rounded hover:bg-gray-100 flex items-center justify-center" title="More"><i data-lucide="more-horizontal" class="h-4 w-4"></i></button></div>` ;
734+ return `<div class="relative flex items-center gap-2 px-3 py-2 ${ t . pinned ? "bg-yellow-50" : "" } "><button data-open-thread="${ t . id } " data-type="${ t . type || "thread" } " class="flex-1 text-left truncate flex items-center gap-2">${ icon ? `<i data-lucide="${ icon } " class="h-4 w-4"></i>` : "" } ${ t . pinned ? "📌 " : "" } ${ esc ( t . title || "Untitled" ) } ${ t . status === "modified" ? "*" : t . status === "new" ? "+" : "" } </button>${ t . type === "file" ? "" : ` <button data-thread-menu="${ t . id } " class="h-8 w-8 rounded hover:bg-gray-100 flex items-center justify-center" title="More"><i data-lucide="more-horizontal" class="h-4 w-4"></i></button>` } </div>` ;
735735} ;
736736let sortedThreads = [ ] , isAddingThreads = false ;
737737const THREAD_PAGE_SIZE = 50 ;
@@ -776,7 +776,14 @@ $(el.threadList).on("click", async (e) => {
776776 const u2 = el . threadRepoInput . value . trim ( ) ;
777777 if ( u2 . startsWith ( "gh://" ) ) {
778778 const info = parseGhUrl ( u2 ) ;
779- window . open ( `https://github.com/${ info . owner } /${ info . repo } /blob/${ info . branch } /${ id } ` , "_blank" ) ;
779+ try {
780+ await navigator . clipboard . writeText ( `${ info . owner } /${ info . repo } /${ id } ` ) ;
781+ const old = openBtn . innerHTML ;
782+ openBtn . innerHTML = '<i data-lucide="check" class="h-4 w-4 text-green-500"></i> Copied Path' ;
783+ icons ( ) ;
784+ setTimeout ( ( ) => ( openBtn . innerHTML = old , icons ( ) ) , 1200 ) ;
785+ } catch {
786+ }
780787 }
781788 return ;
782789 }
@@ -899,16 +906,6 @@ $(el.threadPopover).on("click", async (e) => {
899906 } else if ( act === "export" ) {
900907 const msgs = await localforage . getItem ( prefix + th . id ) || [ ] ;
901908 dl ( `thread-${ ( th . title || "thread" ) . replace ( / \W / g, "_" ) } -${ ts ( ) } .json` , { ...th , messages : msgs } ) ;
902- } else if ( act === "copy_path" ) {
903- const u2 = el . threadRepoInput . value . trim ( ) ;
904- if ( u2 . startsWith ( "gh://" ) ) {
905- const info = parseGhUrl ( u2 ) ;
906- try {
907- await navigator . clipboard . writeText ( th . type === "file" ? th . id : `${ info . owner } /${ info . repo } /${ th . id } ` ) ;
908- alert ( "Path copied" ) ;
909- } catch {
910- }
911- }
912909 }
913910 hideThreadPopover ( ) ;
914911 await THREAD . save ( ) ;
0 commit comments