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

When cancelling an unsaved editing inline after a reload, don't cancel into an empty state

Summary:
Ref T13513. Overloading "original text" to get "edit-on-load" comments into the right state has some undesirable side effects.

Instead, provide the text when the editor opens. This fixes a cancel interaction.

Test Plan:
- Create an inline, type text, don't save.
- Reload page.
- Cancel.
- Before: cancelled into empty state.
- After: cancelled into deleted+undo state.

Maniphest Tasks: T13513

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

+17 -11
+6 -6
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '632fb8f5', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => '2d70b7b9', 16 - 'differential.pkg.js' => 'e6da9e6f', 16 + 'differential.pkg.js' => '22ec6f26', 17 17 'diffusion.pkg.css' => '42c75c37', 18 18 'diffusion.pkg.js' => 'a98c0bf7', 19 19 'maniphest.pkg.css' => '35995d6d', ··· 381 381 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 382 382 'rsrc/js/application/diff/DiffChangeset.js' => 'a49dc31e', 383 383 'rsrc/js/application/diff/DiffChangesetList.js' => '6992b85c', 384 - 'rsrc/js/application/diff/DiffInline.js' => 'e6b9b4f3', 384 + 'rsrc/js/application/diff/DiffInline.js' => 'db754a7b', 385 385 'rsrc/js/application/diff/DiffPathView.js' => '8207abf9', 386 386 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', 387 387 'rsrc/js/application/diff/behavior-preview-link.js' => 'f51e9c17', ··· 778 778 'phabricator-dashboard-css' => '5a205b9d', 779 779 'phabricator-diff-changeset' => 'a49dc31e', 780 780 'phabricator-diff-changeset-list' => '6992b85c', 781 - 'phabricator-diff-inline' => 'e6b9b4f3', 781 + 'phabricator-diff-inline' => 'db754a7b', 782 782 'phabricator-diff-path-view' => '8207abf9', 783 783 'phabricator-diff-tree-view' => '5d83623b', 784 784 'phabricator-drag-and-drop-file-upload' => '4370900d', ··· 2113 2113 'javelin-uri', 2114 2114 'phabricator-notification', 2115 2115 ), 2116 + 'db754a7b' => array( 2117 + 'javelin-dom', 2118 + ), 2116 2119 'e150bd50' => array( 2117 2120 'javelin-behavior', 2118 2121 'javelin-stratcom', ··· 2131 2134 'javelin-workflow', 2132 2135 'javelin-dom', 2133 2136 'phabricator-draggable-list', 2134 - ), 2135 - 'e6b9b4f3' => array( 2136 - 'javelin-dom', 2137 2137 ), 2138 2138 'e8240b50' => array( 2139 2139 'javelin-behavior',
+8
src/infrastructure/diff/PhabricatorInlineCommentController.php
··· 211 211 } 212 212 213 213 $this->saveComment($inline); 214 + 215 + if (strlen($text)) { 216 + $this->purgeVersionedDrafts($inline); 217 + } 218 + 219 + PhabricatorInlineComment::loadAndAttachVersionedDrafts( 220 + $viewer, 221 + array($inline)); 214 222 } 215 223 216 224 $edit_dialog = $this->buildEditDialog($inline)
+1 -1
src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
··· 109 109 $viewer = $this->getViewer(); 110 110 $inline = $this->getInlineComment(); 111 111 112 - $text = $inline->getContent(); 112 + $text = $inline->getContentForEdit($viewer); 113 113 114 114 return id(new PhabricatorRemarkupControl()) 115 115 ->setViewer($viewer)
+1 -3
src/infrastructure/diff/view/PHUIDiffInlineCommentView.php
··· 75 75 break; 76 76 } 77 77 78 - $original_text = $inline->getContentForEdit($viewer); 79 - 80 78 return array( 81 79 'id' => $inline->getID(), 82 80 'phid' => $inline->getPHID(), ··· 84 82 'number' => $inline->getLineNumber(), 85 83 'length' => $inline->getLineLength(), 86 84 'isNewFile' => (bool)$inline->getIsNewFile(), 87 - 'original' => $original_text, 85 + 'original' => $inline->getContent(), 88 86 'replyToCommentPHID' => $inline->getReplyToCommentPHID(), 89 87 'isDraft' => $inline->isDraft(), 90 88 'isFixed' => $is_fixed,
+1 -1
webroot/rsrc/js/application/diff/DiffInline.js
··· 96 96 // which we're currently editing. This flow is a little clumsy, but 97 97 // reasonable until some future change moves away from "send down 98 98 // the inline, then immediately click edit". 99 - this.edit(this._originalText, true); 99 + this.edit(null, true); 100 100 } else { 101 101 this.setInvisible(false); 102 102 }