Skip to content

Conversation

@TPJW
Copy link
Contributor

@TPJW TPJW commented Dec 22, 2025

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:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
    pipenv run black {source_file_or_directory}
  • Changes are tested and verified to work as expected.

Related Issues

If applicable, link the issues resolved by this pull request:


Additional Notes

First (public) PR :)


Thank you for contributing to pyRevit! 🎉

@devloai
Copy link
Contributor

devloai bot commented Dec 22, 2025

Unable to trigger custom agent "Code Reviewer"You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

@TPJW
Copy link
Contributor Author

TPJW commented Dec 22, 2025

(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()

@TPJW TPJW changed the title Fix indeterminate progress bar title display issue fix: Indeterminate progress bar title display issue Dec 23, 2025
@jmcouffin jmcouffin requested a review from Copilot December 26, 2025 15:55
Copy link
Contributor

Copilot AI left a 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

@jmcouffin
Copy link
Contributor

@devloai please review the changes

Copy link
Contributor

@devloai devloai bot left a 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.

@jmcouffin jmcouffin merged commit b4bb7a8 into pyrevitlabs:develop Jan 6, 2026
6 checks passed
@jmcouffin jmcouffin added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Jan 6, 2026
@jmcouffin jmcouffin self-assigned this Jan 6, 2026
@jmcouffin
Copy link
Contributor

thank you @TPJW

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📦 New work-in-progress (wip) builds are available for 5.3.1.26006+2004-wip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: indeterminate Progress Bar Does Not Show Title

2 participants