Byron / dua-cli

View disk space usage and delete unwanted data, fast.
https://lib.rs/crates/dua-cli
MIT License
4.19k stars 113 forks source link

Refactors AppState initialisation during app startup #199

Closed gosuwachu closed 11 months ago

gosuwachu commented 11 months ago

I have found previous version with the Option<> a bit weird, but it is probably a matter of taste. In the new version AppState is created at the start, but unfortunately we have to deal with incoming events which complicate things.

However, I am not sure if we need to process the events during the traversal. The app is not that usable in that state anyway - events are all processed in batches which causes the cursor jump around a bit, and the experience is not smooth at all.

Also, as an example ncdu doesn't allow any interaction during scanning. Thoughts?

Byron commented 11 months ago

Thanks a lot, this looks so much better (and reduces the amount of code).

However, I am not sure if we need to process the events during the traversal. The app is not that usable in that state anyway - events are all processed in batches which causes the cursor jump around a bit, and the experience is not smooth at all.

It's an important feature, which also allows the user to quit out of the application early. Even though it's not the most responsive right now, it's predictable, and I use early browsing all the time, even if only to keep me busy while waiting. So this is definitely a keeper.

I may add that during my experiments with moonwalk I noticed that it's much more responsive with it. It will just take some time until the author completes it, but it will land eventually for performance and responsiveness.