Skip to content

Fix faulty progress bars#1293

Merged
CyanVoxel merged 10 commits into
TagStudioDev:mainfrom
ludvig-sandh:fix-faulty-progress-bar
Jun 29, 2026
Merged

Fix faulty progress bars#1293
CyanVoxel merged 10 commits into
TagStudioDev:mainfrom
ludvig-sandh:fix-faulty-progress-bar

Conversation

@ludvig-sandh

@ludvig-sandh ludvig-sandh commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

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%)
before_1_of_3


(during processing of file 2: should say 1 file completed but says 2, and should be 33% completed)
before_2_of_3


(during processing of file 3 (last): empty but should show 2 files completed and 66%)
before_3_of_3

... to this:


(during processing of file 1)
after_1_of_3


(during processing of file 2)

after_2_of_3

(during processing of file 3 (last))
after_3_of_3

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

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

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.
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.
@TrigamDev TrigamDev added Type: UI/UX User interface and/or user experience Status: Review Needed A review of this is needed Type: Fix A fix for a bug, typo, or other issue labels Jan 18, 2026
@CyanVoxel CyanVoxel moved this to 🏓 Ready for Review in TagStudio Development Jun 28, 2026
@CyanVoxel CyanVoxel added this to the Alpha v9.6.0 milestone Jun 29, 2026

@CyanVoxel CyanVoxel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the fix!

@CyanVoxel CyanVoxel merged commit a865573 into TagStudioDev:main Jun 29, 2026
6 of 7 checks passed
@github-project-automation github-project-automation Bot moved this from 🏓 Ready for Review to ✅ Done in TagStudio Development Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed A review of this is needed Type: Fix A fix for a bug, typo, or other issue Type: UI/UX User interface and/or user experience

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Off-By-N in relink progress bar

3 participants