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

Show users what's wrong when they try to edit an inline with an editor already open

Summary: Fixes T8572. Ideally we would probably just permit this, but clean up the behavior until the day arrives when inline code is actually rewritten.

Test Plan:
- Tried to launch editors in Differential and Diffusion while comments were already open.
- Verified that "Jump to inline" works in both cases.

{F788008}

{F788009}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8572

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

+67 -26
+21 -21
resources/celerity/map.php
··· 11 11 'core.pkg.js' => '47dc9ebb', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', 14 - 'differential.pkg.js' => '52d725be', 14 + 'differential.pkg.js' => '6223dd9d', 15 15 'diffusion.pkg.css' => '385e85b3', 16 16 'diffusion.pkg.js' => '0115b37c', 17 17 'maniphest.pkg.css' => '4845691a', ··· 357 357 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 358 358 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 359 359 'rsrc/js/application/differential/ChangesetViewManager.js' => '58562350', 360 - 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'd4c87bf4', 360 + 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '64a5550f', 361 361 'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18', 362 362 'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d', 363 363 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', 364 364 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 365 365 'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb', 366 - 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '037b59eb', 366 + 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '65ef6074', 367 367 'rsrc/js/application/differential/behavior-keyboard-nav.js' => '2c426492', 368 368 'rsrc/js/application/differential/behavior-populate.js' => '8694b1df', 369 369 'rsrc/js/application/differential/behavior-toggle-files.js' => 'ca3f91eb', ··· 517 517 'conpherence-widget-pane-css' => '775eaaba', 518 518 'differential-changeset-view-css' => 'b6b0d1bb', 519 519 'differential-core-view-css' => '7ac3cabc', 520 - 'differential-inline-comment-editor' => 'd4c87bf4', 520 + 'differential-inline-comment-editor' => '64a5550f', 521 521 'differential-revision-add-comment-css' => 'c47f8c40', 522 522 'differential-revision-comment-css' => '14b8565a', 523 523 'differential-revision-history-css' => '0e8eb855', ··· 568 568 'javelin-behavior-differential-comment-jump' => '4fdb476d', 569 569 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 570 570 'javelin-behavior-differential-dropdown-menus' => '2035b9cb', 571 - 'javelin-behavior-differential-edit-inline-comments' => '037b59eb', 571 + 'javelin-behavior-differential-edit-inline-comments' => '65ef6074', 572 572 'javelin-behavior-differential-feedback-preview' => 'b064af76', 573 573 'javelin-behavior-differential-keyboard-navigation' => '2c426492', 574 574 'javelin-behavior-differential-populate' => '8694b1df', ··· 853 853 'javelin-behavior-device', 854 854 'phabricator-title', 855 855 ), 856 - '037b59eb' => array( 857 - 'javelin-behavior', 858 - 'javelin-stratcom', 859 - 'javelin-dom', 860 - 'javelin-util', 861 - 'javelin-vector', 862 - 'differential-inline-comment-editor', 863 - ), 864 856 '048330fa' => array( 865 857 'javelin-behavior', 866 858 'javelin-typeahead-ondemand-source', ··· 1289 1281 'javelin-workflow', 1290 1282 'javelin-dom', 1291 1283 ), 1284 + '64a5550f' => array( 1285 + 'javelin-dom', 1286 + 'javelin-util', 1287 + 'javelin-stratcom', 1288 + 'javelin-install', 1289 + 'javelin-request', 1290 + 'javelin-workflow', 1291 + ), 1292 + '65ef6074' => array( 1293 + 'javelin-behavior', 1294 + 'javelin-stratcom', 1295 + 'javelin-dom', 1296 + 'javelin-util', 1297 + 'javelin-vector', 1298 + 'differential-inline-comment-editor', 1299 + ), 1292 1300 '665cf6ac' => array( 1293 1301 'javelin-behavior', 1294 1302 'javelin-util', ··· 1816 1824 'javelin-install', 1817 1825 'javelin-dom', 1818 1826 'javelin-view', 1819 - ), 1820 - 'd4c87bf4' => array( 1821 - 'javelin-dom', 1822 - 'javelin-util', 1823 - 'javelin-stratcom', 1824 - 'javelin-install', 1825 - 'javelin-request', 1826 - 'javelin-workflow', 1827 1827 ), 1828 1828 'd4eecc63' => array( 1829 1829 'javelin-behavior',
+13
src/infrastructure/diff/PhabricatorInlineCommentController.php
··· 94 94 95 95 $op = $this->getOperation(); 96 96 switch ($op) { 97 + case 'busy': 98 + if ($request->isFormPost()) { 99 + return new AphrontAjaxResponse(); 100 + } 101 + 102 + return $this->newDialog() 103 + ->setTitle(pht('Already Editing')) 104 + ->appendParagraph( 105 + pht( 106 + 'You are already editing an inline comment. Finish editing '. 107 + 'your current comment before adding new comments.')) 108 + ->addCancelButton('/') 109 + ->addSubmitButton(pht('Jump to Inline')); 97 110 case 'hide': 98 111 case 'show': 99 112 if (!$request->validateCSRF()) {
+20 -2
webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js
··· 250 250 JX.DifferentialInlineCommentEditor._undoRows = rows; 251 251 }, 252 252 253 + _onBusyWorkflow: function() { 254 + // If the user clicks the "Jump to Inline" button, scroll to the row 255 + // being edited. 256 + JX.DOM.scrollTo(this.getRow()); 257 + }, 258 + 253 259 start : function() { 254 - this._registerUndoListener(); 260 + var op = this.getOperation(); 255 261 262 + // The user is already editing a comment, we're going to give them an 263 + // error message. 264 + if (op == 'busy') { 265 + var onbusy = JX.bind(this, this._onBusyWorkflow); 266 + 267 + new JX.Workflow(this._uri, {op: op}) 268 + .setHandler(onbusy) 269 + .start(); 270 + 271 + return this; 272 + } 273 + 274 + this._registerUndoListener(); 256 275 var data = this._buildRequestData(); 257 - var op = this.getOperation(); 258 276 259 277 if (op == 'delete' || op == 'refdelete' || op == 'undelete') { 260 278 this._setRowState('loading');
+13 -3
webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js
··· 138 138 'mousedown', 139 139 ['differential-changeset', 'tag:th'], 140 140 function(e) { 141 - if (editor || 142 - selecting || 143 - e.isRightButton() || 141 + if (e.isRightButton() || 144 142 getRowNumber(e.getTarget()) === undefined) { 143 + return; 144 + } 145 + 146 + if (editor) { 147 + new JX.DifferentialInlineCommentEditor(config.uri) 148 + .setOperation('busy') 149 + .setRow(editor.getRow().previousSibling) 150 + .start(); 151 + return; 152 + } 153 + 154 + if (selecting) { 145 155 return; 146 156 } 147 157