@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11784

Differential Revision: https://secure.phabricator.com/D17911

+20 -14
+14 -14
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '8c5f913d', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '58712637', 16 - 'differential.pkg.js' => 'bd321b6e', 16 + 'differential.pkg.js' => 'f1b636fb', 17 17 'diffusion.pkg.css' => 'b93d9b8c', 18 18 'diffusion.pkg.js' => '84c8f8fd', 19 19 'favicon.ico' => '30672e08', ··· 390 390 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 391 391 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 392 392 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 393 - 'rsrc/js/application/diff/DiffChangeset.js' => '145c34e2', 393 + 'rsrc/js/application/diff/DiffChangeset.js' => 'c5742feb', 394 394 'rsrc/js/application/diff/DiffChangesetList.js' => 'f1101e6e', 395 395 'rsrc/js/application/diff/DiffInline.js' => 'bdf6b568', 396 396 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', ··· 779 779 'phabricator-darklog' => 'c8e1ffe3', 780 780 'phabricator-darkmessage' => 'c48cccdd', 781 781 'phabricator-dashboard-css' => 'fe5b1869', 782 - 'phabricator-diff-changeset' => '145c34e2', 782 + 'phabricator-diff-changeset' => 'c5742feb', 783 783 'phabricator-diff-changeset-list' => 'f1101e6e', 784 784 'phabricator-diff-inline' => 'bdf6b568', 785 785 'phabricator-drag-and-drop-file-upload' => '58dea2fa', ··· 997 997 'javelin-dom', 998 998 'javelin-typeahead-normalizer', 999 999 ), 1000 - '145c34e2' => array( 1001 - 'javelin-dom', 1002 - 'javelin-util', 1003 - 'javelin-stratcom', 1004 - 'javelin-install', 1005 - 'javelin-workflow', 1006 - 'javelin-router', 1007 - 'javelin-behavior-device', 1008 - 'javelin-vector', 1009 - 'phabricator-diff-inline', 1010 - ), 1011 1000 '1499a8cb' => array( 1012 1001 'javelin-behavior', 1013 1002 'javelin-stratcom', ··· 1925 1914 'javelin-behavior-device', 1926 1915 'javelin-stratcom', 1927 1916 'phabricator-tooltip', 1917 + ), 1918 + 'c5742feb' => array( 1919 + 'javelin-dom', 1920 + 'javelin-util', 1921 + 'javelin-stratcom', 1922 + 'javelin-install', 1923 + 'javelin-workflow', 1924 + 'javelin-router', 1925 + 'javelin-behavior-device', 1926 + 'javelin-vector', 1927 + 'phabricator-diff-inline', 1928 1928 ), 1929 1929 'c587b80f' => array( 1930 1930 'javelin-install',
+6
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 440 440 var near_top = (old_pos.y <= sticky); 441 441 var near_bot = ((old_pos.y + old_view.y) >= (old_dim.y - sticky)); 442 442 443 + // If we have an anchor in the URL, never stick to the bottom of the 444 + // page. See T11784 for discussion. 445 + if (window.location.hash) { 446 + near_bot = false; 447 + } 448 + 443 449 var target_pos = JX.Vector.getPos(target); 444 450 var target_dim = JX.Vector.getDim(target); 445 451 var target_mid = (target_pos.y + (target_dim.y / 2));