Byron / dua-cli

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

Implements glob search feature #202

Closed gosuwachu closed 6 months ago

gosuwachu commented 6 months ago

Implements glob search feature as requested in #154

Screenshot 2023-12-19 at 21 15 21

There are three main components to in the implementation of this feature:

gosuwachu commented 6 months ago

re: cursor - I think the problem is due to the fact that the cursor is not drawn in the buffer, and then diffed to only draw what has changed by tui-react. Instead the cursor is rendered directly on the screen. I am not sure how to fix it as I am not too familiar with that code.

Byron commented 6 months ago

Me neither, as it should be something related to Ratatui I presume. It would probably also be possible to check there to see how to best do prompting, a topic dua managed to avoid thus far (but can't avoid any longer).

gosuwachu commented 6 months ago

fyi, I have fixed the problem with the cursor.

gosuwachu commented 6 months ago

Added long path shortening:

Screenshot 2023-12-20 at 22 10 06
Byron commented 6 months ago

That's great, thanks so much for making all this happen!

Did you consider using the ellipsis character instead of ...? That way two more character slots might be freed up.

gosuwachu commented 6 months ago

I have just tried but don't like how it looks - it it so small it is easy to miss.

btw. I think search history may be potentially useful future addition to the glob search feature.

Byron commented 6 months ago

I have just tried but don't like how it looks - it it so small it is easy to miss.

For a moment I thought that letting it appear on top of the selection is on top would help, similar to what the 'message' line in the mark pane does - it follows the currently selected line to be more obvious.

In this case, it would determine its initial position based on the currently selected line, and then stay there. Even though in theory it can probably also follow the selection if the tab/pane-cycling logic can handle that.

btw. I think search history may be potentially useful future addition to the glob search feature.

It sounds complicated to do that UI wise, so I hope we can postpone this to another PR.

Besides, I'd be starting the review today in the hopes to merge tomorrow.

Byron commented 6 months ago

Review Notes

gosuwachu commented 6 months ago

@Byron Thanks Sebastian! It wouldn't be possible without the suggestions & feedback of people using it. I have used dua today to do "holiday cleaning" of my hard drive, and the tool you have created is great! I am happy to make my small contributions to help make it even better :)

This new release is going to be a great holiday gift! 🎁