salihgerdan/spaceman

Feature request: progress bar

dgutson opened this issue · 4 comments

I suggest to add a progress bar while the tool is analyzing the space. Sometimes it takes some minutes, but most importantly you don't know if it already finished or not, or how much is left.

Makes sense, I would like to make it slick like it is on the GNOME Web application which is built with the same GUI framework. I wanted to give it an address-bar type thing as well, should look nice.
image

However, it's not really possible to estimate the progress of a filesystem walk well, since the amount of files to process is not known beforehand, and trying to get this info is equivalent to walking it in the first place. The best I can come up with is that we could estimate by showing how many of the top-level directories have been processed. It will be a very rough estimate, but like you said what matters is that the user knows if the process is complete so it will accomplish that at least.

Yeah first or 2nd level of directories in the tree would be fine.

What about doing it by size rather than number of files? You can obtain that like df in linux and obtain total/free size in Windows when you click right button and properties on a disk. By having thise numbers you could know what progress it's beeing done.

image
Yeah, only scanning the first level of directories was quite enough. It surprisingly doesn't feel unnatural, a little jumpy but does the job and it looks nice.
To accomplish this, I had to revamp the code quite a bit, to be able to share the scan state between different widgets. Big win for the code quality :)
Thanks for your suggestion.

The Windows build for version 0.1.2 which includes this change wasn't available at first because of breaking changes in pkgconf 2.0.0 which msys2 has packaged already. (pkgconf/pkgconf#310) It seems that pkg-config-rs has used a strange pattern that hit this breaking change that's probably justified.

I resolved this by downgrading pkgconf in 104d61f, hoping you can test this now.