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

Consider inline comments with draft checkmarks as "unsubmitted"

Summary:
Ref T12733. When a revision has unsubmitted checkmarks:

- Color the banner yellow.
- Show them in the "X unsubmitted" count.
- Make the "X unsubmitted" button cycle between all drafts (written but unpublished comments) and "draft done" (checked but unsubmitted "Done" checkbox comments).

Test Plan:
- Checked a "Done" box, saw "1 unsubmitted" and yellow banner.
- Clicked "5 unsubmitted" repeatedly, saw it cycle through all unsubmitted comments and checkboxes.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12733

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

+72 -40
+31 -31
resources/celerity/map.php
··· 12 12 'core.pkg.css' => 'ab24402f', 13 13 'core.pkg.js' => '1475bd91', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 - 'differential.pkg.css' => '4e99863c', 16 - 'differential.pkg.js' => 'ee50e5ae', 15 + 'differential.pkg.css' => '4ec4a37a', 16 + 'differential.pkg.js' => '3442216b', 17 17 'diffusion.pkg.css' => 'b93d9b8c', 18 18 'diffusion.pkg.js' => '6134c5a1', 19 19 'favicon.ico' => '30672e08', ··· 64 64 'rsrc/css/application/dashboard/dashboard.css' => 'fe5b1869', 65 65 'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a', 66 66 'rsrc/css/application/differential/add-comment.css' => 'c47f8c40', 67 - 'rsrc/css/application/differential/changeset-view.css' => 'c72dba88', 67 + 'rsrc/css/application/differential/changeset-view.css' => 'b5e6be7f', 68 68 'rsrc/css/application/differential/core.css' => '5b7b8ff4', 69 69 'rsrc/css/application/differential/phui-inline-comment.css' => 'ffd1a542', 70 70 'rsrc/css/application/differential/revision-comment.css' => '14b8565a', ··· 395 395 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 396 396 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 397 397 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 398 - 'rsrc/js/application/diff/DiffChangeset.js' => '94f81a34', 399 - 'rsrc/js/application/diff/DiffChangesetList.js' => 'fc6e482d', 400 - 'rsrc/js/application/diff/DiffInline.js' => 'a386f83c', 398 + 'rsrc/js/application/diff/DiffChangeset.js' => 'cdc5fa19', 399 + 'rsrc/js/application/diff/DiffChangesetList.js' => '4ca11264', 400 + 'rsrc/js/application/diff/DiffInline.js' => '27b6d01f', 401 401 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 402 402 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 403 403 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', ··· 562 562 'conpherence-thread-manager' => '4d863052', 563 563 'conpherence-transaction-css' => '85129c68', 564 564 'd3' => 'a11a5ff2', 565 - 'differential-changeset-view-css' => 'c72dba88', 565 + 'differential-changeset-view-css' => 'b5e6be7f', 566 566 'differential-core-view-css' => '5b7b8ff4', 567 567 'differential-revision-add-comment-css' => 'c47f8c40', 568 568 'differential-revision-comment-css' => '14b8565a', ··· 774 774 'phabricator-darklog' => 'c8e1ffe3', 775 775 'phabricator-darkmessage' => 'c48cccdd', 776 776 'phabricator-dashboard-css' => 'fe5b1869', 777 - 'phabricator-diff-changeset' => '94f81a34', 778 - 'phabricator-diff-changeset-list' => 'fc6e482d', 779 - 'phabricator-diff-inline' => 'a386f83c', 777 + 'phabricator-diff-changeset' => 'cdc5fa19', 778 + 'phabricator-diff-changeset-list' => '4ca11264', 779 + 'phabricator-diff-inline' => '27b6d01f', 780 780 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 781 781 'phabricator-draggable-list' => 'bea6e7f4', 782 782 'phabricator-fatal-config-template-css' => '8f18fa41', ··· 1056 1056 'phabricator-drag-and-drop-file-upload', 1057 1057 'javelin-workboard-board', 1058 1058 ), 1059 + '27b6d01f' => array( 1060 + 'javelin-dom', 1061 + ), 1059 1062 '2926fff2' => array( 1060 1063 'javelin-behavior', 1061 1064 'javelin-dom', ··· 1231 1234 'javelin-uri', 1232 1235 'phabricator-notification', 1233 1236 ), 1237 + '4ca11264' => array( 1238 + 'javelin-install', 1239 + 'phuix-button-view', 1240 + ), 1234 1241 '4d863052' => array( 1235 1242 'javelin-dom', 1236 1243 'javelin-util', ··· 1612 1619 'javelin-resource', 1613 1620 'javelin-routable', 1614 1621 ), 1615 - '94f81a34' => array( 1616 - 'javelin-dom', 1617 - 'javelin-util', 1618 - 'javelin-stratcom', 1619 - 'javelin-install', 1620 - 'javelin-workflow', 1621 - 'javelin-router', 1622 - 'javelin-behavior-device', 1623 - 'javelin-vector', 1624 - 'phabricator-diff-inline', 1625 - ), 1626 1622 '960f6a39' => array( 1627 1623 'javelin-behavior', 1628 1624 'javelin-dom', ··· 1667 1663 'javelin-install', 1668 1664 'javelin-dom', 1669 1665 ), 1670 - 'a386f83c' => array( 1671 - 'javelin-dom', 1672 - ), 1673 1666 'a3a63478' => array( 1674 1667 'phui-workcard-view-css', 1675 1668 ), ··· 1807 1800 'javelin-dom', 1808 1801 'javelin-util', 1809 1802 ), 1803 + 'b5e6be7f' => array( 1804 + 'phui-inline-comment-view-css', 1805 + ), 1810 1806 'b6993408' => array( 1811 1807 'javelin-behavior', 1812 1808 'javelin-stratcom', ··· 1899 1895 'javelin-dom', 1900 1896 'javelin-stratcom', 1901 1897 'javelin-util', 1902 - ), 1903 - 'c72dba88' => array( 1904 - 'phui-inline-comment-view-css', 1905 1898 ), 1906 1899 'c7ccd872' => array( 1907 1900 'phui-fontkit-css', ··· 1963 1956 'cd2b9b77' => array( 1964 1957 'phui-oi-list-view-css', 1965 1958 ), 1959 + 'cdc5fa19' => array( 1960 + 'javelin-dom', 1961 + 'javelin-util', 1962 + 'javelin-stratcom', 1963 + 'javelin-install', 1964 + 'javelin-workflow', 1965 + 'javelin-router', 1966 + 'javelin-behavior-device', 1967 + 'javelin-vector', 1968 + 'phabricator-diff-inline', 1969 + ), 1966 1970 'd0a99ab4' => array( 1967 1971 'javelin-behavior', 1968 1972 'javelin-typeahead-ondemand-source', ··· 2153 2157 'javelin-mask', 2154 2158 'javelin-behavior-device', 2155 2159 'phabricator-keyboard-shortcut', 2156 - ), 2157 - 'fc6e482d' => array( 2158 - 'javelin-install', 2159 - 'phuix-button-view', 2160 2160 ), 2161 2161 'fc91ab6c' => array( 2162 2162 'javelin-behavior',
+9
src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
··· 107 107 break; 108 108 } 109 109 110 + $is_draft_done = false; 111 + switch ($inline->getFixedState()) { 112 + case PhabricatorInlineCommentInterface::STATE_DRAFT: 113 + case PhabricatorInlineCommentInterface::STATE_UNDRAFT: 114 + $is_draft_done = true; 115 + break; 116 + } 117 + 110 118 $is_synthetic = false; 111 119 if ($inline->getSyntheticAuthor()) { 112 120 $is_synthetic = true; ··· 126 134 'isFixed' => $is_fixed, 127 135 'isGhost' => $inline->getIsGhost(), 128 136 'isSynthetic' => $is_synthetic, 137 + 'isDraftDone' => $is_draft_done, 129 138 ); 130 139 131 140 $sigil = 'differential-inline-comment';
+2 -1
webroot/rsrc/css/application/differential/changeset-view.css
··· 415 415 } 416 416 417 417 .diff-banner-has-unsaved, 418 - .diff-banner-has-unsubmitted { 418 + .diff-banner-has-unsubmitted, 419 + .diff-banner-has-draft-done { 419 420 background: {$sh-yellowbackground}; 420 421 } 421 422
+1 -1
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 454 454 }, 455 455 attributes: { 456 456 unsaved: inline.isEditing(), 457 - unsubmitted: inline.isDraft(), 457 + anyDraft: inline.isDraft() || inline.isDraftDone(), 458 458 undone: (is_saved && !inline.isDone()), 459 459 done: (is_saved && inline.isDone()) 460 460 }
+22 -7
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 1332 1332 var changesets = this._changesets; 1333 1333 var unsaved = []; 1334 1334 var unsubmitted = []; 1335 + var draft_done = []; 1335 1336 var undone = []; 1336 1337 var done = []; 1337 1338 ··· 1356 1357 continue; 1357 1358 } else if (inline.isDraft()) { 1358 1359 unsubmitted.push(inline); 1359 - } else if (!inline.isDone()) { 1360 - undone.push(inline); 1361 1360 } else { 1362 - done.push(inline); 1361 + // NOTE: Unlike other states, an inline may be marked with a 1362 + // draft checkmark and still be a "done" or "undone" comment. 1363 + if (inline.isDraftDone()) { 1364 + draft_done.push(inline); 1365 + } 1366 + 1367 + if (!inline.isDone()) { 1368 + undone.push(inline); 1369 + } else { 1370 + done.push(inline); 1371 + } 1363 1372 } 1364 1373 } 1365 1374 } ··· 1374 1383 'diff-banner-has-unsubmitted', 1375 1384 !!unsubmitted.length); 1376 1385 1386 + JX.DOM.alterClass( 1387 + node, 1388 + 'diff-banner-has-draft-done', 1389 + !!draft_done.length); 1390 + 1377 1391 var pht = this.getTranslations(); 1378 1392 var unsaved_button = this._getUnsavedButton(); 1379 1393 var unsubmitted_button = this._getUnsubmittedButton(); ··· 1386 1400 JX.DOM.hide(unsaved_button.getNode()); 1387 1401 } 1388 1402 1389 - if (unsubmitted.length) { 1390 - unsubmitted_button.setText( 1391 - unsubmitted.length + ' ' + pht('Unsubmitted')); 1403 + if (unsubmitted.length || draft_done.length) { 1404 + var any_draft_count = unsubmitted.length + draft_done.length; 1405 + 1406 + unsubmitted_button.setText(any_draft_count + ' ' + pht('Unsubmitted')); 1392 1407 JX.DOM.show(unsubmitted_button.getNode()); 1393 1408 } else { 1394 1409 JX.DOM.hide(unsubmitted_button.getNode()); ··· 1523 1538 var options = { 1524 1539 filter: 'comment', 1525 1540 wrap: true, 1526 - attribute: 'unsubmitted' 1541 + attribute: 'anyDraft' 1527 1542 }; 1528 1543 1529 1544 this._onjumpkey(1, options);
+7
webroot/rsrc/js/application/diff/DiffInline.js
··· 31 31 32 32 _isCollapsed: false, 33 33 _isDraft: null, 34 + _isDraftDone: null, 34 35 _isFixed: null, 35 36 _isEditing: false, 36 37 _isNew: false, ··· 73 74 this._isFixed = data.isFixed; 74 75 this._isGhost = data.isGhost; 75 76 this._isSynthetic = data.isSynthetic; 77 + this._isDraftDone = data.isDraftDone; 76 78 77 79 this._changesetID = data.changesetID; 78 80 this._isNew = false; ··· 101 103 102 104 isSynthetic: function() { 103 105 return this._isSynthetic; 106 + }, 107 + 108 + isDraftDone: function() { 109 + return this._isDraftDone; 104 110 }, 105 111 106 112 bindToRange: function(data) { ··· 321 327 JX.DOM.alterClass(comment, 'inline-state-is-draft', response.draftState); 322 328 323 329 this._isFixed = response.isChecked; 330 + this._isDraftDone = !!response.draftState; 324 331 325 332 this._didUpdate(); 326 333 },