[go: up one dir, main page]

Skip to content

Handle special Diff File scenarios when jumping/scrolling to unresolved discussions

Context

In #344133 (closed), we fixed the front end algorithm that moves the browser scroll position among unresolved discussions.
This "simply" changes the order that the front end sorts the discussions into to match the order of the Diff Files as they're returned by the API.

Now - no matter what order the discussions are in - moving through them will visually follow the order of the Diff Files, which is not what you would expect in some scenarios (e.g. it seems to order by commit date first, then filename, which is a bit unexpected).

Problem

There are still unresolved issues with jumping among unresolved discussions, however.

  • What should we do if the unresolved discussion is on a collapsed file?
    • should we forcibly uncollapse that file?
  • What should we do if a change is too large to display automatically, but small enough to load manually on demand, so it can have comments on lines of code that may not be loaded?
    • should we trigger a code load when the user jumps to a "too big" file? How does that display as the code loads (probably pretty slowly?)
  • Should we skip these scenarios?
    • If we do, we can't block the MR based on unresolved discussions, because there's no way for the user to navigate to them without knowing what files to open/load.

Roadmap (copied from previous Merge Requests)

MR Description
!85284 (merged) This prior change stored the order as received from the API on each Diff file before it's processed and - eventually - placed in the local store.
!85536 (merged) This prior change swapped the processing of files when progressing through unresolved discussions to use the API-provided sort order, since that's the order files are displayed in the UI.
We're here! 👉🏻 This future change will add more nuance to the progression through unresolved discussions by handling certain cases that aren't currently handled, like when a file is collapsed because it's too big (but has had a comment attached to it anyway!), or if a file is manually collapsed (and so the comment is not visible).