textual icon indicating copy to clipboard operation
textual copied to clipboard

[FEAT] AutoComplete widget

Open TomJGooding opened this issue 2 years ago • 8 comments

I can't see anything on the roadmap, so are there plans to add a AutoComplete widget to Textual?

The terms get a bit confusing, but by autocomplete I mean a dynamic dropdown list, like you see pretty much everywhere.

Textual already has a Select widget, Input and now a Command Palette, so it might surprise people that there isn't a widget for this (I am aware of other libraries)

TomJGooding avatar Sep 20 '23 22:09 TomJGooding

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

github-actions[bot] avatar Sep 20 '23 22:09 github-actions[bot]

Like https://github.com/darrenburns/textual-autocomplete?

davep avatar Sep 20 '23 22:09 davep

Yes something like lextual-autocomplete. Are there plans to add a widget like this to Textual?

(I am aware of this project and obviously Darren's involvement with Textual, which I hope doesn't make this feature request awkward)

TomJGooding avatar Sep 20 '23 22:09 TomJGooding

We were just discussing that today. I think there should be an autocomplete in the core lib.

willmcgugan avatar Sep 20 '23 22:09 willmcgugan

Thanks Will. That's a bit spooky, I really do spend too much time here if I'm somehow picking up your internal discussions...!

TomJGooding avatar Sep 20 '23 22:09 TomJGooding

@davep please sweep the office for bugs.

willmcgugan avatar Sep 21 '23 06:09 willmcgugan

Live scenes from the sweep...

starship-troopers-shoot

davep avatar Sep 21 '23 08:09 davep

The core functionality of an AutoComplete widget seems to have already been worked out in the command palette.

I confess I don't fully understand the code yet so perhaps this is naive, but couldn't a good chunk be extracted to this new AutoComplete widget (then used to derive the command palette)?

I did spend some time experimenting with this idea, but got a bit stuck understanding the command provider.

TomJGooding avatar Nov 09 '23 21:11 TomJGooding

I think @darrenburns 's textual-autocomplete may become the officially recommended solution.

willmcgugan avatar Jul 15 '24 14:07 willmcgugan