@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.

For the diff banner, detect the current changeset better

Summary:
Ref T12733. Currently, we detect the changeset which is in the middle of the screen as the current changeset.

This doesn't always get us the most intuitive changeset, particularly after a navigation from the scroll objective list: when you jump to changeset "X", you'd tend to expect "X" to be shown in the header, but the //next// changeset may be shown if "X" is too short.

Instead, select the changeset near the top of the screen (spanning an invisible line slightly below the banner).

Test Plan: Scrolled and jumped through a document with long and short changesets, saw a more intuitive changeset selected by the banner.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12733

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

+17 -13
+7 -7
resources/celerity/map.php
··· 13 13 'core.pkg.js' => 'e822b496', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '4d7dd14e', 16 - 'differential.pkg.js' => '68a4fa60', 16 + 'differential.pkg.js' => '6d05ad4c', 17 17 'diffusion.pkg.css' => 'b93d9b8c', 18 18 'diffusion.pkg.js' => '84c8f8fd', 19 19 'favicon.ico' => '30672e08', ··· 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 393 'rsrc/js/application/diff/DiffChangeset.js' => 'cf4e2140', 394 - 'rsrc/js/application/diff/DiffChangesetList.js' => '5c68c40c', 394 + 'rsrc/js/application/diff/DiffChangesetList.js' => '541206ba', 395 395 'rsrc/js/application/diff/DiffInline.js' => '77e14b60', 396 396 'rsrc/js/application/diff/ScrollObjective.js' => '0eee7a00', 397 397 'rsrc/js/application/diff/ScrollObjectiveList.js' => '1ca4d9db', ··· 778 778 'phabricator-darkmessage' => 'c48cccdd', 779 779 'phabricator-dashboard-css' => 'fe5b1869', 780 780 'phabricator-diff-changeset' => 'cf4e2140', 781 - 'phabricator-diff-changeset-list' => '5c68c40c', 781 + 'phabricator-diff-changeset-list' => '541206ba', 782 782 'phabricator-diff-inline' => '77e14b60', 783 783 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 784 784 'phabricator-draggable-list' => 'bea6e7f4', ··· 1316 1316 '5294060f' => array( 1317 1317 'phui-theme-css', 1318 1318 ), 1319 + '541206ba' => array( 1320 + 'javelin-install', 1321 + 'phabricator-scroll-objective-list', 1322 + ), 1319 1323 '54774a28' => array( 1320 1324 'phui-inline-comment-view-css', 1321 1325 ), ··· 1367 1371 'javelin-behavior', 1368 1372 'javelin-stratcom', 1369 1373 'javelin-dom', 1370 - ), 1371 - '5c68c40c' => array( 1372 - 'javelin-install', 1373 - 'phabricator-scroll-objective-list', 1374 1374 ), 1375 1375 '5e2634b9' => array( 1376 1376 'javelin-behavior',
+10 -6
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 1358 1358 return null; 1359 1359 } 1360 1360 1361 - var v = JX.Vector.getViewport(); 1361 + // We're going to find the changeset which spans an invisible line a 1362 + // little underneath the bottom of the banner. This makes the header 1363 + // tick over from "A.txt" to "B.txt" just as "A.txt" scrolls completely 1364 + // offscreen. 1365 + var detect_height = 64; 1366 + 1362 1367 for (var ii = 0; ii < this._changesets.length; ii++) { 1363 1368 var changeset = this._changesets[ii]; 1364 1369 var c = changeset.getVectors(); 1365 1370 1366 - // If the changeset starts above the upper half of the screen... 1367 - if (c.pos.y < (s.y + (v.y / 2))) { 1368 - // ...and ends below the lower half of the screen, this is the 1369 - // current visible changeset. 1370 - if ((c.pos.y + c.dim.y) > (s.y + (v.y / 2))) { 1371 + // If the changeset starts above the line... 1372 + if (c.pos.y <= (s.y + detect_height)) { 1373 + // ...and ends below the line, this is the current visible changeset. 1374 + if ((c.pos.y + c.dim.y) >= (s.y + detect_height)) { 1371 1375 return changeset; 1372 1376 } 1373 1377 }