Skip to content
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

should the commit button be hidden when there are no staged changes? #153707

Closed
meganrogge opened this issue Jun 29, 2022 · 9 comments
Closed

should the commit button be hidden when there are no staged changes? #153707

meganrogge opened this issue Jun 29, 2022 · 9 comments
Assignees
Labels
feature-request Request for new features or functionality git GIT issues on-testplan
Milestone

Comments

@meganrogge
Copy link
Contributor

Testing #153317
I noticed this bc the button made me think that I had forgotten to commit changes I had staged
Screen Shot 2022-06-29 at 11 32 53 AM

@jcezarms
Copy link

At first I thought greying out the button would be a more consistent approach, but this could both be made unintuitive accessibility- and theme-wise, so hiding until staging is done is best.

@lszomoru lszomoru added git GIT issues under-discussion Issue is under discussion for relevance, priority, approach labels Jun 29, 2022
@lszomoru lszomoru added this to the July 2022 milestone Jun 29, 2022
@lszomoru
Copy link
Member

One thing to keep in mind is that depending on user settings one can commit changes that are not yet staged. Next milestone I will take a look at the various settings and I will factor in the settings value in the logic that displays the commit action button.

@heartacker
Copy link
Contributor

this would address
#135992 (comment)

👍

@lszomoru
Copy link
Member

lszomoru commented Jul 5, 2022

@meganrogge, could you please share the following user settings:

  • git.enableSmartCommit
  • git.suggestSmartCommit
  • git.smartCommitChanges

@meganrogge
Copy link
Contributor Author

Not sure what they were when i encountered this (probably whatever is specified in the TPI), but they're currently

  1. false
  2. true
  3. all

@lszomoru
Copy link
Member

lszomoru commented Jul 5, 2022

Thanks! The TPI does not mention any of the smart commit settings so I will assume that the state of these settings was the same. Even though you have git.enableSmartCommit disabled, do you have git.suggestSmartCommit which means that in your screenshot above, the "Commit" button is the right button to display. If you were to click on in, you will see the smart commit dialog showing you the various options that you have.

If both git.enableSmartCommit and git.suggestSmartCommit are disabled, given the state in your screenshot, the correct button to show would be "Sync Changes" as clicking "Commit" is not actionable given your settings. These improvements will be included in the Insiders released soon.

@lszomoru lszomoru added feature-request Request for new features or functionality and removed under-discussion Issue is under discussion for relevance, priority, approach labels Jul 5, 2022
@lszomoru
Copy link
Member

The git.enableSmartCommit, git.suggestSmartCommit, and git.smartCommitChanges settings are now factored in when deciding whether to enable/disable the "Commit" action button. The "Commit" action button will show as enabled in case one of the following commands is true:

  • git.enableSmartCommit === true && git.smartCommitChanges === 'all'
  • git.enableSmartCommit === true && git.smartCommitChanges === 'tracked' && stagedChanges > 0
  • git.enableSmartCommit === false && git.suggestSmartCommit === true

@heartacker
Copy link
Contributor

@lszomoru could it be hide entirely(not just disable) when git.enableSmartCommit === false && git.suggestSmartCommit === false

image

and show them when there are staged files

@lszomoru
Copy link
Member

@heartacker, I will continue to monitor customer feedback and will adjust the behaviour accordingly.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality git GIT issues on-testplan
Projects
None yet
Development

No branches or pull requests

4 participants