@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 loading a page with inlines, don't select/focus inlines which we immediately upgrade to "editing"

Summary:
Ref T13513. This is a bit clumsy, but the cleanest way to implement "isEditing" inlines today is to send them down as normal inlines and then simulate clicking "edit" on them.

When we do, don't focus the resulting editor: focusing it makes the page scroll around and highlight things in essentially random order as the editors load in.

Test Plan: Reloaded a page with some open editors, wasn't scrolled to them.

Maniphest Tasks: T13513

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

+28 -20
+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' => '4d375e61', 16 + 'differential.pkg.js' => 'e6da9e6f', 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' => 'a39fd98e', 384 + 'rsrc/js/application/diff/DiffInline.js' => 'e6b9b4f3', 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' => 'a39fd98e', 781 + 'phabricator-diff-inline' => 'e6b9b4f3', 782 782 'phabricator-diff-path-view' => '8207abf9', 783 783 'phabricator-diff-tree-view' => '5d83623b', 784 784 'phabricator-drag-and-drop-file-upload' => '4370900d', ··· 1841 1841 'javelin-workflow', 1842 1842 'phabricator-draggable-list', 1843 1843 ), 1844 - 'a39fd98e' => array( 1845 - 'javelin-dom', 1846 - ), 1847 1844 'a4356cde' => array( 1848 1845 'javelin-install', 1849 1846 'javelin-dom', ··· 2134 2131 'javelin-workflow', 2135 2132 'javelin-dom', 2136 2133 'phabricator-draggable-list', 2134 + ), 2135 + 'e6b9b4f3' => array( 2136 + 'javelin-dom', 2137 2137 ), 2138 2138 'e8240b50' => array( 2139 2139 'javelin-behavior',
+22 -14
webroot/rsrc/js/application/diff/DiffInline.js
··· 43 43 _undoText: null, 44 44 45 45 _draftRequest: null, 46 + _skipFocus: false, 46 47 47 48 bindToRow: function(row) { 48 49 this._row = row; ··· 95 96 // which we're currently editing. This flow is a little clumsy, but 96 97 // reasonable until some future change moves away from "send down 97 98 // the inline, then immediately click edit". 98 - this.edit(this._originalText); 99 + this.edit(this._originalText, true); 99 100 } else { 100 101 this.setInvisible(false); 101 102 } ··· 389 390 return changeset.newInlineReply(this, text); 390 391 }, 391 392 392 - edit: function(text) { 393 + edit: function(text, skip_focus) { 394 + this._skipFocus = !!skip_focus; 395 + 393 396 // If you edit an inline ("A"), modify the text ("AB"), cancel, and then 394 397 // edit it again: discard the undo state ("AB"). Otherwise we end up 395 398 // with an open editor and an active "Undo" link, which is weird. ··· 607 610 result_row = row; 608 611 } 609 612 610 - // If the row has a textarea, focus it. This allows the user to start 611 - // typing a comment immediately after a "new", "edit", or "reply" 612 - // action. 613 - var textareas = JX.DOM.scry( 614 - row, 615 - 'textarea', 616 - 'differential-inline-comment-edit-textarea'); 617 - if (textareas.length) { 618 - var area = textareas[0]; 619 - area.focus(); 613 + if (!this._skipFocus) { 614 + // If the row has a textarea, focus it. This allows the user to start 615 + // typing a comment immediately after a "new", "edit", or "reply" 616 + // action. 617 + 618 + // (When simulating an "edit" on page load, we don't do this.) 619 + 620 + var textareas = JX.DOM.scry( 621 + row, 622 + 'textarea', 623 + 'differential-inline-comment-edit-textarea'); 624 + if (textareas.length) { 625 + var area = textareas[0]; 626 + area.focus(); 620 627 621 - var length = area.value.length; 622 - JX.TextAreaUtils.setSelectionRange(area, length, length); 628 + var length = area.value.length; 629 + JX.TextAreaUtils.setSelectionRange(area, length, length); 630 + } 623 631 } 624 632 625 633 row = next_row;