Navigate Multiple Comments

By using the Line comment navigator button on the floating tool bar in the Merge Request page's Changed Files tab, you can quickly locate files that have comments and easily navigate from comment to comment within a file. This can be quite a timesaver, especially when there are many changed files and the files themselves are large or contain many comments.

  1. Open the merge request.
  2. Go to the Changed Files tab, click the Line comment navigator Line comment navigator icon button on the floating toolbar.
    Floating toolbar with Line comment navigator selected

    The popup displays a list of comments. List of four changed files that contain comments. Three files are shown. The first changed file, dialog.js, contains two comments and the second changed file, javascript.js, contains one comment. The fourth file isn't shown. You'd have to use the scroll bar to get to it. That file also contains one comment.

    In this MR, there are two comments in the first file and one in the one shown further down the list.

  3. Click the first file name link (dialog.js) for the comment you want to go to and the file will open in the code editor.
    Code editor window showing dialog.js with two comments.

    Comments are displayed inline and are identified by the Line comment icon icon to the left.

  4. On the right side of the comment, you can use the Previous comment Previous comment icon and Next comment Next comment icon icons to navigate to the previous or next comment.

    The dialog.js file has two comments. Notice that the Previous Comment Previous comment icon icon in the first comment is grayed out. It is the first comment found in the changed files, so there is no previous comment to go to.

  5. Click the Next comment Next comment icon icon to go to the second comment in the dialog.js file.
    Second comment in dialog.js file
  6. Click Next Comment Next comment icon icon again and you'll go to the comment in the next changed file, javascript.js.
    Comment in next changed file, javascript.js
Note that the floating navigation menu is always visible so, if you need to, you can always return to the list of comments by clicking the Line comment navigator Line comment navigator icon button.