Skip to content

Toggle MR diffs File Tree "viewed" status (bold) based on file header Viewed checkbox

Thomas Randolph requested to merge tor/feature/file-tree-viewed-check into master

What does this MR do and why?

For #327135 (closed)

This MR has one addition:

  1. When clicking the "Viewed" checkbox in the Diff File header on the MR Changes tab, the File Tree file entry is marked as "viewed" (unbolded). Likewise, when unchecking the "Viewed" checkbox, the File Tree file entry is marked as unviewed (bolded).

It also has one (broad) deletion:

  1. The File Tree file entries no longer respond by unbolding (marking as viewed) when files are scrolled to, clicked on, or otherwise "seen."

In other words, the File Tree bolding (seen vs. unseen status) is now solely linked to the "Viewed" checkbox.

Reviewing

I strongly recommend reviewing this commit-by-commit, rather than holistically.

The first commit adds a mutation that's needed for this feature (toggling the viewed status of a file in state).
The second commit is the new feature.
The last two commits clean up existing names of mutations and actions.

Screenshots or screen recordings

Before After
simplescreenrecorder-2021-11-03_19.49.04 Please enjoy this video in which Rails in unbearably slow and every time I have to reload the page you'll wonder "did the video end?"
simplescreenrecorder-2021-11-03_20.04.47

How to set up and validate locally

  1. You need an MR with some diff files in it.
  2. Click a file name in the file tree
  3. Click a file header filename
  4. Reload the page
  5. Note that all of the previous three steps have behaviors (scrolling to the file, updating the URL, scrolling to the file after load), but none of them unbold the file name in the file tree
  6. Check the "Viewed" checkbox on a file (you will need to be logged in)
    • Note that the file name is not bold in the file tree
  7. Uncheck the "Viewed" checkbox on a file
    • Note that the file name is bold in the file tree

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Randolph

Merge request reports