@@ -169,7 +169,13 @@ suite('SessionChatInputToolbar', () => {
169169 }
170170
171171 test ( 'adds rich GitHub hovers only when live details are available' , async ( ) => {
172- const commandService = upcastPartial < ICommandService > ( { executeCommand : async ( ) => undefined } ) ;
172+ const commands : { readonly id : string ; readonly args : readonly unknown [ ] } [ ] = [ ] ;
173+ const commandService = upcastPartial < ICommandService > ( {
174+ executeCommand : async ( id , ...args ) => {
175+ commands . push ( { id, args } ) ;
176+ return undefined ;
177+ } ,
178+ } ) ;
173179 const clipboardService = upcastPartial < IClipboardService > ( { writeText : async ( ) => { } } ) ;
174180 const openerService = upcastPartial < IOpenerService > ( { open : async ( ) => true } ) ;
175181 const sessionsService = upcastPartial < ISessionsService > ( { setActive : ( ) => { } } ) ;
@@ -178,6 +184,7 @@ suite('SessionChatInputToolbar', () => {
178184 repo : 'vscode' ,
179185 number : 332982 ,
180186 uri : URI . parse ( 'https://github.com/microsoft/vscode/pull/332982' ) ,
187+ title : 'Recorded pull request title' ,
181188 } ;
182189 const pullRequest : IGitHubPullRequest = {
183190 number : pullRequestRef . number ,
@@ -200,6 +207,7 @@ suite('SessionChatInputToolbar', () => {
200207 repo : 'vscode' ,
201208 number : 42 ,
202209 uri : URI . parse ( 'https://github.com/microsoft/vscode/issues/42' ) ,
210+ title : 'Recorded issue title' ,
203211 } ;
204212 const issue : IGitHubIssue = {
205213 number : issueRef . number ,
@@ -253,38 +261,67 @@ suite('SessionChatInputToolbar', () => {
253261 } ;
254262 const pullRequestHover = await renderHover ( pullRequestEntry ) ;
255263 const issueHover = await renderHover ( issueEntry ) ;
264+ pullRequestEntry ?. open ( ) ;
265+ unresolvedIssueEntry ?. open ( ) ;
256266
257267 assert . deepStrictEqual ( {
258268 pullRequest : {
269+ label : pullRequestEntry ?. label ,
259270 className : pullRequestHover ?. className ,
260271 repository : pullRequestHover ?. querySelector ( '.sessions-pr-hover-repository' ) ?. textContent ,
261272 title : pullRequestHover ?. querySelector ( '.sessions-pr-hover-title' ) ?. textContent ,
262273 description : pullRequestHover ?. querySelector ( '.sessions-pr-hover-description-content' ) ?. textContent ,
263274 branches : [ ...pullRequestHover ?. querySelectorAll ( '.sessions-pr-hover-branch' ) ?? [ ] ] . map ( element => element . textContent ) ,
275+ unresolvedLabel : unresolvedPullRequestEntry ?. label ,
276+ unresolvedAriaLabel : unresolvedPullRequestEntry ?. ariaLabel ,
277+ unresolvedTooltip : unresolvedPullRequestEntry ?. tooltip ,
264278 unresolvedHover : unresolvedPullRequestEntry ?. pillHover ,
265279 } ,
266280 issue : {
281+ label : issueEntry ?. label ,
267282 className : issueHover ?. className ,
268283 repository : issueHover ?. querySelector ( '.sessions-issue-hover-repository' ) ?. textContent ,
269284 title : issueHover ?. querySelector ( '.sessions-issue-hover-title' ) ?. textContent ,
270285 description : issueHover ?. querySelector ( '.sessions-issue-hover-description-content' ) ?. textContent ,
286+ unresolvedLabel : unresolvedIssueEntry ?. label ,
287+ unresolvedAriaLabel : unresolvedIssueEntry ?. ariaLabel ,
288+ unresolvedTooltip : unresolvedIssueEntry ?. tooltip ,
271289 unresolvedHover : unresolvedIssueEntry ?. pillHover ,
290+ openCommands : commands ,
272291 } ,
273292 } , {
274293 pullRequest : {
294+ label : 'Pull Request #332982: Restore rich pill hovers' ,
275295 className : 'sessions-pr-hover' ,
276296 repository : 'microsoft/vscode' ,
277297 title : 'Restore rich pill hovers' ,
278298 description : 'Provides detailed pull request context.' ,
279299 branches : [ 'main' , 'feature/rich-hover' ] ,
300+ unresolvedLabel : 'Pull Request #332982: Recorded pull request title' ,
301+ unresolvedAriaLabel : 'Open Pull Request #332982: Recorded pull request title' ,
302+ unresolvedTooltip : 'Pull Request #332982: Recorded pull request title\nhttps://github.com/microsoft/vscode/pull/332982' ,
280303 unresolvedHover : undefined ,
281304 } ,
282305 issue : {
306+ label : 'Issue #42: Rich issue hover' ,
283307 className : 'sessions-issue-hover' ,
284308 repository : 'microsoft/vscode#42' ,
285309 title : 'Rich issue hover' ,
286310 description : 'Provides detailed issue context.' ,
311+ unresolvedLabel : 'Issue #42: Recorded issue title' ,
312+ unresolvedAriaLabel : 'Open Issue #42: Recorded issue title' ,
313+ unresolvedTooltip : 'Issue #42: Recorded issue title\nhttps://github.com/microsoft/vscode/issues/42' ,
287314 unresolvedHover : undefined ,
315+ openCommands : [
316+ {
317+ id : 'workbench.agentSessions.action.openPullRequest' ,
318+ args : [ { pullRequest : pullRequestRef } ] ,
319+ } ,
320+ {
321+ id : 'workbench.agentSessions.action.openIssue' ,
322+ args : [ { issue : issueRef } ] ,
323+ } ,
324+ ] ,
288325 } ,
289326 } ) ;
290327 } ) ;
0 commit comments