Show progress percentage with one decimal and prevent overfill - #551
Open
jessejacksonafterpay wants to merge 1 commit into
Open
Show progress percentage with one decimal and prevent overfill#551jessejacksonafterpay wants to merge 1 commit into
jessejacksonafterpay wants to merge 1 commit into
Conversation
The progress bar rounded the percentage to a whole number, so 99.6% displayed as 100% with the bar filled all the way. Compute the true percentage and floor it to one decimal so the rendered width and label can never overstate progress.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProgressBarcomponent rounded the computed percentage to a whole number withround((numerator / denominator) * 100). At 99.6% this rounded to 100, so the bar visually filled to 100% and the label read "100%" while the backfill wasn't actually complete.width:style, so the rendered fill can never exceed the actual progress.99.6%).Notes
BackfillShowActionalready usesString.format("%.1f", percentage)for the standalone "Overall Progress" label above the bar, so this brings the bar's inline label in line with that.