Alias filter
Press "/" when searching through new devices to filter them by alias via a popup dialog. I would be happy to swap out the String::contains with a fuzzy search algorithm, but I figured not to be worth the extra dependency.
Thanks for the PR :pray: I like the idea of filtering, I just have couple of comments:
- Show filter popup only when the
discovered devicesare not empty - Highlight with color the matching pattern in the name of the devices.
- Maybe instead of the popup, having it at the bottom of the block
Discovered deviceswould be better in term of the ux. and when the discarded (withescfor example) then the filter is gone.
I am willing to collaborate on this one if you need my help :)
I agree with those points and will get to implementing them when I can. I also seem to have introduced a bug I've experienced a few times but can't seem to reproduce. I get a "not found" error of some kind if I remember correctly. On another note, forgive me if my code isn't exactly idiomatic with respect to what is commonplace in Ratatui. This is my first time with the library and I am learning as I go.
no worries, I really appreciate your initiative to contribute, we are all here to learn. Again, let me know if you want to join forces and split the tasks so we can work on it together.
@Minterl any update on this PR ?
Sorry for the delay, I've been pretty busy.
Show filter popup only when the discovered devices are not empty Highlight with color the matching pattern in the name of the devices. Maybe instead of the popup, having it at the bottom of the block Discovered devices would be better in term of the ux. and when the discarded (with esc for example) then the filter is gone. I've implemented each of these.
No worries. I gave it a try and found some rendering issues actually:
- the popup is render in the bottom the frame, over the adapter section
- to cancel the search, I need to press
/then remove the text, which is inconvenient imo
to cancel the search, I need to press / then remove the text, which is inconvenient imo
I agree; now enter exits the popup while maintaining the filter pattern while esc discards it.
the popup is render in the bottom the frame, over the adapter section
I can move it to the bottom of the new devices table if you think that it would provide a better user experience, but I personally think that over the bottom of the screen is better since the likelihood that the user would need to see the adapter section and simultaneously filter the new devices is small. The alternative would mean that the bottom of the device list would likely get cut off when filtering.
any update on this one ? otherwise we might need to close it