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

Restore the Differential "edit" and "reply" keyboard shortcuts

Summary: Ref T12616. This makes "edit" and "reply" work again.

Test Plan:
Used "e" and "r" to edit and reply.

Also used them in bogus ways and got useful UI feedback.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12616

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

+119 -26
+24 -24
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '2ff7879f', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '58712637', 16 - 'differential.pkg.js' => 'e6129b80', 16 + 'differential.pkg.js' => '5ee318c2', 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' => '3d4b3c5e', 394 - 'rsrc/js/application/diff/DiffChangesetList.js' => 'e2c315d9', 395 - 'rsrc/js/application/diff/DiffInline.js' => '98c12b2f', 393 + 'rsrc/js/application/diff/DiffChangeset.js' => 'f7100923', 394 + 'rsrc/js/application/diff/DiffChangesetList.js' => 'f10fd7a3', 395 + 'rsrc/js/application/diff/DiffInline.js' => '00db3c3a', 396 396 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 397 397 'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d', 398 398 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', ··· 781 781 'phabricator-darklog' => 'c8e1ffe3', 782 782 'phabricator-darkmessage' => 'c48cccdd', 783 783 'phabricator-dashboard-css' => 'fe5b1869', 784 - 'phabricator-diff-changeset' => '3d4b3c5e', 785 - 'phabricator-diff-changeset-list' => 'e2c315d9', 786 - 'phabricator-diff-inline' => '98c12b2f', 784 + 'phabricator-diff-changeset' => 'f7100923', 785 + 'phabricator-diff-changeset-list' => 'f10fd7a3', 786 + 'phabricator-diff-inline' => '00db3c3a', 787 787 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 788 788 'phabricator-draggable-list' => 'bea6e7f4', 789 789 'phabricator-fatal-config-template-css' => '8f18fa41', ··· 918 918 'unhandled-exception-css' => '4c96257a', 919 919 ), 920 920 'requires' => array( 921 + '00db3c3a' => array( 922 + 'javelin-dom', 923 + ), 921 924 '013ffff9' => array( 922 925 'javelin-install', 923 926 'javelin-util', ··· 1158 1161 'javelin-util', 1159 1162 'javelin-uri', 1160 1163 ), 1161 - '3d4b3c5e' => array( 1162 - 'javelin-dom', 1163 - 'javelin-util', 1164 - 'javelin-stratcom', 1165 - 'javelin-install', 1166 - 'javelin-workflow', 1167 - 'javelin-router', 1168 - 'javelin-behavior-device', 1169 - 'javelin-vector', 1170 - 'phabricator-diff-inline', 1171 - ), 1172 1164 '3dbf94d5' => array( 1173 1165 'javelin-behavior', 1174 1166 'javelin-dom', ··· 1666 1658 'javelin-dom', 1667 1659 'javelin-reactor-dom', 1668 1660 ), 1669 - '98c12b2f' => array( 1670 - 'javelin-dom', 1671 - ), 1672 1661 '9a6dd75c' => array( 1673 1662 'javelin-behavior', 1674 1663 'javelin-stratcom', ··· 2108 2097 'javelin-stratcom', 2109 2098 'javelin-dom', 2110 2099 ), 2111 - 'e2c315d9' => array( 2112 - 'javelin-install', 2113 - ), 2114 2100 'e2e0a072' => array( 2115 2101 'javelin-behavior', 2116 2102 'javelin-stratcom', ··· 2181 2167 'javelin-workflow', 2182 2168 'javelin-json', 2183 2169 ), 2170 + 'f10fd7a3' => array( 2171 + 'javelin-install', 2172 + ), 2184 2173 'f12cbc9f' => array( 2185 2174 'phui-oi-list-view-css', 2186 2175 ), ··· 2198 2187 'javelin-dom', 2199 2188 'phuix-icon-view', 2200 2189 'phabricator-prefab', 2190 + ), 2191 + 'f7100923' => array( 2192 + 'javelin-dom', 2193 + 'javelin-util', 2194 + 'javelin-stratcom', 2195 + 'javelin-install', 2196 + 'javelin-workflow', 2197 + 'javelin-router', 2198 + 'javelin-behavior-device', 2199 + 'javelin-vector', 2200 + 'phabricator-diff-inline', 2201 2201 ), 2202 2202 'f7fc67ec' => array( 2203 2203 'javelin-install',
+8
src/applications/differential/view/DifferentialChangesetListView.php
··· 244 244 pht('Jump to previous inline comment.'), 245 245 'Jump to the table of contents.' => 246 246 pht('Jump to the table of contents.'), 247 + 'Reply to selected inline comment.' => 248 + pht('Reply to selected inline comment.'), 249 + 'Edit selected inline comment.' => 250 + pht('Edit selected inline comment.'), 251 + 'You must select a comment to reply to.' => 252 + pht('You must select a comment to reply to.'), 253 + 'You must select a comment to edit.' => 254 + pht('You must select a comment to edit.'), 247 255 ), 248 256 )); 249 257
+9
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 367 367 368 368 if (block.type == 'comment') { 369 369 for (var jj = 0; jj < block.items.length; jj++) { 370 + var inline = this.getInlineForRow(block.items[jj]); 371 + 372 + // If this inline has been collapsed, don't select it with the 373 + // keyboard cursor. 374 + if (inline.isHidden()) { 375 + continue; 376 + } 377 + 370 378 items.push({ 371 379 type: block.type, 372 380 changeset: this, 373 381 target: block.items[jj], 382 + inline: inline, 374 383 nodes: { 375 384 begin: block.items[jj], 376 385 end: block.items[jj]
+53 -2
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 98 98 99 99 label = pht('Jump to the table of contents.'); 100 100 this._installKey('t', label, this._ontoc); 101 + 102 + label = pht('Reply to selected inline comment.'); 103 + this._installKey('r', label, this._onreply); 104 + 105 + label = pht('Edit selected inline comment.'); 106 + this._installKey('e', label, this._onedit); 101 107 }, 102 108 103 109 isAsleep: function() { ··· 183 189 _ontoc: function(manager) { 184 190 var toc = JX.$('toc'); 185 191 manager.scrollTo(toc); 192 + }, 193 + 194 + _onreply: function(manager) { 195 + var cursor = this._cursorItem; 196 + 197 + if (cursor) { 198 + if (cursor.type == 'comment') { 199 + var inline = cursor.inline; 200 + if (inline.canReply()) { 201 + manager.focusOn(null); 202 + 203 + inline.reply(); 204 + return; 205 + } 206 + } 207 + } 208 + 209 + var pht = this.getTranslations(); 210 + this._warnUser(pht('You must select a comment to reply to.')); 211 + }, 212 + 213 + _onedit: function(manager) { 214 + var cursor = this._cursorItem; 215 + 216 + if (cursor) { 217 + if (cursor.type == 'comment') { 218 + var inline = cursor.inline; 219 + if (inline.canEdit()) { 220 + manager.focusOn(null); 221 + 222 + inline.edit(); 223 + return; 224 + } 225 + } 226 + } 227 + 228 + var pht = this.getTranslations(); 229 + this._warnUser(pht('You must select a comment to edit.')); 230 + }, 231 + 232 + _warnUser: function(message) { 233 + new JX.Notification() 234 + .setContent(message) 235 + .alterClassName('jx-notification-alert', true) 236 + .setDuration(1000) 237 + .show(); 186 238 }, 187 239 188 240 _onjumpkey: function(delta, filter, manager) { ··· 534 586 }, 535 587 536 588 _onaction: function(action, e) { 537 - // TODO: This can become a kill once things fully switch over.. 538 - e.prevent(); 589 + e.kill(); 539 590 540 591 var inline = this._getInlineForEvent(e); 541 592 var is_ref = false;
+25
webroot/rsrc/js/application/diff/DiffInline.js
··· 114 114 return this; 115 115 }, 116 116 117 + canReply: function() { 118 + if (!this._hasAction('reply')) { 119 + return false; 120 + } 121 + 122 + return true; 123 + }, 124 + 125 + canEdit: function() { 126 + if (!this._hasAction('edit')) { 127 + return false; 128 + } 129 + 130 + return true; 131 + }, 132 + 133 + _hasAction: function(action) { 134 + var nodes = JX.DOM.scry(this._row, 'a', 'differential-inline-' + action); 135 + return (nodes.length > 0); 136 + }, 137 + 117 138 _newRow: function() { 118 139 var attributes = { 119 140 sigil: 'inline-row' ··· 149 170 new JX.Workflow(inline_uri, {op: op, ids: comment_id}) 150 171 .setHandler(JX.bag) 151 172 .start(); 173 + }, 174 + 175 + isHidden: function() { 176 + return this._hidden; 152 177 }, 153 178 154 179 toggleDone: function() {