Skip to content

fix(@typegpu/cli): remove default name suggestion, leave just placeholder#2545

Open
zichen0116 wants to merge 1 commit into
software-mansion:mainfrom
zichen0116:fix/remove-default-name-suggestion
Open

fix(@typegpu/cli): remove default name suggestion, leave just placeholder#2545
zichen0116 wants to merge 1 commit into
software-mansion:mainfrom
zichen0116:fix/remove-default-name-suggestion

Conversation

@zichen0116
Copy link
Copy Markdown

What

Remove initialValue from the p.text() prompts in getProjectDirectory and getPackageName, keeping only the placeholder (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: Removed initialValue from p.text() options; empty input falls back to the default value
  • getPackageName: Removed initialValue from p.text() options; empty input falls back to the default value
  • Renamed parameter from initialValue to defaultValue for clarity

Fixes #2542

…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
Copilot AI review requested due to automatic review settings May 24, 2026 23:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 initialValue from p.text() options for project directory and package name prompts, leaving only placeholder.
  • Updated empty-input handling to fall back to the provided default value.
  • Renamed the function parameter from initialValue to defaultValue for 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;
},
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.

fix(@typegpu/cli): Remove the default name suggestion, leave just placeholder

2 participants