Display lines added/deleted more accurately in merge request diff
Description
- When the mr diff first loads, all the files that return stats do so, and is stored in FE memory (or stored somewhere in some cache).
- For any file that has not yet returned stats, in the dropdown, simply do not show any stats, because we don't know it.
- When a big file is expanded, we get the stats, so we update the file nav to be
+1023 -1324
. - When that same file is subsequently collapsed, we save the stats in the "cache" ("Cache" here just means up to a page refresh), so that the file nav still has
+1023 -1324
. - For the top sticky label, if we know we have not accounted for all files, we simply say
Showing 5 changed files with at least 87 additions and at least 42 deletions
. We keep increasing those numbers as we get more stats. - When we know we have accounted for all files, the
at least
is removed from that label.
Original description
Running GitLab Community Edition 8.10.1 ee0488d1 I'm facing the following pb.
I'm reviewing a MR that says:
Showing 5 changed files with 87 additions and 42 deletions
Point is one of these 5 files is collapsed (so not really shown…) and its diff size isn't taken into account in the stats. Expanding this file won't change the stat and I can't see any way to discover the stat of this file's diff (except on my local repo with my cli
BTW a while ago, I've opened #5574 (closed) which is merely linked to the present issue.
Design
When the diff is too large, we show Click to see
on the right side of the list.
- Font size:
13px
- Color:
#A7A7A7
Edited by Hazel Yang