bluetui icon indicating copy to clipboard operation
bluetui copied to clipboard

Alias filter

Open Minterl opened this issue 1 year ago • 7 comments

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.

Minterl avatar Feb 23 '25 00:02 Minterl

Thanks for the PR :pray: I like the idea of filtering, I just have couple of comments:

  1. Show filter popup only when the discovered devices are not empty
  2. Highlight with color the matching pattern in the name of the devices.
  3. 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 am willing to collaborate on this one if you need my help :)

pythops avatar Feb 24 '25 14:02 pythops

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.

Minterl avatar Feb 24 '25 17:02 Minterl

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.

pythops avatar Feb 25 '25 12:02 pythops

@Minterl any update on this PR ?

pythops avatar May 10 '25 12:05 pythops

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.

Minterl avatar May 11 '25 02:05 Minterl

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

pythops avatar May 11 '25 08:05 pythops

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.

Minterl avatar May 12 '25 17:05 Minterl

any update on this one ? otherwise we might need to close it

pythops avatar Oct 20 '25 21:10 pythops