[go: up one dir, main page]

Skip to content

Jump to next unresolved discussion doesn't order the discussions in the same way the UI does in the Changes tab

Summary

The Jump To Next Unresolved Discussion button sometimes jumps to discussions in the wrong order.

Steps to reproduce

The basic problem is that the UI shows the changes based on an unknown algorithm that appears to be something like:

  1. Order by commit first
  2. Then alphanumeric by file name

So to set this up, you need multiple commits.

  1. Create a commit editing a file like zoo.txt
  2. Push it to the MR
  3. Create a new commit editing a file like animals.txt
  4. Push it to the MR
  5. Make sure you have Diffs Virtual Scrolling Enabled Virtual Scrolling is enabled by default. Please ensure you have not manually disabled it, and are not viewing the MR in single-file mode.
  6. Leave a comment on both files. You can start at the top and work your way down, but it doesn't matter what order you actually leave the comments in.
  7. Based on the UI display of the files, you should see the comment on zoo.txt first when you click the Jump To Next button, then the comment on animals.txt
  8. You are actually jumped to the animals.txt comment first, then looped back around to the zoo.txt comment.

Example Project

This happens in any project.

What is the current bug behavior?

The code to sort the discussions is sorting first by filename, then by line number.

This doesn't match the way the files are displayed in the UI.

What is the expected correct behavior?

The order of the discussions to jump through should match the order they appear on the screen.

Output of checks

This bug happens on GitLab.com

Possible fixes

The code that sorts the discussions is in the Notes app Vuex getters. I think it's likely (but not guaranteed) that we'll need to coordinate this sorting algorithm with the UI display that orders the files differently.

Edited by Thomas Randolph