-
-
Notifications
You must be signed in to change notification settings - Fork 411
fix: Indeterminate progress bar title display issue #2976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…s bar would not display.
|
Unable to trigger custom agent "Code Reviewer"You have run out of credits 😔 |
|
(successfully) Tested with the following script: from pyrevit import script
from pyrevit.forms import ProgressBar
import time
output = script.get_output()
def test_progressbar_all_methods():
myMax = 10
# Indeterminate mode with no updates
with ProgressBar(title="Indeterminate Progress No Update", indeterminate=True) as pb:
time.sleep(1)
# Indeterminate mode with updates
with ProgressBar(title="Indeterminate Progress with Updates: {value}/{max_value}", indeterminate=True) as pb:
for i in range(myMax):
pb.update_progress(i + 1, myMax)
time.sleep(.25)
# Determinate mode with counter
with ProgressBar(title="Determinate: {value}/{max_value}") as pb:
for i in range(1, myMax + 1):
pb.update_progress(i, myMax)
time.sleep(0.25)
# Determinate mode without count
with ProgressBar(title="Determinate without count") as pb:
for i in range(myMax):
pb.update_progress(i + 1, myMax)
time.sleep(0.25)
# Cancellable progress bar
with ProgressBar(title="Cancellable: {value}/{max_value}", cancellable=True) as pb:
for i in range(1, myMax + 1):
if pb.cancelled:
print("Cancelled!")
break
pb.update_progress(i, myMax)
time.sleep(0.25)
# With Steps
with ProgressBar(title="With Steps: {value}/{max_value}", step=10) as pb:
for i in range(100):
i = i + 1
pb.update_progress(i, 100)
time.sleep(0.25)
if __name__ == "__main__":
test_progressbar_all_methods() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an issue where the title text of an indeterminate progress bar would not display until values were updated. The fix ensures that the progress bar title is rendered immediately upon initialization.
- Adds a call to
_update_pbar()during setup to initialize the title text display
|
@devloai please review the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary:
Fixes bug #2975 where indeterminate progress bars would not display title text when no progress updates were made. The fix adds a call to _update_pbar() at the end of _setup() to ensure the title is rendered during initialization, even when update_progress() is never called.
Review Summary:
Clean and minimal bug fix that correctly addresses the issue. The implementation is safe—all required properties (max_value, new_value, _title, pbar, pbar_text) are properly initialized before _update_pbar() is called. The author provided comprehensive test coverage demonstrating the fix works across multiple usage patterns (indeterminate with/without updates, determinate, cancellable, etc.).
No issues identified. The fix follows existing patterns in the codebase and maintains backward compatibility. Great first public contribution! 🎉
Follow-up suggestions:
None needed—PR is ready to merge.
|
thank you @TPJW |
|
📦 New work-in-progress (wip) builds are available for 5.3.1.26006+2004-wip |
Fix indeterminate progress bar title display issue
Description
Resolved issue #2975 where the title text for an indeterminate progress bar would not display when no values were being updated.
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
If applicable, link the issues resolved by this pull request:
Additional Notes
First (public) PR :)
Thank you for contributing to pyRevit! 🎉