Skip to content

Conversation

@mitchcapper
Copy link

@mitchcapper mitchcapper commented Sep 18, 2025

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

  • [ x ] I have read the Contribution Guidelines
  • [ No ] I have commented on the issue above and discussed the intended changes
  • [ Definitely not ] A maintainer has signed off on the changes and the issue was assigned to me
  • [ Nope ] All newly added code is adequately covered by tests
  • [ x ] All existing tests are still running without errors
  • [ No ] 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. If some things are of interest I can add documentation and such for them further too.

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_pr branch 2 times, most recently from 034adfe to fa28352 Compare September 18, 2025 18:22
@mitchcapper mitchcapper changed the title Minor progress improvements (for granular Task control and tagging) Progress improvements (for granular Task control and tagging among others) Sep 18, 2025
@github-actions github-actions bot added the ⭐ top pull request Top pull request. label Sep 19, 2025
@ronnyek
Copy link

ronnyek commented Oct 17, 2025

I'd definitely use this if it was merged in. Is there a problem with the current PR?

@patriksvensson
Copy link
Contributor

@ronnyek Yes, builds are failing

@mitchcapper mitchcapper force-pushed the progressbar_tag_support_pr branch from e164454 to 887c74f Compare October 18, 2025 07:19
@mitchcapper
Copy link
Author

ALR there are plenty of reasons not to merge this (no test case coverage, no docs, etc, etc) but I fixed the style issues triggering the build failures. For CircularBuffer.cs I just excluded the style rules on it given the fact it was taken from somewhere else incase we ever want to diff against upstream. It now passes all tests. There is one new commit to support all test cases on Windows (previously two exception tests would fail due to the wrong path char).

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

Labels

⭐ top pull request Top pull request.

Projects

None yet

3 participants