Open
Conversation
The progress bar UI element always showed 1 step ahead of what it supposed to, also causing the last step to display a visual glitch (empty window)
Update progress bar at the beginning of the relink iteration instead of the end, which previously showed incorrect progress text and an empty window during the first iteration.
Update progress bar at the beginning of the refresh loop iteration instead of the end, which previously showed incorrect progress text and an empty window during the first iteration.
Update progress bar at the beginning of the refresh loop iteration instead of the end, which previously showed incorrect progress text and an empty window during the first iteration.
Same as last commit
Note: Seems like this bar is never used in the UI. But if it is in the future, this fixes it just like the other progress bars.
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
Fixes #1216 by addressing a more deeply rooted problem affecting all progress bars that are counting something (in total 6 in TagStudio). Also fixed a minor text bug where something like "Completed: 4/{unknown key}" because the formatter expected the parameter "total", not "count".
See my comment in #1216 for all details, but essentially this fix introduces a standard for how to use counting progress bars, and fixes some surrounding bugs regarding when to update the progress bar UI and with what counts. This turns all the progress bars from looking like this...
(during processing of file 1: empty but should show 0%)
(during processing of file 2: should say 1 file completed but says 2, and should be 33% completed)
(during processing of file 3 (last): empty but should show 2 files completed and 66%)
... to this:
(during processing of file 1)
(during processing of file 2)
(during processing of file 3 (last))
The fix, in words, was to remove an off-by-one error where 1 is always added to the progress => corrects the percentage counts, as well as fixes the error where the last step in the progress window was always empty.
Secondly, I documented that the progress count handed to the UI element should always be the current number of completed elements, nothing else. This removed the need for off-by-one cases scattered around the project => logic simplified.
Thirdly, the progress UIs are updated in the beginning of the loop iterations instead of at the end, to avoid that first blank view when no progress has been made yet.
Tasks Completed