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:
- We want to load discussions as soon as possible to avoid layout shifts
- We want users to be aware that diff has discussions even before they are loaded
- The loading should not depend on the order of leaving the comments, since users browse diffs, not discussions
- 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:
- Query all the diff top-level discussions but only fetch the IDs and diff positions (file path + line ranges), we'll call this 'landmarks'
- Send this data with the document
- Frontend should grab this data and show loading indicators for diff lines that have discussions
- 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 🤖