-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Improve clarity of 'dotnet project convert' output directory prompt #51443
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
base: release/10.0.2xx
Are you sure you want to change the base?
Conversation
Updated the prompt message to clarify: - That pressing Enter will use the default directory shown - That the output directory must not already exist Old prompt: "Specify the output directory (hello):" New prompt: "Specify the output directory (press Enter for default: 'hello', directory must not exist):" This addresses user confusion when converting file-based apps to project-based apps. Fixes dotnet/sdk issue about CLI output directory clarity. Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the user experience of the dotnet project convert command by making the output directory prompt clearer and more informative, addressing user confusion about default values and directory requirements.
Key changes:
- Updated the prompt message to explicitly indicate that pressing Enter uses the default value
- Added clarification that the output directory must not already exist
- Properly marked localization files for translation review
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Cli/dotnet/Commands/CliCommandStrings.resx | Updated the ProjectConvertAskForOutputDirectory resource string with clearer prompt text |
| src/Cli/dotnet/Commands/xlf/*.xlf | Automatically updated localization files with new source text and marked targets as needs-review-translation |
| </data> | ||
| <data name="ProjectConvertAskForOutputDirectory" xml:space="preserve"> | ||
| <value>Specify the output directory ({0}):</value> | ||
| <value>Specify the output directory (press Enter for default: '{0}', directory must not exist):</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't couple the 'prompt' string and the 'detail' clarification - we need the two texts separate because the 'real' prompt (from Spectre when that is merged) will display the 'detail' clarification (as well as the 'default' value portion of the prompt) in different ways and in different locations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know Spectre prompts had some detail clarification part (I don't see it in the docs either).
As for the default part, Spectre doesn't allow customizing that other than via the prompt text anyway, like
new TextPrompt<T>($"...original prompt... [grey](default: {Markup.Escape($"{defaultValue}")})[/]:")
.DefaultValue(defaultValue)
.HideDefaultValue();(note that this should currently be done always if the default value can be arbitrary to avoid spectreconsole/spectre.console#1181 as Spectre doesn't Markup.Escape the default value itself)
So I'm unsure how exactly you imagine the split here - and anyway that sounds like premature refactoring unless we actually have Spectre.
Summary
Improves the user experience when converting file-based apps to project-based apps by making the output directory prompt clearer and more informative.
Problem
When running
dotnet project convertin interactive mode, users encountered a confusing prompt:This led to confusion because:
(hello)was the default valueAs shown in the reported issue, users would try entering their current directory path, see "The target directory already exists" error, and be confused about what action to take.
Solution
Updated the prompt to be explicit and helpful:
Before:
After:
Changes
ProjectConvertAskForOutputDirectoryresource string inCliCommandStrings.resxstate="needs-review-translation"Testing
DotnetProjectConvertTestspass without modificationBenefits
Fixes #[issue number]
Original prompt
Fixes #50934
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.