Page MenuHomePhabricator

When stabilizing document scroll position for diffs, stick to anchors harder
ClosedPublic

Authored by epriestley on Jun 1 2017, 7:22 PM.
Tags
None
Referenced Files
F15420806: D18060.id.diff
Fri, Mar 21, 5:50 PM
F15416671: D18060.diff
Thu, Mar 20, 12:54 PM
F15412740: D18060.id43438.diff
Wed, Mar 19, 2:40 PM
Unknown Object (File)
Mon, Feb 24, 12:28 AM
Unknown Object (File)
Feb 9 2025, 4:15 AM
Unknown Object (File)
Feb 9 2025, 4:15 AM
Unknown Object (File)
Feb 9 2025, 4:15 AM
Unknown Object (File)
Jan 27 2025, 9:49 AM
Subscribers
None

Details

Summary

Ref T12779. Try a little harder to get the autoscroll heuristic right, but also just stick to anchors if the URL has an anchor and the scroll position is near that anchor.

Test Plan
  • Loaded an anchored diff at a bunch of window sizes, seemed pretty sticky.
  • Added usleep(100000 * mt_rand(1, 15)) to ChangesetViewController to make changesets load slowly and in random order, reloaded a bunch of times while scrolling around, things appeared reasonable.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable