Page MenuHomePhabricator

If there's an anchor in the URL in Differential, don't stick to the bottom of the page as content loads
ClosedPublic

Authored by epriestley on May 16 2017, 5:21 PM.
Tags
None
Referenced Files
F19099581: D17911.id43089.diff
Thu, Dec 4, 8:43 PM
F18821384: D17911.id43086.diff
Oct 22 2025, 10:37 PM
F18807647: D17911.diff
Oct 19 2025, 2:42 AM
F18787808: D17911.id.diff
Oct 15 2025, 1:38 AM
F18784788: D17911.id43089.diff
Oct 13 2025, 3:11 PM
F18784547: D17911.id43089.diff
Oct 13 2025, 12:50 PM
F18643010: D17911.diff
Sep 19 2025, 1:16 AM
F18627037: D17911.id43089.diff
Sep 16 2025, 3:02 AM
Subscribers
None

Details

Summary

Fixes T11784. A lot of things are interacting here, but this probably gets slightly better results slightly more often?

Basically:

  • When we load content, we try to keep the viewport "stable" on the page, so the page doesn't jump around like crazy.
  • If you're near the top or bottom of the page, we try to stick to the top (e.g., reading the summary) or bottom (e.g., writing a comment).
  • But, if you followed an anchor to a comment that's close to the bottom of the page, we might stick to the bottom intead of staying with the anchor.

Kind of do a better job by not sticking to the bottom if you have an anchor. This will get things wrong if you follow an anchor, scroll down, start writing a comment, etc. But this whole thing is a pile of guesses anyway.

Test Plan
  • Followed an anchor, saw non-sticky stabilization.
  • Loaded the page normally, scrolled to the bottom real fast, saw sticky stabilization.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable