@@ -52,11 +52,13 @@ function SuccessView({
5252 owner,
5353 repo,
5454 submittedTitle,
55+ openLink,
5556} : {
5657 pr : PRResult ;
5758 owner : string ;
5859 repo : string ;
5960 submittedTitle : string ;
61+ openLink : ( url : string ) => Promise < void > ;
6062} ) {
6163 const prUrl = pr . html_url || pr . url || pr . URL || "#" ;
6264
@@ -105,6 +107,14 @@ function SuccessView({
105107 href = { prUrl }
106108 target = "_blank"
107109 rel = "noopener noreferrer"
110+ onClick = { ( e ) => {
111+ // MCP Apps run in a sandboxed iframe where a plain anchor may be
112+ // blocked, so route the click through the host's open-link
113+ // capability (falls back to window.open).
114+ e . preventDefault ( ) ;
115+ if ( prUrl === "#" ) return ;
116+ void openLink ( prUrl ) ;
117+ } }
108118 style = { {
109119 fontWeight : 600 ,
110120 fontSize : "14px" ,
@@ -157,7 +167,7 @@ function CreatePRApp() {
157167 const [ repoSearchLoading , setRepoSearchLoading ] = useState ( false ) ;
158168 const [ repoFilter , setRepoFilter ] = useState ( "" ) ;
159169
160- const { app, error : appError , toolInput, callTool, hostContext, setModelContext } = useMcpApp ( {
170+ const { app, error : appError , toolInput, callTool, hostContext, setModelContext, openLink } = useMcpApp ( {
161171 appName : "github-mcp-server-create-pull-request" ,
162172 } ) ;
163173
@@ -352,7 +362,7 @@ function CreatePRApp() {
352362 if ( successPR ) {
353363 return (
354364 < AppProvider hostContext = { hostContext } >
355- < SuccessView pr = { successPR } owner = { owner } repo = { repo } submittedTitle = { submittedTitle } />
365+ < SuccessView pr = { successPR } owner = { owner } repo = { repo } submittedTitle = { submittedTitle } openLink = { openLink } />
356366 </ AppProvider >
357367 ) ;
358368 }
0 commit comments