-
-
Notifications
You must be signed in to change notification settings - Fork 601
Progress improvements (for granular Task control and tagging among others) #1902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Progress improvements (for granular Task control and tagging among others) #1902
Conversation
Makes user extending easier with per task data
…for progress task speed calculations Also allow setting samples=0 to prevent collection
034adfe to
fa28352
Compare
|
I'd definitely use this if it was merged in. Is there a problem with the current PR? |
|
@ronnyek Yes, builds are failing |
e164454 to
887c74f
Compare
|
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). |
fixes #1900
fixes #1901
fixes #1854
fixes #1472
fixes #1899
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.
Closes #1900 (but by me)
Closes #1901 (but my by)
Better perf control over sampling including the ability to disable it
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:)
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

Unrelated to this PR but the sample code also adds: