@@ -37,15 +37,12 @@ export class WebviewMessages {
3737
3838 private hasConfig = false
3939 private hasValidDvcYaml = true
40- private hasMoreCommits : Record < string , boolean > = { }
41- private isShowingMoreCommits : Record < string , boolean > = { }
4240
4341 private readonly addStage : ( ) => Promise < boolean >
4442 private readonly selectBranches : (
4543 branchesSelected : string [ ]
4644 ) => Promise < string [ ] | undefined >
4745
48- private readonly getNumCommits : ( branch : string ) => Promise < number >
4946 private readonly update : ( ) => Promise < void >
5047
5148 constructor (
@@ -60,7 +57,6 @@ export class WebviewMessages {
6057 selectBranches : (
6158 branchesSelected : string [ ]
6259 ) => Promise < string [ ] | undefined > ,
63- getNumCommits : ( branch : string ) => Promise < number > ,
6460 update : ( ) => Promise < void >
6561 ) {
6662 this . dvcRoot = dvcRoot
@@ -72,11 +68,9 @@ export class WebviewMessages {
7268 this . hasStages = hasStages
7369 this . addStage = addStage
7470 this . selectBranches = selectBranches
75- this . getNumCommits = getNumCommits
7671 this . update = update
7772
7873 void this . changeHasConfig ( )
79- void this . changeHasMoreOrLessCommits ( )
8074 }
8175
8276 public async changeHasConfig ( update ?: boolean ) {
@@ -86,10 +80,7 @@ export class WebviewMessages {
8680 update && this . sendWebviewMessage ( )
8781 }
8882
89- public sendWebviewMessage ( doNotCheckNbCommits ?: boolean ) {
90- if ( ! doNotCheckNbCommits ) {
91- void this . changeHasMoreOrLessCommits ( true )
92- }
83+ public sendWebviewMessage ( ) {
9384 const webview = this . getWebview ( )
9485 void webview ?. show ( this . getWebviewData ( ) )
9586 }
@@ -233,19 +224,6 @@ export class WebviewMessages {
233224 )
234225 this . experiments . setBranchesToShow ( selectedBranches )
235226 await this . update ( )
236- await this . changeHasMoreOrLessCommits ( true )
237- }
238-
239- private async changeHasMoreOrLessCommits ( update ?: boolean ) {
240- for ( const branch of this . experiments . getBranchesToShow ( ) ) {
241- const availableNbCommits = await this . getNumCommits ( branch )
242- const nbOfCommitsToShow = this . experiments . getNbOfCommitsToShow ( branch )
243- this . hasMoreCommits [ branch ] = availableNbCommits > nbOfCommitsToShow
244- this . isShowingMoreCommits [ branch ] =
245- Math . min ( nbOfCommitsToShow , availableNbCommits ) > 1
246- }
247-
248- update && this . sendWebviewMessage ( true )
249227 }
250228
251229 private async changeCommitsToShow ( change : 1 | - 1 , branch : string ) {
@@ -262,7 +240,6 @@ export class WebviewMessages {
262240 branch
263241 )
264242 await this . update ( )
265- await this . changeHasMoreOrLessCommits ( true )
266243 }
267244
268245 private getWebviewData ( ) {
@@ -278,11 +255,11 @@ export class WebviewMessages {
278255 hasCheckpoints : this . experiments . hasCheckpoints ( ) ,
279256 hasColumns : this . columns . hasNonDefaultColumns ( ) ,
280257 hasConfig : this . hasConfig ,
281- hasMoreCommits : this . hasMoreCommits ,
258+ hasMoreCommits : this . experiments . getHasMoreCommits ( ) ,
282259 hasRunningWorkspaceExperiment :
283260 this . experiments . hasRunningWorkspaceExperiment ( ) ,
284261 hasValidDvcYaml : this . hasValidDvcYaml ,
285- isShowingMoreCommits : this . isShowingMoreCommits ,
262+ isShowingMoreCommits : this . experiments . getIsShowingMoreCommits ( ) ,
286263 rows : this . experiments . getRowData ( ) ,
287264 selectedForPlotsCount : this . experiments . getSelectedRevisions ( ) . length ,
288265 sorts : this . experiments . getSorts ( )
0 commit comments