@@ -68,9 +68,13 @@ export class WebviewMessages {
6868 this . update = update
6969 }
7070
71- public sendWebviewMessage ( ) {
71+ public async sendWebviewMessage ( ) {
7272 const webview = this . getWebview ( )
73- void webview ?. show ( this . getWebviewData ( ) )
73+ if ( ! webview ) {
74+ return
75+ }
76+ const data = await this . getWebviewData ( )
77+ return webview . show ( data )
7478 }
7579
7680 public handleMessageFromWebview ( message : MessageFromWebview ) {
@@ -264,46 +268,80 @@ export class WebviewMessages {
264268
265269 private toggleShowOnlyChanged ( ) {
266270 this . columns . toggleShowOnlyChanged ( )
267- this . sendWebviewMessage ( )
268- sendTelemetryEvent (
269- EventName . VIEWS_EXPERIMENTS_TABLE_REFRESH ,
270- undefined ,
271- undefined
272- )
271+ return Promise . all ( [
272+ this . sendWebviewMessage ( ) ,
273+ sendTelemetryEvent (
274+ EventName . VIEWS_EXPERIMENTS_TABLE_REFRESH ,
275+ undefined ,
276+ undefined
277+ )
278+ ] )
273279 }
274280
275- private getWebviewData ( ) : TableData {
276- const filters = this . experiments . getFilters ( )
277- const rows = this . experiments . getRowData ( )
278- const selectedColumns = this . columns . getSelected ( )
279-
280- const showOnlyChanged = this . columns . getShowOnlyChanged ( )
281+ private async getWebviewData ( ) : Promise < TableData > {
282+ const [
283+ changes ,
284+ cliError ,
285+ columnOrder ,
286+ columnWidths ,
287+ selectedColumns ,
288+ filters ,
289+ hasBranchesToSelect ,
290+ hasCheckpoints ,
291+ hasColumns ,
292+ hasConfig ,
293+ hasMoreCommits ,
294+ hasRunningWorkspaceExperiment ,
295+ isShowingMoreCommits ,
296+ rows ,
297+ selectedBranches ,
298+ selectedForPlotsCount ,
299+ showOnlyChanged ,
300+ sorts
301+ ] = await Promise . all ( [
302+ this . columns . getChanges ( ) ,
303+ this . experiments . getCliError ( ) || null ,
304+ this . columns . getColumnOrder ( ) ,
305+ this . columns . getColumnWidths ( ) ,
306+ this . columns . getSelected ( ) ,
307+ this . experiments . getFilters ( ) ,
308+ this . experiments . getAvailableBranchesToShow ( ) . length > 0 ,
309+ this . experiments . hasCheckpoints ( ) ,
310+ this . columns . hasNonDefaultColumns ( ) ,
311+ this . pipeline . hasPipeline ( ) ,
312+ this . experiments . getHasMoreCommits ( ) ,
313+ this . experiments . hasRunningWorkspaceExperiment ( ) ,
314+ this . experiments . getIsShowingMoreCommits ( ) ,
315+ this . experiments . getRowData ( ) ,
316+ this . experiments . getSelectedBranches ( ) ,
317+ this . experiments . getSelectedRevisions ( ) . length ,
318+ this . columns . getShowOnlyChanged ( ) ,
319+ this . experiments . getSorts ( )
320+ ] )
281321
282322 const columns = showOnlyChanged
283323 ? collectColumnsWithChangedValues ( selectedColumns , rows , filters )
284324 : selectedColumns
285325
286326 return {
287- changes : this . columns . getChanges ( ) ,
288- cliError : this . experiments . getCliError ( ) || null ,
289- columnOrder : this . columns . getColumnOrder ( ) ,
290- columnWidths : this . columns . getColumnWidths ( ) ,
327+ changes,
328+ cliError,
329+ columnOrder,
330+ columnWidths,
291331 columns,
292332 filters : filters . map ( ( { path } ) => path ) ,
293- hasBranchesToSelect :
294- this . experiments . getAvailableBranchesToShow ( ) . length > 0 ,
295- hasCheckpoints : this . experiments . hasCheckpoints ( ) ,
296- hasColumns : this . columns . hasNonDefaultColumns ( ) ,
297- hasConfig : this . pipeline . hasPipeline ( ) ,
298- hasMoreCommits : this . experiments . getHasMoreCommits ( ) ,
299- hasRunningWorkspaceExperiment :
300- this . experiments . hasRunningWorkspaceExperiment ( ) ,
301- isShowingMoreCommits : this . experiments . getIsShowingMoreCommits ( ) ,
333+ hasBranchesToSelect,
334+ hasCheckpoints,
335+ hasColumns,
336+ hasConfig,
337+ hasMoreCommits,
338+ hasRunningWorkspaceExperiment,
339+ isShowingMoreCommits,
302340 rows,
303- selectedBranches : this . experiments . getSelectedBranches ( ) ,
304- selectedForPlotsCount : this . experiments . getSelectedRevisions ( ) . length ,
341+ selectedBranches,
342+ selectedForPlotsCount,
305343 showOnlyChanged,
306- sorts : this . experiments . getSorts ( )
344+ sorts
307345 }
308346 }
309347
0 commit comments