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
F18508891: D18060.id.diff
Fri, Sep 5, 3:05 AM
F18501186: D18060.diff
Thu, Sep 4, 9:35 PM
F18094711: D18060.diff
Aug 7 2025, 10:18 PM
F17916964: D18060.diff
Jul 29 2025, 10:56 PM
F17870367: D18060.diff
Jul 28 2025, 1:46 PM
F17706568: D18060.id43438.diff
Jul 16 2025, 1:01 PM
Unknown Object (File)
May 9 2025, 8:24 PM
Unknown Object (File)
May 7 2025, 12:24 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