Skip to content

feat(prompts): add autocomplete support for text prompts #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

holmityd
Copy link

This commit introduces autocomplete functionality for text prompts, allowing users to provide a list of suggestions or a function to generate suggestions dynamically. The feature enhances user experience by enabling faster and more accurate input.

This commit introduces autocomplete functionality for text prompts, allowing users to provide a list of suggestions or a function to generate suggestions dynamically. The feature enhances user experience by enabling faster and more accurate input.
…ibility

The autocomplete function now returns a `Promise<string | undefined>` instead of `Promise<string[]>`. This change simplifies the autocomplete logic by allowing a single matched option to be returned directly, improving code clarity and reducing unnecessary array handling. Furthermore, this commit enhances matching flexibility by allowing users to configure how options are selected. Instead of strictly relying on the `startsWith` function, users can now define custom matching logic to include options based on whether the input *includes* a substring, perform case-insensitive matching, or implement other advanced filtering criteria. This provides greater control over the autocomplete behavior and accommodates a wider range of use cases.
Copy link

changeset-bot bot commented Apr 14, 2025

⚠️ No Changeset found

Latest commit: d0e22ec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant