Skip to content

Investigate new discussions loading strategy

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Discussions on diffs have very specific requirements:

  1. We want to load discussions as soon as possible to avoid layout shifts
  2. We want users to be aware that diff has discussions even before they are loaded
  3. The loading should not depend on the order of leaving the comments, since users browse diffs, not discussions
  4. Discussions can not be all loaded with the document or with a single API call due to UGC nature

To solve these problems we could investigate into a following strategy:

  1. Query all the diff top-level discussions but only fetch the IDs and diff positions (file path + line ranges), we'll call this 'landmarks'
  2. Send this data with the document
  3. Frontend should grab this data and show loading indicators for diff lines that have discussions image
  4. At the same time frontend should start loading discussions using the landmarks information based on file order, while prioritising diffs in the current view
Edited by 🤖 GitLab Bot 🤖