Skip to content

feat(textinput): expose matched suggestions and index#556

Merged
meowgorithm merged 1 commit intocharmbracelet:masterfrom
luevano:textinput-expose-sugs
Sep 19, 2024
Merged

feat(textinput): expose matched suggestions and index#556
meowgorithm merged 1 commit intocharmbracelet:masterfrom
luevano:textinput-expose-sugs

Conversation

@luevano
Copy link
Copy Markdown
Contributor

@luevano luevano commented Jul 17, 2024

In its current state, if I want to get the matched suggestions (and their index) I need to recalculate that myself when the bubble already does this for free (as in already available). This allows to use the matching suggestions data to display any sort of custom views.

For example, in its current state, if I want to list the suggestions I only have access to the Available ones, and this is all I can display (without recalculating myself):
image
image

With these exposed methods, now I can display more "complex" views, such as:
image

Pardon the styling, just a placeholder.

@luevano luevano requested a review from meowgorithm as a code owner July 17, 2024 10:38
@meowgorithm
Copy link
Copy Markdown
Member

Good call; I believe this makes sense.

Fwiw, I think there are a lot of improvements that can happen to suggestions in general and I've been wondering if the API needs to be reexamined altogether.

@caarlos0 caarlos0 added the enhancement New feature or request label Aug 13, 2024
@bashbunni bashbunni added this to the v0.22.0 milestone Sep 19, 2024
@meowgorithm meowgorithm merged commit 4382fdf into charmbracelet:master Sep 19, 2024
@meowgorithm
Copy link
Copy Markdown
Member

This is a good one. Thanks for the contribution, @luevano.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants