Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f7cce7

Browse files
authored
fix(site): always use 95th percentile in progress bar (#5733)
This fixes the issue where the bar flickers from "Up to X seconds remaining" to "X seconds remaining".
1 parent 4420985 commit 5f7cce7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

site/src/components/WorkspaceBuildProgress/WorkspaceBuildProgress.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const estimateFinish = (
4242
return isNaN(max) ? 0 : max
4343
}
4444

45-
const lowGuess = secondsLeft(p50)
45+
// Under-promise, over-deliver with the 95th percentile estimate.
4646
const highGuess = secondsLeft(p95)
4747

4848
const anyMomentNow: [number | undefined, string] = [
@@ -54,11 +54,7 @@ const estimateFinish = (
5454
if (highGuess <= 0) {
5555
return anyMomentNow
5656
}
57-
const diff = highGuess - lowGuess
58-
if (diff < 3) {
59-
// If there is sufficient consistency, keep display simple.
60-
return [p50percent, `${highGuess} seconds remaining...`]
61-
}
57+
6258
return [p50percent, `Up to ${highGuess} seconds remaining...`]
6359
}
6460

0 commit comments

Comments
 (0)