Skip to content

Progressbar tag support v2 pr#2025

Merged
patriksvensson merged 11 commits intospectreconsole:mainfrom
mitchcapper:progressbar_tag_support_v2_pr
Feb 25, 2026
Merged

Progressbar tag support v2 pr#2025
patriksvensson merged 11 commits intospectreconsole:mainfrom
mitchcapper:progressbar_tag_support_v2_pr

Conversation

@mitchcapper
Copy link
Copy Markdown
Contributor

@mitchcapper mitchcapper commented Feb 23, 2026

V2 of #1902

This time with tests and documentation:) Note I haven't tested my additional sample code that I put up for the former version. If any of the features I talk about in there are of interest I can do a separate PR for them.

fixes #1900
fixes #1901
fixes #1854
fixes #1472
fixes #1899

  • I have read the Contribution Guidelines
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors
  • The documentation was modified to reflect the changes OR no documentation changes are required.

Please upvote 👍 this pull request if you are interested in it.

Sorry!

Yes I know this is exactly not how you want PR to be done, you ask for approval first. I coded most of these things for my own use (with a few ideas taken from Issues) so feel free to cherrypick any useful commits but if none of it makes it in thats ok:) I tried to keep one feature per commit.

Progress: Add ability to override hiding when completed on a per-task basis

Closes #1900 (but by me)

Progress: Add ability to remove tasks from the context collection.

Closes #1901 (but my by)

Progress: Allow the user to set the max sampling age for progress task speed calculations

Better perf control over sampling including the ability to disable it

Progress: change sampling to use CircularBuffer

Uses Microsofts unofficial CircularBuffer for samples and caching for greater efficiency.
Closes #1854 (while also adding the ability to disable it if not needed).
Closes #1472 by always returning our last cached speed unless their is a progress change or if we are stopped:)

Progress: Adds Tag object on ProgressTask

Closes #1899 (but by me)
The core change of adding a Tag object allows for some fun new features to be done fairly easily. The sample code below (not part of the PR as I don't think it needs to be in the official repo) adds:

Shout out to @vic10us and their sexy FancyProgress Bar that first attracted me to Spectre

Sample code:

https://gist.github.com/mitchcapper/d30fca9184a1e9d196ae9ac48edc05ff
sample

Unrelated to this PR but the sample code also adds:

int [] arr = [ 1, 2, 3, 4, -5, 6, -7, 8, -9, 10 ];
foreach ( var i in ctx.WithTask(arr, "[green1]Processing array...[/]") ) {
	await Task.Delay(1000);
}
  • a counter column for displaying the progress value.

@mitchcapper mitchcapper force-pushed the progressbar_tag_support_v2_pr branch from 7db8bf8 to 38e0302 Compare February 23, 2026 08:35
@mitchcapper
Copy link
Copy Markdown
Contributor Author

force pushed for additional remerge after cc29195

Copy link
Copy Markdown
Contributor

@patriksvensson patriksvensson left a comment

Choose a reason for hiding this comment

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

Some minor stuff. Also need you to fix the formatting warnings emitted in ProgressTests.

@patriksvensson
Copy link
Copy Markdown
Contributor

@mitchcapper I resolved the issues for you

@patriksvensson patriksvensson merged commit 830af6a into spectreconsole:main Feb 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants