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

Distinguish more carefully between "null" inline offsets and "0" inline offsets

Summary:
Ref T13513. Currently, when creating an inline by selecting a line range, slightly careless handling leads to an inline with "0" offsets (by passing "undefined" to the server). This causes the block to highlight every line except the last one as fully bright, which is incorrect.

An inline with "0" offsets and an inline with no offsets are different. Be more careful about passing offsets around and rendering them.

Test Plan:
- Used the line numbers to add an inline to lines 4-8 of a change.
- Hovered the inline.
- Saw all four lines marked as "dull"-highlighted (previously: three bright lines, one dull line).

Maniphest Tasks: T13513

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

+20 -19
+13 -13
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '0efaf0ac', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => 'b042ee8b', 16 - 'differential.pkg.js' => '4b2b5659', 16 + 'differential.pkg.js' => '79dfae6e', 17 17 'diffusion.pkg.css' => '42c75c37', 18 18 'diffusion.pkg.js' => 'a98c0bf7', 19 19 'maniphest.pkg.css' => '35995d6d', ··· 380 380 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9', 381 381 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 382 382 'rsrc/js/application/diff/DiffChangeset.js' => 'b6bb0240', 383 - 'rsrc/js/application/diff/DiffChangesetList.js' => '2347e0a6', 384 - 'rsrc/js/application/diff/DiffInline.js' => '417b3cdb', 383 + 'rsrc/js/application/diff/DiffChangesetList.js' => '1e8658bb', 384 + 'rsrc/js/application/diff/DiffInline.js' => '9bb6f2ad', 385 385 'rsrc/js/application/diff/DiffPathView.js' => '8207abf9', 386 386 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', 387 387 'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd', ··· 775 775 'phabricator-darkmessage' => '26cd4b73', 776 776 'phabricator-dashboard-css' => '5a205b9d', 777 777 'phabricator-diff-changeset' => 'b6bb0240', 778 - 'phabricator-diff-changeset-list' => '2347e0a6', 779 - 'phabricator-diff-inline' => '417b3cdb', 778 + 'phabricator-diff-changeset-list' => '1e8658bb', 779 + 'phabricator-diff-inline' => '9bb6f2ad', 780 780 'phabricator-diff-path-view' => '8207abf9', 781 781 'phabricator-diff-tree-view' => '5d83623b', 782 782 'phabricator-drag-and-drop-file-upload' => '4370900d', ··· 1069 1069 'javelin-behavior', 1070 1070 'javelin-dom', 1071 1071 ), 1072 + '1e8658bb' => array( 1073 + 'javelin-install', 1074 + 'phuix-button-view', 1075 + 'phabricator-diff-tree-view', 1076 + ), 1072 1077 '1ff278aa' => array( 1073 1078 'phui-button-css', 1074 1079 ), ··· 1097 1102 'javelin-util', 1098 1103 'javelin-request', 1099 1104 'javelin-typeahead-source', 1100 - ), 1101 - '2347e0a6' => array( 1102 - 'javelin-install', 1103 - 'phuix-button-view', 1104 - 'phabricator-diff-tree-view', 1105 1105 ), 1106 1106 23631304 => array( 1107 1107 'phui-fontkit-css', ··· 1250 1250 '407ee861' => array( 1251 1251 'javelin-behavior', 1252 1252 'javelin-uri', 1253 - ), 1254 - '417b3cdb' => array( 1255 - 'javelin-dom', 1256 1253 ), 1257 1254 '42c44e8b' => array( 1258 1255 'javelin-behavior', ··· 1794 1791 '9aae2b66' => array( 1795 1792 'javelin-install', 1796 1793 'javelin-util', 1794 + ), 1795 + '9bb6f2ad' => array( 1796 + 'javelin-dom', 1797 1797 ), 1798 1798 '9c01e364' => array( 1799 1799 'javelin-behavior',
+4 -4
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 1403 1403 }, 1404 1404 1405 1405 _newHoverMap: function(top, bot, content_cell, inline) { 1406 - var start = inline.getStartOffset() || 0; 1407 - var end = inline.getEndOffset() || 0; 1406 + var start = inline.getStartOffset(); 1407 + var end = inline.getEndOffset(); 1408 1408 1409 1409 var head_row = JX.DOM.findAbove(top, 'tr'); 1410 1410 var last_row = JX.DOM.findAbove(bot, 'tr'); ··· 1476 1476 content = rows[ii].content; 1477 1477 len = content.length; 1478 1478 1479 - if (ii === min) { 1479 + if (ii === min && (start !== null)) { 1480 1480 offset_min = start; 1481 1481 } else { 1482 1482 offset_min = 0; 1483 1483 } 1484 1484 1485 - if (ii === max) { 1485 + if (ii === max && (end !== null)) { 1486 1486 offset_max = Math.min(end, len); 1487 1487 } else { 1488 1488 offset_max = len;
+3 -2
webroot/rsrc/js/application/diff/DiffInline.js
··· 96 96 this._snippet = data.snippet; 97 97 this._menuItems = data.menuItems; 98 98 this._documentEngineKey = data.documentEngineKey; 99 + 99 100 this._startOffset = data.startOffset; 100 101 this._endOffset = data.endOffset; 101 102 ··· 167 168 this._isNewFile = data.isNewFile; 168 169 this._changesetID = data.changesetID; 169 170 this._isNew = true; 170 - this._startOffset = data.startOffset; 171 - this._endOffset = data.endOffset; 171 + this._startOffset = null; 172 + this._endOffset = null; 172 173 173 174 // Insert the comment after any other comments which already appear on 174 175 // the same row.