feat: rework path, remove suggestion prompt#335
Merged
Conversation
🦋 Changeset detectedLatest commit: e89cd5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@example/basic • @example/changesets commit: |
dreyfus92
approved these changes
May 30, 2025
Collaborator
Author
|
@manuel3108 would you be able to try this branch out in svelte? It includes the placeholder changes in main that unblock your unforking |
Collaborator
Author
|
@dreyfus92 im going to open an issue to track updating the docs, as the original PR didn't add any either so we are missing a few entries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After some thought recently, I came to the conclusion that the
pathandsuggestionprompts shouldn't exist in their current form.The
pathprompt is a file selector - but is basically giving a poorer equivalent of the autocompletion UX. Instead of providing two ways to render completions, I think we should settle on the autocompletion prompt and remove the suggestion prompt.This means the
pathprompt now uses the autocompletion prompt, but withoptionssourced from the file system.Notable changes
valueon<RETURN>rather thanfinalizeevent. This allows us to set thevaluebefore validation occurs, so we can then validate against the completed pathbeforePromptand instead provides aninitialUserInputwhich can be used to set the input without setting thevaluevalidatefunction and will render validation errorsBehavioural differences compared to the old
pathIn the old
path, you could enter a value which doesn't exist as an option and it would be set as the result on submit.In the new
path, you must select a value. you can no longer submit arbitrary/unknown valuescc @dreyfus92
also @MacFJA you put plenty of work into these two prompts, i know. i think it is sensible to consolidate, though. we can maintain one core prompt instead of two here and reduce the maintainer burden. this will also keep the UX consistent.
let me know what you both think