mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
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".
This commit is contained in:
@@ -42,7 +42,7 @@ const estimateFinish = (
|
||||
return isNaN(max) ? 0 : max
|
||||
}
|
||||
|
||||
const lowGuess = secondsLeft(p50)
|
||||
// Under-promise, over-deliver with the 95th percentile estimate.
|
||||
const highGuess = secondsLeft(p95)
|
||||
|
||||
const anyMomentNow: [number | undefined, string] = [
|
||||
@@ -54,11 +54,7 @@ const estimateFinish = (
|
||||
if (highGuess <= 0) {
|
||||
return anyMomentNow
|
||||
}
|
||||
const diff = highGuess - lowGuess
|
||||
if (diff < 3) {
|
||||
// If there is sufficient consistency, keep display simple.
|
||||
return [p50percent, `${highGuess} seconds remaining...`]
|
||||
}
|
||||
|
||||
return [p50percent, `Up to ${highGuess} seconds remaining...`]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user