-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Hi,
Our UX team at Google explored how to add expose actions to the Commenting mechanism. I'm copying below their doc.
With the goal to improve discoverability and to promote certain actions on comment threads to be similarly prominent as "Reply" (e.g. for quick actions like "mark this thread as resolved with a canned reply, or viewing a suggested edit), we are proposing a feature that helps us to achieve this goal.
Part 1
The flow starts with an “Unresolved” comment from a reviewer. The current user is assumed to be the author of the change / pull request, who will generally not leave very lengthy comment replies, but instead address suggestions in code and mark the thread as resolved with a standard reply like “Done.” for the reviewer to take another look.
“Reply” button will be a split button that displays secondary actions. The goal to place these secondary buttons here is to help users to take actions without opening the “reply” textarea.

Also, we want to display a “context menu” (3 dots menu) next to the buttons located on the right top corner from each comment. There users can find actions related to the comment like “Resolve and save”. Adding this menu will give us the flexibility to offer more actions to users without overloading the UI.
Since multiple code review tools have the ability to attach a suggested fix, the "Show Edit" button could be added by VS Code, with a new API. This would be very useful because this action should be easily discoverable (since it's not attached to every comment, users may not search for it in a submenu) - it could be on the same level as Reply.
Part 2
This proposal is an upgrade from the previous one.
Unresolved comments allows users to “Reply”, “Resolve the comment or View edit” (We will display 2 buttons maximum, those buttons change depending on the context of the comment).
If a user opens the reply text area, we offer assistive chips with quick replies.
This proposal can scale to add new functionality. E.g. automated responses based on context.

From a Technical point of view:
We need a mechanism to say "this action is like a reply". I think we might be able to introduce a new magic value for the group property in menu contributions to achieve this: https://code.visualstudio.com/api/references/contribution-points#contributes.menus. Alternatively we could create a new menu contribution point, instead of comments/commentThread/context it could be comments/commentThread/inline or something.
Commands affecting a comment thread in VS Code can currently be contributed to two menus: comments/commentThread/title and comments/commentThread/context. The commands for title are shown as icons in the top right corner of the comment thread widget, the commands for context are shown as buttons while the user is typing a reply.
In our case, the quick actions described above should be available to users without having to start typing a reply, so they are contributed to the title menu. To promote some of them to buttons next to “Reply …” or as “reply-like” actions in the overflow menu of a split “Reply” button, they should ideally be distinguished from other commands contributed to the title menu, which should not get the same visual treatment, e.g. because they are secondary actions performed only infrequently by users.
The group property on menu items currently supports a special navigation value. It might be an option to introduce a new magic value here to mark “reply-like” commands.
Another approach might be to define a new menu to contribute commands to, like comments/commentThread/quickActions.


