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

Change contextMenuItem click to mouseup #557

Closed
githrdw opened this issue Aug 25, 2021 · 1 comment
Closed

Change contextMenuItem click to mouseup #557

githrdw opened this issue Aug 25, 2021 · 1 comment
Assignees
Labels
improvement An improvement to existing functionality
Milestone

Comments

@githrdw
Copy link

githrdw commented Aug 25, 2021

Describe the improvement that you'd like
I am using Git Graph on daily basis and something I can't unlearn myself is the fact that I press the left mouse button in the context menu before selecting a contextMenuItem.
The context menu will close, but no action (handler) is called.

I have already tried to focus and hold my mouse still before clicking on a context item, but unfortunately I keep failing to stick to this behaviour😅

Additional context (optional)
The solution is fairly easy, as only this click event has to be mouseup:

addListenerToClass('contextMenuItem', 'click', (e) => {

So I tested this solution locally and it's working exactly how my mind expects it to work.

(also thanks and compliments on your work, could not live without it)

@githrdw githrdw added the improvement An improvement to existing functionality label Aug 25, 2021
@mhutchie mhutchie added this to the v1.31.0 milestone Sep 19, 2021
@mhutchie
Copy link
Owner

Hi @githrdw,

Thanks for raising this improvement request and providing an implementation for it.

The reason for using the click event is that it requires the user to press and release the pointer on a specific action. Considering it's critical that the user doesn't accidently run the wrong Git action, I felt having this extra certainty was beneficial.

From the description you provided, I see how the mouseup event may work better for you (and other users like you). However, I could alternatively justify using the mousedown event for similar reasons for some other users. By using the mouseup or mousedown event it potentially negatively impacts the users in the other group. I ultimately feel that using the click event is a nice & unambiguous middle ground that.

I experimented with various other ways to improve the behaviour, and found an alternative way to improve the current experience somewhat, while still using the click event.

Action Previous Behaviour New Behaviour
User clicks on a context menu item Action handler is called Same as Previous Behaviour
User clicks within the context menu (but not on a specific item) Context menu is closed Context menu stays open, allowing the user to reattempt clicking on a specific item
User clicks outside the context menu Context menu is closed Same as Previous Behaviour

This will be available in v1.31.0.

If you'd like to use it before the next release, you can download v1.31.0-beta.3, and install it following the instructions provided here.

homsai pushed a commit to homsai/vscode-git-graph that referenced this issue Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants