@@ -205,13 +205,18 @@ function hasExplicitProgressPercent(record: JsonRecord): boolean {
205205
206206function deriveRebalanceProgressPercent ( status : string , pools : PoolSummary [ ] ) : number {
207207 const state = normalizeState ( status )
208- if ( [ "completed" , "complete" , "success" , "finished" ] . includes ( state ) && pools . every ( isCompletedRebalancePool ) ) {
208+ const rebalancePools = participatingRebalancePools ( pools )
209+ if (
210+ [ "completed" , "complete" , "success" , "finished" ] . includes ( state ) &&
211+ rebalancePools . length > 0 &&
212+ rebalancePools . every ( isCompletedRebalancePool )
213+ ) {
209214 return 100
210215 }
211- if ( pools . length === 0 ) return 0
216+ if ( rebalancePools . length === 0 ) return 0
212217
213- const finishedPools = pools . filter ( isCompletedRebalancePool ) . length
214- return Math . round ( ( finishedPools / pools . length ) * 100 )
218+ const finishedPools = rebalancePools . filter ( isCompletedRebalancePool ) . length
219+ return Math . round ( ( finishedPools / rebalancePools . length ) * 100 )
215220}
216221
217222function pickStatus ( record : JsonRecord ) : string {
@@ -357,6 +362,10 @@ function isCompletedRebalancePool(pool: PoolSummary): boolean {
357362 return [ "completed" , "complete" , "success" , "finished" ] . includes ( normalizeState ( pool . status ) )
358363}
359364
365+ function participatingRebalancePools ( pools : PoolSummary [ ] ) : PoolSummary [ ] {
366+ return pools . filter ( ( pool ) => ! isIdleRebalancePool ( pool ) || hasProgress ( pool . progress ) )
367+ }
368+
360369function deriveStatusFromPools ( pools : PoolSummary [ ] ) : string {
361370 if ( pools . length === 0 ) return ""
362371
@@ -370,7 +379,8 @@ function deriveStatusFromPools(pools: PoolSummary[]): string {
370379 ) {
371380 return "running"
372381 }
373- if ( pools . every ( isCompletedRebalancePool ) ) {
382+ const rebalancePools = participatingRebalancePools ( pools )
383+ if ( rebalancePools . length > 0 && rebalancePools . every ( isCompletedRebalancePool ) ) {
374384 return "completed"
375385 }
376386 if ( pools . some ( isCompletedRebalancePool ) && pools . some ( isIdleRebalancePool ) ) return "running"
0 commit comments