"No staged changes (stage all?)" (Suggest Smart Commit) modal does not conform to Microsoft interface guidelines.
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.105.1 (user setup)
- OS Version: Windows 11 (Windows_NT x64 10.0.22631)
BLUF: The warning dialog when you try to commit with no staged changes could be a lot more explicit and more easy to quickly understand by altering the button text, which does not currently follow MS best practices.
Steps to Reproduce:
- Edit and save a file or files, but do not stage any.
- Hit the "Commit" button
[Window Title]
Visual Studio Code
[Content]
There are no staged changes to commit.
Would you like to stage all your changes and commit them directly?
[Yes] [Always] [Never] [Cancel]
This dialog does not conform to Microsoft app development dialog guidelines which state
Use specific responses to the main instruction or content as button text. An example is, "Do you want to allow AppName to access your location?", followed by "Allow" and "Block" buttons. Specific responses can be understood more quickly, resulting in efficient decision making.
This dialog almost always pops up when I thought I had staged all, then click commit, resulting in a moment of confusion where I see "yes" as an option I thought I was taking, have to pause and read the the dialog and recontextualize. The fact it's a warning dialog makes it particular jarring. I usually want to click yes, so it's a useful dialog, but not always.
(It's also unclear what the behavior will be if I hit "Never". Will it silently do nothing when I expected it to commit? Will it create an empty commit? Or will it still warn me? And where is this setting stored? There's no mention of "smart commit" in the dialog.)
A more clear design might be:
[Window Title]
Visual Studio Code - Stage all and commit? (Smart Commit)
[Content]
There are no staged changes to commit.
Would you like to stage all your changes and commit them directly (smart commit)?
[Stage All & Commit] [Always Smart Commit] [Never Smart Commit] [Cancel]
(I think "Auto-stage" is more clear than "Smart commit", but that's a separate issue)
Or if that's getting too long, a radio select might be appropriate:
[Window Title]
Visual Studio Code - Stage all and commit?
[Content]
There are no staged changes to commit.
Would you like to stage all your changes and commit them directly?
(•) Ask every time
( ) Enable smart commit (always commit all changes when there are no staged changes)
( ) Do not ask again (disable commit button when no staged changes)
(You can change this later in Settings › Git › Smart Commit)
[Stage All & Commit] [Cancel]
...with the primary button changing to [Save Preference] or [Do not ask again] when "Never" is selected.
And not strictly related this, but the description for the setting toggled by "Never" is poorly worded and difficult to understand, which contributes to the issue:
Git: Suggest Smart Commit
Suggests to enable smart commit (commit all changes when there are no staged changes)
I couldn't even grammatically parse that sentence until after I knew what it did. It's also misleading, because the relevant behavior the setting changes is enabling the commit button when there are no staged changes. Better would be something like:
Git: Suggest Smart Commit
Enable the commit button when the staging area is empty and offer to enable smart commit (if the commit button is pressed when the staging area is empty, stage all changes and commit)
Related: https://github.com/microsoft/vscode/issues/255602