Skip to content

Progressbar tag support v2 pr - #2025

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

patriksvensson merged 11 commits into
spectreconsole:mainfrom
mitchcapper:progressbar_tag_support_v2_pr

Conversation

@mitchcapper

@mitchcapper mitchcapper commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Child / Nested tasks - One of the requested features Nested progress #1419 now this sample code doesn't implicitly have children effect their parents progress but adding such a feature wouldn't be hard. It does add a DescriptionWithParentChildColumn that handles the rendering of subtasks decently elegantly. Nested Status() and Progress() #1340 as well asks for it.

  • CurrentItemColumn - This allows you to show the current item progress is being made on. It also supports only refreshing this only every TimeSpan interval (not dependent on UI refresh rate). If you are iterating thousands of items you don't want to update the display with each item, however once a second you might want to show the current item:)

  • TaskbarProgressColumn - When you set a task as "UseForTaskbarProgress" it will emit the proper ANSI codes for conemu progress:) Picked up by Windows Terminal, WezTerm, etc. https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC Shows not only in the terminal but also taskbar. An alternate implementation of Add Support to Terminal progress indicator to the the spectre console progress widget #1402 .

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

@patriksvensson patriksvensson left a comment

Copy link
Copy Markdown
Contributor

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
2 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