@@ -1585,12 +1585,16 @@ ${contents}
15851585
15861586 context . subscriptions . push (
15871587 vscode . commands . registerCommand ( 'pr.copyPrLink' , async ( params : OverviewContext | undefined ) => {
1588- let pr : PullRequestModel | undefined ;
1588+ let item : PullRequestModel | IssueModel | undefined ;
15891589 if ( params ) {
1590- pr = await reposManager . getManagerForRepository ( params . owner , params . repo ) ?. resolvePullRequest ( params . owner , params . repo , params . number , true ) ;
1590+ const folderManager = reposManager . getManagerForRepository ( params . owner , params . repo ) ;
1591+ item = await folderManager ?. resolvePullRequest ( params . owner , params . repo , params . number , true ) ;
1592+ if ( ! item ) {
1593+ item = await folderManager ?. resolveIssue ( params . owner , params . repo , params . number ) ;
1594+ }
15911595 }
1592- if ( pr ) {
1593- return vscode . env . clipboard . writeText ( pr . html_url ) ;
1596+ if ( item ) {
1597+ return vscode . env . clipboard . writeText ( item . html_url ) ;
15941598 }
15951599 } ) ) ;
15961600
@@ -1768,20 +1772,30 @@ ${contents}
17681772 }
17691773 } ) ) ;
17701774 context . subscriptions . push (
1771- vscode . commands . registerCommand ( 'pr.applySuggestionWithCopilot' , async ( comment : GHPRComment ) => {
1775+ vscode . commands . registerCommand ( 'pr.applySuggestionWithCopilot' , async ( comment : GHPRComment | GHPRCommentThread ) => {
17721776 /* __GDPR__
17731777 "pr.applySuggestionWithCopilot" : {}
17741778 */
17751779 telemetry . sendTelemetryEvent ( 'pr.applySuggestionWithCopilot' ) ;
17761780
1777- const commentThread = comment . parent ;
1781+ const isThread = GHPRCommentThread . is ( comment ) ;
1782+ const commentThread = isThread ? comment : comment . parent ;
1783+ const commentBody = isThread ? comment . comments [ 0 ] . body : comment . body ;
17781784 commentThread . collapsibleState = vscode . CommentThreadCollapsibleState . Collapsed ;
1779- const message = comment . body instanceof vscode . MarkdownString ? comment . body . value : comment . body ;
1780- await vscode . commands . executeCommand ( 'vscode.editorChat.start' , {
1781- initialRange : commentThread . range ,
1782- message : message ,
1783- autoSend : true ,
1784- } ) ;
1785+ const message = commentBody instanceof vscode . MarkdownString ? commentBody . value : commentBody ;
1786+
1787+ if ( isThread ) {
1788+ // For threads, open the Chat view instead of inline chat
1789+ await vscode . commands . executeCommand ( commands . NEW_CHAT , { inputValue : message , isPartialQuery : true , agentMode : true } ) ;
1790+
1791+ } else {
1792+ // For single comments, use inline chat
1793+ await vscode . commands . executeCommand ( 'vscode.editorChat.start' , {
1794+ initialRange : commentThread . range ,
1795+ message : message ,
1796+ autoSend : true ,
1797+ } ) ;
1798+ }
17851799 } )
17861800 ) ;
17871801 context . subscriptions . push (
0 commit comments