spectreconsole / spectre.console

A .NET library that makes it easier to create beautiful console applications.
https://spectreconsole.net
MIT License
8.91k stars 454 forks source link

[Progress] Partial and global operation progress #1263

Open SuperJMN opened 11 months ago

SuperJMN commented 11 months ago

I have a Task with Subtasks and I want to render each task's progress and the overall progress.

On the one side, I'd like to have the overall task progress (the number of subtasks pending/completed) On the another side, I'd like to have the progress of the children tasks with their progress.

Is there any way to do this? Thanks.


Please upvote :+1: this issue if you are interested in it.

thomhurst commented 11 months ago

Nothing out of the box that I could see. I've got a similar requirement and just created an overall task manually, and I update it as my subtasks finish using Task continuation callbacks.

It's a little messy but it works.

https://github.com/thomhurst/ModularPipelines/blob/main/ModularPipelines/Helpers/PipelineConsoleProgressPrinter.cs

SuperJMN commented 11 months ago

Interesting. Could you post a snapshot of how it renders? Thanks :)

thomhurst commented 11 months ago

Interesting. Could you post a snapshot of how it renders? Thanks :)

If you see my pull request, I posted some code to replicate my need.

https://github.com/spectreconsole/spectre.console/pull/1250

SuperJMN commented 11 months ago

Interesting. Could you post a snapshot of how it renders? Thanks :)

If you see my pull request, I posted some code to replicate my need.

1250

Neat! thank you :D