Skip to content
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

Support for progress bar #17

Open
latop2604 opened this issue Oct 2, 2023 · 3 comments
Open

Support for progress bar #17

latop2604 opened this issue Oct 2, 2023 · 3 comments
Assignees
Labels
discussion enhancement New feature or request live display Live display features

Comments

@latop2604
Copy link

It would be very nice if this lib have an extensions method for enumerable that display a dynamic progressbar.

var list = new List<int> {1,2,3,4};
foreach(var i un list.WithProgess("Caption"))
{
    // Do slow stuff
}
@MoaidHathot
Copy link
Owner

MoaidHathot commented Oct 5, 2023

Hi @latop2604, thanks for the suggestion! :)

"Live" controls are in my roadmap, but I think I'll need some time (and suggestions from the community) while tinkering with Progress Bars for Dumpify.

For example, IEnumerable<T> and IAsyncEnumerable<T> don't have a notion of Count, therefore I wouldn't be able to know the current status. Also, we could have infinite IEnumerable<T> and IAsyncEnumerable<T>, without us knowing about it beforehand.
We could though implement it for everything ICollection<T> which does have a Count property, but ICollection<T> is not lazy, so I'm not sure that this feature is needed in that situation.

What do you think? :)

@MoaidHathot MoaidHathot added enhancement New feature or request discussion labels Oct 5, 2023
@MoaidHathot MoaidHathot self-assigned this Oct 5, 2023
@latop2604
Copy link
Author

latop2604 commented Oct 5, 2023

On my side I still use IEnumerable but throw when we don't have the size.

They are many ways to get it from an IEnumerable. They more or less listed in the linq Count extension method (see screenshot below).

We can aslo use the extension method TryGetNonEnumeratedCount. But only for net 6+

The concern I have for this feature is where the progressbar will be displayed. I'm used to LinqPad where you can have many progressbar active and you can scroll the view to see each of them. But I don't know if it's possible with spectre.

image

For not countable list or asyncenumerable we can use undeterminated state progressbar. But I don't see the value of having it.

@MoaidHathot
Copy link
Owner

Sorry for the delay in my response.
Using a Progress Bar requires Live Display. Those are in the roadmap, I have a few ideas for Live Display as well, and your idea about Progress can be part of them.
Let's discuss this Issue when we reach that point, I'm planning to do under the hood changes that will help us integrate Live Display.

@MoaidHathot MoaidHathot added the live display Live display features label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request live display Live display features
Projects
None yet
Development

No branches or pull requests

2 participants