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

Context menu for comment threads #151533

Open
laurentlb opened this issue Jun 8, 2022 · 9 comments
Open

Context menu for comment threads #151533

laurentlb opened this issue Jun 8, 2022 · 9 comments
Assignees
Labels
api api-proposal comments Comments Provider/Widget/Panel issues feature-request Request for new features or functionality
Milestone

Comments

@laurentlb
Copy link
Contributor

From @alexr00 (in #150824):

Finally, for comments it might be nice to have all these actions in a context menu on the whole comment peek view. I don't think I'm the only one who will right click on things to see if there are some actions I don't know about.

I think that's a simple feature to add:

  1. Add a 3-dot menu on the comment thread title (at the right of other contributed icons)
  2. Support right-clicking on the comment thread title

The combination of 3-dot + right-click already exists in other parts of vscode and would improve the experience on wide screens.

This would also help us rely less on icons. New users are often confused with all the icons. Plus, there are multiple features we didn't expose precisely because they cannot be explained with an icon.

cc @hermannloose

@alexr00 alexr00 assigned alexr00 and unassigned rebornix Jun 9, 2022
@alexr00 alexr00 added this to the June 2022 milestone Jun 9, 2022
@alexr00 alexr00 added feature-request Request for new features or functionality comments Comments Provider/Widget/Panel issues labels Jun 9, 2022
@alexr00
Copy link
Member

alexr00 commented Jun 9, 2022

Add a 3-dot menu on the comment thread title (at the right of other contributed icons)

This one may actually be possible for extensions to do with submenus. I'll double check.

@alexr00
Copy link
Member

alexr00 commented Jun 9, 2022

Optimistically adding for June, but will likely end up moving to July.

@alexr00
Copy link
Member

alexr00 commented Aug 9, 2022

Menu proposal (name will likely change):

		"menus": {
			"comments/commentThread/widget/context": [

			]
		}

We already have comments/commentThread/context so we can't use that.

The current proposal shows the same context menu when you right click anywhere in the comment thread widget (title, individual comment, etc.) and passes the comment thread object to the command that's executed. @laurentlb, would you expect to have different context menus depending on where the right click happened?

echarles pushed a commit to datalayer-externals/vscode that referenced this issue Aug 9, 2022
@laurentlb
Copy link
Contributor Author

That sounds reasonable.

It's possible that someone would want a separate menu when clicking on a specific comment (this could be added later if needed).
So maybe don't show any menu when clicking on an individual comment?

@alexr00
Copy link
Member

alexr00 commented Aug 10, 2022

I got some more feedback on the initial proposal. Changes include:

  • We now have 2 context menus: 1 for the thread title and 1 for individual comments
  • Menu name has changed
    • comments/commentThread/title/context
    • comments/commentThread/comment/context

For a full example of how to these menus can be used, you can see microsoft/vscode-pull-request-github#3835

joyceerhl pushed a commit that referenced this issue Aug 10, 2022
pull bot pushed a commit to Prequal-Digital/vscode that referenced this issue Aug 10, 2022
@alexr00 alexr00 modified the milestones: August 2022, September 2022 Aug 18, 2022
@alexr00 alexr00 modified the milestones: September 2022, October 2022 Sep 2, 2022
@sergei-dyshel
Copy link

sergei-dyshel commented Oct 1, 2022

@alexr00
Can you please explain how comments/commentThread/title/context is supposed to be used? I've installed pre-release version v0.51.2022092909 of Github extension, which apparently includes Try out the thread context menu proposal PR and it has the following menu entries:

			"comments/commentThread/title/context": [
				{
					"command": "pr.resolveReviewThread",
					"group": "inline@3",
					"when": "commentController =~ /^github-(browse|review)/ && commentThread == canResolve"
				},
				{
					"command": "pr.unresolveReviewThread",
					"group": "inline@3",
					"when": "commentController =~ /^github-(browse|review)/ && commentThread == canUnresolve"
				}
			],
			"comments/commentThread/comment/context": [
				{
					"command": "pr.resolveReviewThread",
					"group": "inline@3",
					"when": "commentController =~ /^github-(browse|review)/ && commentThread == canResolve"
				},
				{
					"command": "pr.unresolveReviewThread",
					"group": "inline@3",
					"when": "commentController =~ /^github-(browse|review)/ && commentThread == canUnresolve"
				}
			],

However when I look at comment thread in vscode, I only see
image
, e.g. it shows button that corresponds to comments/commentThread/comment/context, but not comments/commentThread/title/context.

Using VScode 1.71 of course

@alexr00
Copy link
Member

alexr00 commented Oct 3, 2022

@sergei-dyshel thanks for trying this out! It's a right click context menu, so there's no UI for it in the comment widget itself. You can access the menu by right clicking in the title part of the widget and the body part of the widget, respectively.

@sergei-dyshel
Copy link

Ohh, missed that somehow. I was looking for some "big blue button " in the title section. Thanks for clarification :)

@alexr00 alexr00 modified the milestones: October 2022, November 2022 Oct 4, 2022
@alexr00
Copy link
Member

alexr00 commented Oct 25, 2022

If anyone wants to use this API in an extension please comment so that I can gauge whether this is worth finalizing.

@alexr00 alexr00 modified the milestones: November 2022, Backlog Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api api-proposal comments Comments Provider/Widget/Panel issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants