Skip to content

Update Diff app so that Jump To Next Unresolved Thread tracks progress through page

Thomas Randolph requested to merge tor/feature/jump-to-next-track-scroll into master

What does this MR do and why?

Re-adds reverted feature, but using a new utility instead of a component.

Do not merge until after !75067 (merged)

For #281947 (closed)

As you scroll down the page, when an unresolved discussion crosses the middle line of the page, it is considered "seen."

Once a discussion is seen, the Jump To Next Unresolved Discussion button will always look to the most recently "seen" discussion to compute what the next discussion is.

If you scroll up such that an unresolved discussion is moving down the page, that discussion is considered the "next" one.

Timeline

MR Description
!71508 (merged) The original implementation of this SAME feature, which uses GlIntersectionObserver to implement visibility-based progress tracking
!74948 (merged) 👆🏻 Is reverted due to the component modifying the UI
!75067 (merged) Adds a programmatic-only utility for IntersectionObservers
👉🏻 This MR, Re-enabling of the visibility-based progress tracking

Screenshots or screen recordings

Unfortunately, there isn't really a substantial visual change.

How to set up and validate locally

  1. Create an MR with some changes
    • Preferably, these changes will span a few pages of scrolling so any scrolling effects are easier to see
  2. Add some discussions
    • Preferably spaced out among the changes so that moving among them is a clear context change.
  3. Scroll past at least one discussion
    • Where "discussion" is the first note in an unresolved thread
    • and "past" is the top of the note is 50%+ up the page
  4. Use the Jump To Next Unresolved Discussion button
    • Repeat as often as necessary

Before this MR, you'll note that the button always moves you in a linear fashion through the discussions (#344133 (closed) notwithstanding). Once you've scrolled past a discussion, clicking the button will actually take you back above it because it's not tracking where you've scrolled.

As a result of this MR, you'll notice that any time a discussion has made it at least half way up the screen, the Jump button goes to the next discussion after that one.
Similarly, if you scroll back up so that that discussion dips below the halfway mark, the Jump button then considers that discussion the next one to scroll to.

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