@@ -20,10 +20,15 @@ import { MultiTraceModel } from './modelUtil';
2020import './embeddedWorkbenchLoader.css' ;
2121import { Workbench } from './workbench' ;
2222import { currentTheme , toggleTheme } from '@web/theme' ;
23+ import type { SourceLocation } from './modelUtil' ;
2324
2425function openPage ( url : string , target ?: string ) {
2526 if ( url )
26- window . parent ! . postMessage ( { command : 'openExternal' , params : { url, target } } , '*' ) ;
27+ window . parent ! . postMessage ( { method : 'openExternal' , params : { url, target } } , '*' ) ;
28+ }
29+
30+ function openSourceLocation ( { file, line, column } : SourceLocation ) {
31+ window . parent ! . postMessage ( { method : 'openSourceLocation' , params : { file, line, column } } , '*' ) ;
2732}
2833
2934export const EmbeddedWorkbenchLoader : React . FunctionComponent = ( ) => {
@@ -86,7 +91,7 @@ export const EmbeddedWorkbenchLoader: React.FunctionComponent = () => {
8691 < div className = 'progress' >
8792 < div className = 'inner-progress' style = { { width : progress . total ? ( 100 * progress . done / progress . total ) + '%' : 0 } } > </ div >
8893 </ div >
89- < Workbench model = { model } openPage = { openPage } showSettings />
94+ < Workbench model = { model } openPage = { openPage } onOpenExternally = { openSourceLocation } showSettings />
9095 { ! traceURLs . length && < div className = 'empty-state' >
9196 < div className = 'title' > Select test to see the trace</ div >
9297 </ div > }
0 commit comments