@@ -14,6 +14,8 @@ import { IChatContentPart } from './chatContentParts.js';
14
14
import { Codicon } from '../../../../../base/common/codicons.js' ;
15
15
import { ThemeIcon } from '../../../../../base/common/themables.js' ;
16
16
import { localize } from '../../../../../nls.js' ;
17
+ import { addDisposableListener } from '../../../../../base/browser/dom.js' ;
18
+ import { IOpenerService } from '../../../../../platform/opener/common/opener.js' ;
17
19
18
20
export class ChatPullRequestContentPart extends Disposable implements IChatContentPart {
19
21
public readonly domNode : HTMLElement ;
@@ -22,7 +24,8 @@ export class ChatPullRequestContentPart extends Disposable implements IChatConte
22
24
public readonly onDidChangeHeight = this . _onDidChangeHeight . event ;
23
25
24
26
constructor (
25
- private readonly pullRequestContent : IChatPullRequestContent
27
+ private readonly pullRequestContent : IChatPullRequestContent ,
28
+ @IOpenerService private readonly openerService : IOpenerService
26
29
) {
27
30
super ( ) ;
28
31
@@ -37,6 +40,11 @@ export class ChatPullRequestContentPart extends Disposable implements IChatConte
37
40
titleElement . textContent = this . pullRequestContent . title ;
38
41
const linkElement : HTMLAnchorElement = dom . append ( titleContainer , dom . $ ( 'a.link' ) ) ;
39
42
linkElement . textContent = this . pullRequestContent . linkTag ;
43
+ this . _register ( addDisposableListener ( linkElement , 'click' , ( e ) => {
44
+ e . preventDefault ( ) ;
45
+ e . stopPropagation ( ) ;
46
+ this . openerService . open ( this . pullRequestContent . uri ) ;
47
+ } ) ) ;
40
48
linkElement . href = this . pullRequestContent . uri . toString ( ) ;
41
49
42
50
const metaElement = dom . append ( contentContainer , dom . $ ( '.meta' ) ) ;
0 commit comments