fix(@typegpu/cli): remove default name suggestion, leave just placeholder#2545
Open
zichen0116 wants to merge 1 commit into
Open
fix(@typegpu/cli): remove default name suggestion, leave just placeholder#2545zichen0116 wants to merge 1 commit into
zichen0116 wants to merge 1 commit into
Conversation
…lder Remove from text prompts in getProjectDirectory and getPackageName so that only the placeholder (grey hint text) is shown, rather than pre-filling the input with a default value. When the user submits an empty input, the default value is used as a fallback, preserving the original behavior while giving users a cleaner prompt experience. Fixes software-mansion#2542
There was a problem hiding this comment.
Pull request overview
Removes pre-filled default values from @typegpu/cli text prompts so users aren’t nudged into accepting tgpu-project (or other defaults) without thinking, while still showing a placeholder hint and falling back to a default on empty input.
Changes:
- Removed
initialValuefromp.text()options for project directory and package name prompts, leaving onlyplaceholder. - Updated empty-input handling to fall back to the provided default value.
- Renamed the function parameter from
initialValuetodefaultValuefor clarity.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
31
to
35
| message: 'Package name:', | ||
| placeholder: initialValue, | ||
| initialValue, | ||
| placeholder: defaultValue, | ||
| validate: (value) => { | ||
| return !value || !isValidPackageName(value) ? 'Invalid package name.' : undefined; | ||
| return value && !isValidPackageName(value) ? 'Invalid package name.' : undefined; | ||
| }, |
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.
What
Remove
initialValuefrom thep.text()prompts ingetProjectDirectoryandgetPackageName, keeping only theplaceholder(grey hint text).Why
Currently both prompts pre-fill the input field with a default value (
tgpu-project). This makes it easy to accidentally accept the default without thinking about a good project name. Showing only the placeholder as a hint encourages users to choose their own name while still providing a suggestion.Changes
getProjectDirectory: RemovedinitialValuefromp.text()options; empty input falls back to the default valuegetPackageName: RemovedinitialValuefromp.text()options; empty input falls back to the default valueinitialValuetodefaultValuefor clarityFixes #2542