Skip to content

AI junk#3682

Closed
OneNobleSoul wants to merge 1 commit into
pallets:mainfrom
OneNobleSoul:progressbar-finish-min-steps
Closed

AI junk#3682
OneNobleSoul wants to merge 1 commit into
pallets:mainfrom
OneNobleSoul:progressbar-finish-min-steps

Conversation

@OneNobleSoul

Copy link
Copy Markdown

This fixes #3571.

ProgressBar.update() only flushes accumulated steps once _completed_intervals reaches update_min_steps. A trailing interval smaller than that threshold was never applied, so a bar using show_pos=True could finish showing a stale position — e.g. 18/20 while the percentage already reads 100%.

update() now also flushes when the position reaches the length, so the final step is always rendered. This covers both the generator and the manual bar.update() paths.

  • Added a regression test in tests/test_termui.py that fails without the change (feeds 20 single steps with update_min_steps=6 and asserts the bar ends at 20/20).
  • Added a CHANGES.md entry and a versionchanged note on update().

Verified locally: pytest tests/test_termui.py (222 passed), ruff and mypy clean.

A trailing interval smaller than update_min_steps was never flushed, so a
bar with show_pos=True could finish showing e.g. 18/20 at 100%. update()
now also renders when the position reaches the length.

fixes #3571

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@davidism davidism closed this Jul 11, 2026
@davidism davidism changed the title Fix progressbar finishing on a stale position with update_min_steps AI junk Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

click.progressbar doesn't show full completion when using show_pos=True combined with update_min_steps

3 participants