1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

In the UI, rename "Hide Inline" to "Collapse Inline"

Summary:
Ref T12733. This paves the way for a separate "hide" operation which completely hides things.

(I didn't extend this to the server side because that would require schema changes and the new "hide" state is client-only.)

Test Plan: Collapsed and expanded inlines, viewed tooltips.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12733

Differential Revision: https://secure.phabricator.com/D18126
This commit is contained in:
epriestley 2017-06-15 04:17:01 -07:00
parent 8008ade9af
commit 887bd2d66e
7 changed files with 66 additions and 73 deletions

View file

@ -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',

View file

@ -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.'),

View file

@ -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);

View file

@ -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,
));

View file

@ -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],

View file

@ -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() {

View file

@ -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) {