[go: up one dir, main page]

[Design] Commenting in merge requests with context

Proposal

Introduce an ability to toggle between modes of comment and review. The modes will adapt the button order based on who the user is (author or reviewer) and the context that the note is in (reply or new note) to determine default button order and based on user action we would remember that preference for future.

Figma

reply-with-modes

This is a design concept that combines ideas from these related issues

Assumptions

  1. "Add to review" should always be the default action
    • Respecting original intent of the feature
  2. Who the user is can be simplified to IsReviewer (true/false)
    • We can assume that in most cases an Author would not use a review as their default action and that since we don't know what role a participant is that we would default to commenting actions.
  3. The context of the note can be simplified to IsReply (true/false)
    • Replying to a thread was a common feedback that we should just default to "Reply" rather than adding to a review so we will start with that as default actions.

Mockups

Comment - Add to review Comment - Submit review Comment - Comment now
image image image
Reply - Add to review Reply - Submit review Reply - Reply comment
image image image
Overview - Add to review Overview - Submit review Overview - Comment
image image image

Problem background

Today when a user is ready to comment they are presented with actions in this order:

  • Add to review
  • Add comment now
  • Cancel

image

This is was an intentional decision to order the buttons in this manner (2018)

The original intent behind 'Start a review/Add to review' aimed to encourage users to leverage reviews for batch comment processing and approvals. However contextual factors such as who was taking the action (the author or a reviewer) and whether they were replying to an existing comment or creating a new note has lead to users making errors when trying to leave feedback.

The problem with this is users do not always want to add a comment to a review, for example when replying in a thread #387369 (comment 2887505187):

A reply should really not start a review process. I spend replying to comments all day long and dozens of times a day I have to edit comment > copy content > cancel > delete comment > make comment again > click on "add comment directly" with mouse. It's super annoying.

Related history Add ability to `Add comment now` in middle of a... (#369485)

Or when using cmd+enter to submit their feedback, it automatically adds it in as part of a review when the user wants to send the comment immediately. This is a common theme that has been expressed by GitLab team members and the community Improve first time experience for "merge reques... (#222334 - closed).

Edited by Michael Le