diff --git a/resources/celerity/map.php b/resources/celerity/map.php index e5903df96e..a706777a59 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -13,7 +13,7 @@ return array( 'core.pkg.js' => '1475bd91', 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '4e99863c', - 'differential.pkg.js' => 'b7504037', + 'differential.pkg.js' => 'ee50e5ae', 'diffusion.pkg.css' => 'b93d9b8c', 'diffusion.pkg.js' => '6134c5a1', 'favicon.ico' => '30672e08', @@ -395,9 +395,9 @@ return array( 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', - 'rsrc/js/application/diff/DiffChangeset.js' => 'd498bddb', - 'rsrc/js/application/diff/DiffChangesetList.js' => '29bbc02c', - 'rsrc/js/application/diff/DiffInline.js' => '20553f71', + 'rsrc/js/application/diff/DiffChangeset.js' => '94f81a34', + 'rsrc/js/application/diff/DiffChangesetList.js' => 'fc6e482d', + 'rsrc/js/application/diff/DiffInline.js' => 'a386f83c', 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', @@ -774,9 +774,9 @@ return array( 'phabricator-darklog' => 'c8e1ffe3', 'phabricator-darkmessage' => 'c48cccdd', 'phabricator-dashboard-css' => 'fe5b1869', - 'phabricator-diff-changeset' => 'd498bddb', - 'phabricator-diff-changeset-list' => '29bbc02c', - 'phabricator-diff-inline' => '20553f71', + 'phabricator-diff-changeset' => '94f81a34', + 'phabricator-diff-changeset-list' => 'fc6e482d', + 'phabricator-diff-inline' => 'a386f83c', 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 'phabricator-draggable-list' => 'bea6e7f4', 'phabricator-fatal-config-template-css' => '8f18fa41', @@ -1039,9 +1039,6 @@ return array( 'javelin-install', 'javelin-dom', ), - '20553f71' => array( - 'javelin-dom', - ), '2290aeef' => array( 'javelin-install', 'javelin-dom', @@ -1067,10 +1064,6 @@ return array( 'javelin-install', 'javelin-util', ), - '29bbc02c' => array( - 'javelin-install', - 'phuix-button-view', - ), '2ae077e1' => array( 'javelin-behavior', 'javelin-dom', @@ -1619,6 +1612,17 @@ return array( 'javelin-resource', 'javelin-routable', ), + '94f81a34' => array( + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-install', + 'javelin-workflow', + 'javelin-router', + 'javelin-behavior-device', + 'javelin-vector', + 'phabricator-diff-inline', + ), '960f6a39' => array( 'javelin-behavior', 'javelin-dom', @@ -1663,6 +1667,9 @@ return array( 'javelin-install', 'javelin-dom', ), + 'a386f83c' => array( + 'javelin-dom', + ), 'a3a63478' => array( 'phui-workcard-view-css', ), @@ -1986,17 +1993,6 @@ return array( 'javelin-uri', 'javelin-util', ), - 'd498bddb' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-workflow', - 'javelin-router', - 'javelin-behavior-device', - 'javelin-vector', - 'phabricator-diff-inline', - ), 'd4eecc63' => array( 'javelin-behavior', 'javelin-dom', @@ -2158,6 +2154,10 @@ return array( 'javelin-behavior-device', 'phabricator-keyboard-shortcut', ), + 'fc6e482d' => array( + 'javelin-install', + 'phuix-button-view', + ), 'fc91ab6c' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php index 25f762ba66..4b9f7c6b5f 100644 --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -257,15 +257,15 @@ final class DifferentialChangesetListView extends AphrontView { 'You must select a comment to mark done.' => pht('You must select a comment to mark done.'), - 'Hide or show inline comment.' => - pht('Hide or show inline comment.'), + 'Collapse or expand inline comment.' => + pht('Collapse or expand inline comment.'), 'You must select a comment to hide.' => pht('You must select a comment to hide.'), - 'Jump to next inline comment, including hidden comments.' => - pht('Jump to next inline comment, including hidden comments.'), - 'Jump to previous inline comment, including hidden comments.' => - pht('Jump to previous inline comment, including hidden comments.'), + 'Jump to next inline comment, including collapsed comments.' => + pht('Jump to next inline comment, including collapsed comments.'), + 'Jump to previous inline comment, including collapsed comments.' => + pht('Jump to previous inline comment, including collapsed comments.'), 'This file content has been collapsed.' => pht('This file content has been collapsed.'), diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php index 46853e185c..6d360cd595 100644 --- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php +++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php @@ -265,7 +265,7 @@ final class PHUIDiffInlineCommentDetailView if (!$this->preview && $this->canHide()) { $action_buttons[] = id(new PHUIButtonView()) ->setTag('a') - ->setTooltip(pht('Hide Comment')) + ->setTooltip(pht('Collapse')) ->setIcon('fa-times') ->addSigil('hide-inline') ->setMustCapture(true); diff --git a/src/infrastructure/diff/view/PHUIDiffRevealIconView.php b/src/infrastructure/diff/view/PHUIDiffRevealIconView.php index 8ca3eae2c1..dca19725d8 100644 --- a/src/infrastructure/diff/view/PHUIDiffRevealIconView.php +++ b/src/infrastructure/diff/view/PHUIDiffRevealIconView.php @@ -8,7 +8,7 @@ final class PHUIDiffRevealIconView extends AphrontView { ->addSigil('has-tooltip') ->setMetadata( array( - 'tip' => pht('Show Hidden Comment'), + 'tip' => pht('Expand'), 'align' => 'E', 'size' => 275, )); diff --git a/webroot/rsrc/js/application/diff/DiffChangeset.js b/webroot/rsrc/js/application/diff/DiffChangeset.js index c697ba5a6c..739df030af 100644 --- a/webroot/rsrc/js/application/diff/DiffChangeset.js +++ b/webroot/rsrc/js/application/diff/DiffChangeset.js @@ -446,7 +446,7 @@ JX.install('DiffChangeset', { type: block.type, changeset: this, target: inline, - hidden: inline.isHidden(), + collapsed: inline.isCollapsed(), deleted: !inline.getID() && !inline.isEditing(), nodes: { begin: block.items[jj], diff --git a/webroot/rsrc/js/application/diff/DiffChangesetList.js b/webroot/rsrc/js/application/diff/DiffChangesetList.js index b476b8c168..03f3ae9c38 100644 --- a/webroot/rsrc/js/application/diff/DiffChangesetList.js +++ b/webroot/rsrc/js/application/diff/DiffChangesetList.js @@ -19,11 +19,11 @@ JX.install('DiffChangesetList', { var onmenu = JX.bind(this, this._ifawake, this._onmenu); JX.Stratcom.listen('click', 'differential-view-options', onmenu); - var onhide = JX.bind(this, this._ifawake, this._onhide); - JX.Stratcom.listen('click', 'hide-inline', onhide); + var oncollapse = JX.bind(this, this._ifawake, this._oncollapse, true); + JX.Stratcom.listen('click', 'hide-inline', oncollapse); - var onreveal = JX.bind(this, this._ifawake, this._onreveal); - JX.Stratcom.listen('click', 'reveal-inline', onreveal); + var onexpand = JX.bind(this, this._ifawake, this._oncollapse, false); + JX.Stratcom.listen('click', 'reveal-inline', onexpand); var onedit = JX.bind(this, this._ifawake, this._onaction, 'edit'); JX.Stratcom.listen( @@ -158,11 +158,11 @@ JX.install('DiffChangesetList', { label = pht('Jump to previous inline comment.'); this._installJumpKey('p', label, -1, 'comment'); - label = pht('Jump to next inline comment, including hidden comments.'); + label = pht('Jump to next inline comment, including collapsed comments.'); this._installJumpKey('N', label, 1, 'comment', true); label = pht( - 'Jump to previous inline comment, including hidden comments.'); + 'Jump to previous inline comment, including collapsed comments.'); this._installJumpKey('P', label, -1, 'comment', true); label = pht('Hide or show the current file.'); @@ -183,8 +183,8 @@ JX.install('DiffChangesetList', { label = pht('Mark or unmark selected inline comment as done.'); this._installKey('w', label, this._onkeydone); - label = pht('Hide or show inline comment.'); - this._installKey('q', label, this._onkeyhide); + label = pht('Collapse or expand inline comment.'); + this._installKey('q', label, this._onkeycollapse); }, isAsleep: function() { @@ -261,12 +261,12 @@ JX.install('DiffChangesetList', { .register(); }, - _installJumpKey: function(key, label, delta, filter, show_hidden) { + _installJumpKey: function(key, label, delta, filter, show_collapsed) { filter = filter || null; var options = { filter: filter, - hidden: show_hidden + collapsed: show_collapsed }; var handler = JX.bind(this, this._onjumpkey, delta, options); @@ -424,16 +424,16 @@ JX.install('DiffChangesetList', { this._warnUser(pht('You must select a file to hide or show.')); }, - _onkeyhide: function() { + _onkeycollapse: function() { var cursor = this._cursorItem; if (cursor) { if (cursor.type == 'comment') { var inline = cursor.target; - if (inline.canHide()) { + if (inline.canCollapse()) { this.setFocus(null); - inline.setHidden(!inline.isHidden()); + inline.setCollapsed(!inline.isCollapsed()); return; } } @@ -455,7 +455,7 @@ JX.install('DiffChangesetList', { var state = this._getSelectionState(); var filter = options.filter || null; - var hidden = options.hidden || false; + var collapsed = options.collapsed || false; var wrap = options.wrap || false; var attribute = options.attribute || null; @@ -507,10 +507,10 @@ JX.install('DiffChangesetList', { } } - // If the item is hidden, don't select it when iterating with jump + // If the item is collapsed, don't select it when iterating with jump // keys. It can still potentially be selected in other ways. - if (!hidden) { - if (items[cursor].hidden) { + if (!collapsed) { + if (items[cursor].collapsed) { continue; } } @@ -851,20 +851,12 @@ JX.install('DiffChangesetList', { menu.open(); }, - _onhide: function(e) { - this._onhidereveal(e, true); - }, - - _onreveal: function(e) { - this._onhidereveal(e, false); - }, - - _onhidereveal: function(e, is_hide) { + _oncollapse: function(is_collapse, e) { e.kill(); var inline = this._getInlineForEvent(e); - inline.setHidden(is_hide); + inline.setCollapsed(is_collapse); }, _onresize: function() { diff --git a/webroot/rsrc/js/application/diff/DiffInline.js b/webroot/rsrc/js/application/diff/DiffInline.js index baee53a7a4..692d5644a0 100644 --- a/webroot/rsrc/js/application/diff/DiffInline.js +++ b/webroot/rsrc/js/application/diff/DiffInline.js @@ -14,7 +14,6 @@ JX.install('DiffInline', { _phid: null, _changesetID: null, _row: null, - _hidden: false, _number: null, _length: null, _displaySide: null, @@ -30,6 +29,7 @@ JX.install('DiffInline', { _changeset: null, + _isCollapsed: false, _isDraft: null, _isFixed: null, _isEditing: false, @@ -41,7 +41,7 @@ JX.install('DiffInline', { var row_data = JX.Stratcom.getData(row); row_data.inline = this; - this._hidden = row_data.hidden || false; + this._isCollapsed = row_data.hidden || false; // TODO: Get smarter about this once we do more editing, this is pretty // hacky. @@ -225,7 +225,7 @@ JX.install('DiffInline', { return true; }, - canHide: function() { + canCollapse: function() { if (!JX.DOM.scry(this._row, 'a', 'hide-inline').length) { return false; } @@ -254,20 +254,18 @@ JX.install('DiffInline', { this._id = null; this._phid = null; - this._hidden = false; + this._isCollapsed = false; this._originalText = null; return row; }, - setHidden: function(hidden) { - this._hidden = hidden; - - JX.DOM.alterClass(this._row, 'inline-hidden', this._hidden); + setCollapsed: function(collapsed) { + this._isCollapsed = collapsed; var op; - if (hidden) { + if (collapsed) { op = 'hide'; } else { op = 'show'; @@ -280,11 +278,12 @@ JX.install('DiffInline', { .setHandler(JX.bag) .start(); + this._redraw(); this._didUpdate(true); }, - isHidden: function() { - return this._hidden; + isCollapsed: function() { + return this._isCollapsed; }, toggleDone: function() { @@ -703,11 +702,13 @@ JX.install('DiffInline', { _redraw: function() { var is_invisible = (this._isInvisible || this._isDeleted); - var is_loading = (this._isLoading); + var is_loading = this._isLoading; + var is_collapsed = this._isCollapsed; var row = this._row; JX.DOM.alterClass(row, 'differential-inline-hidden', is_invisible); JX.DOM.alterClass(row, 'differential-inline-loading', is_loading); + JX.DOM.alterClass(row, 'inline-hidden', is_collapsed); }, _removeRow: function(row) {