1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Don't let Diffusion show that an importing repository is "100%" imported

Summary:
A few users have hit this and found it confusing. Currently, it means "more than 99.95%", which is very different from "100%". Instead:

  - show an extra digit of precision; and
  - cap the display at "99.99%", so it's more clear that work is still happening.

Test Plan: Faked it and saw it cap at 99.99%.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D8058
This commit is contained in:
epriestley 2014-01-24 12:29:13 -08:00
parent 11786fb1cc
commit 53687827c6

View file

@ -954,7 +954,13 @@ final class DiffusionRepositoryEditMainController
$percentage = 0;
}
$percentage = sprintf('%.1f%%', $percentage);
// Cap this at "99.99%", because it's confusing to users when the actual
// fraction is "99.996%" and it rounds up to "100.00%".
if ($percentage > 99.99) {
$percentage = 99.99;
}
$percentage = sprintf('%.2f%%', $percentage);
$view->addItem(
id(new PHUIStatusItemView())