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
F13084785: D17911.diff
Wed, Apr 24, 11:23 PM
Unknown Object (File)
Wed, Apr 17, 3:13 PM
Unknown Object (File)
Sun, Mar 31, 7:01 AM
Unknown Object (File)
Mar 17 2024, 4:55 AM
Unknown Object (File)
Feb 11 2024, 10:23 AM
Unknown Object (File)
Jan 16 2024, 2:51 PM
Unknown Object (File)
Dec 27 2023, 11:03 AM
Unknown Object (File)
Dec 21 2023, 6:34 PM
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
Branch
inline12
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17014
Build 22746: Run Core Tests
Build 22745: arc lint + arc unit