Skip to content

Commit 887bd2d

Browse files
author
epriestley
committed
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
1 parent 8008ade commit 887bd2d

File tree

7 files changed

+66
-73
lines changed

7 files changed

+66
-73
lines changed

resources/celerity/map.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'core.pkg.js' => '1475bd91',
1414
'darkconsole.pkg.js' => '1f9a31bc',
1515
'differential.pkg.css' => '4e99863c',
16-
'differential.pkg.js' => 'b7504037',
16+
'differential.pkg.js' => 'ee50e5ae',
1717
'diffusion.pkg.css' => 'b93d9b8c',
1818
'diffusion.pkg.js' => '6134c5a1',
1919
'favicon.ico' => '30672e08',
@@ -395,9 +395,9 @@
395395
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173',
396396
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
397397
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
398-
'rsrc/js/application/diff/DiffChangeset.js' => 'd498bddb',
399-
'rsrc/js/application/diff/DiffChangesetList.js' => '29bbc02c',
400-
'rsrc/js/application/diff/DiffInline.js' => '20553f71',
398+
'rsrc/js/application/diff/DiffChangeset.js' => '94f81a34',
399+
'rsrc/js/application/diff/DiffChangesetList.js' => 'fc6e482d',
400+
'rsrc/js/application/diff/DiffInline.js' => 'a386f83c',
401401
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
402402
'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07',
403403
'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1',
@@ -774,9 +774,9 @@
774774
'phabricator-darklog' => 'c8e1ffe3',
775775
'phabricator-darkmessage' => 'c48cccdd',
776776
'phabricator-dashboard-css' => 'fe5b1869',
777-
'phabricator-diff-changeset' => 'd498bddb',
778-
'phabricator-diff-changeset-list' => '29bbc02c',
779-
'phabricator-diff-inline' => '20553f71',
777+
'phabricator-diff-changeset' => '94f81a34',
778+
'phabricator-diff-changeset-list' => 'fc6e482d',
779+
'phabricator-diff-inline' => 'a386f83c',
780780
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
781781
'phabricator-draggable-list' => 'bea6e7f4',
782782
'phabricator-fatal-config-template-css' => '8f18fa41',
@@ -1039,9 +1039,6 @@
10391039
'javelin-install',
10401040
'javelin-dom',
10411041
),
1042-
'20553f71' => array(
1043-
'javelin-dom',
1044-
),
10451042
'2290aeef' => array(
10461043
'javelin-install',
10471044
'javelin-dom',
@@ -1067,10 +1064,6 @@
10671064
'javelin-install',
10681065
'javelin-util',
10691066
),
1070-
'29bbc02c' => array(
1071-
'javelin-install',
1072-
'phuix-button-view',
1073-
),
10741067
'2ae077e1' => array(
10751068
'javelin-behavior',
10761069
'javelin-dom',
@@ -1619,6 +1612,17 @@
16191612
'javelin-resource',
16201613
'javelin-routable',
16211614
),
1615+
'94f81a34' => array(
1616+
'javelin-dom',
1617+
'javelin-util',
1618+
'javelin-stratcom',
1619+
'javelin-install',
1620+
'javelin-workflow',
1621+
'javelin-router',
1622+
'javelin-behavior-device',
1623+
'javelin-vector',
1624+
'phabricator-diff-inline',
1625+
),
16221626
'960f6a39' => array(
16231627
'javelin-behavior',
16241628
'javelin-dom',
@@ -1663,6 +1667,9 @@
16631667
'javelin-install',
16641668
'javelin-dom',
16651669
),
1670+
'a386f83c' => array(
1671+
'javelin-dom',
1672+
),
16661673
'a3a63478' => array(
16671674
'phui-workcard-view-css',
16681675
),
@@ -1986,17 +1993,6 @@
19861993
'javelin-uri',
19871994
'javelin-util',
19881995
),
1989-
'd498bddb' => array(
1990-
'javelin-dom',
1991-
'javelin-util',
1992-
'javelin-stratcom',
1993-
'javelin-install',
1994-
'javelin-workflow',
1995-
'javelin-router',
1996-
'javelin-behavior-device',
1997-
'javelin-vector',
1998-
'phabricator-diff-inline',
1999-
),
20001996
'd4eecc63' => array(
20011997
'javelin-behavior',
20021998
'javelin-dom',
@@ -2158,6 +2154,10 @@
21582154
'javelin-behavior-device',
21592155
'phabricator-keyboard-shortcut',
21602156
),
2157+
'fc6e482d' => array(
2158+
'javelin-install',
2159+
'phuix-button-view',
2160+
),
21612161
'fc91ab6c' => array(
21622162
'javelin-behavior',
21632163
'javelin-dom',

src/applications/differential/view/DifferentialChangesetListView.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,15 @@ public function render() {
257257
'You must select a comment to mark done.' =>
258258
pht('You must select a comment to mark done.'),
259259

260-
'Hide or show inline comment.' =>
261-
pht('Hide or show inline comment.'),
260+
'Collapse or expand inline comment.' =>
261+
pht('Collapse or expand inline comment.'),
262262
'You must select a comment to hide.' =>
263263
pht('You must select a comment to hide.'),
264264

265-
'Jump to next inline comment, including hidden comments.' =>
266-
pht('Jump to next inline comment, including hidden comments.'),
267-
'Jump to previous inline comment, including hidden comments.' =>
268-
pht('Jump to previous inline comment, including hidden comments.'),
265+
'Jump to next inline comment, including collapsed comments.' =>
266+
pht('Jump to next inline comment, including collapsed comments.'),
267+
'Jump to previous inline comment, including collapsed comments.' =>
268+
pht('Jump to previous inline comment, including collapsed comments.'),
269269

270270
'This file content has been collapsed.' =>
271271
pht('This file content has been collapsed.'),

src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public function render() {
265265
if (!$this->preview && $this->canHide()) {
266266
$action_buttons[] = id(new PHUIButtonView())
267267
->setTag('a')
268-
->setTooltip(pht('Hide Comment'))
268+
->setTooltip(pht('Collapse'))
269269
->setIcon('fa-times')
270270
->addSigil('hide-inline')
271271
->setMustCapture(true);

src/infrastructure/diff/view/PHUIDiffRevealIconView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public function render() {
88
->addSigil('has-tooltip')
99
->setMetadata(
1010
array(
11-
'tip' => pht('Show Hidden Comment'),
11+
'tip' => pht('Expand'),
1212
'align' => 'E',
1313
'size' => 275,
1414
));

webroot/rsrc/js/application/diff/DiffChangeset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ JX.install('DiffChangeset', {
446446
type: block.type,
447447
changeset: this,
448448
target: inline,
449-
hidden: inline.isHidden(),
449+
collapsed: inline.isCollapsed(),
450450
deleted: !inline.getID() && !inline.isEditing(),
451451
nodes: {
452452
begin: block.items[jj],

webroot/rsrc/js/application/diff/DiffChangesetList.js

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ JX.install('DiffChangesetList', {
1919
var onmenu = JX.bind(this, this._ifawake, this._onmenu);
2020
JX.Stratcom.listen('click', 'differential-view-options', onmenu);
2121

22-
var onhide = JX.bind(this, this._ifawake, this._onhide);
23-
JX.Stratcom.listen('click', 'hide-inline', onhide);
22+
var oncollapse = JX.bind(this, this._ifawake, this._oncollapse, true);
23+
JX.Stratcom.listen('click', 'hide-inline', oncollapse);
2424

25-
var onreveal = JX.bind(this, this._ifawake, this._onreveal);
26-
JX.Stratcom.listen('click', 'reveal-inline', onreveal);
25+
var onexpand = JX.bind(this, this._ifawake, this._oncollapse, false);
26+
JX.Stratcom.listen('click', 'reveal-inline', onexpand);
2727

2828
var onedit = JX.bind(this, this._ifawake, this._onaction, 'edit');
2929
JX.Stratcom.listen(
@@ -158,11 +158,11 @@ JX.install('DiffChangesetList', {
158158
label = pht('Jump to previous inline comment.');
159159
this._installJumpKey('p', label, -1, 'comment');
160160

161-
label = pht('Jump to next inline comment, including hidden comments.');
161+
label = pht('Jump to next inline comment, including collapsed comments.');
162162
this._installJumpKey('N', label, 1, 'comment', true);
163163

164164
label = pht(
165-
'Jump to previous inline comment, including hidden comments.');
165+
'Jump to previous inline comment, including collapsed comments.');
166166
this._installJumpKey('P', label, -1, 'comment', true);
167167

168168
label = pht('Hide or show the current file.');
@@ -183,8 +183,8 @@ JX.install('DiffChangesetList', {
183183
label = pht('Mark or unmark selected inline comment as done.');
184184
this._installKey('w', label, this._onkeydone);
185185

186-
label = pht('Hide or show inline comment.');
187-
this._installKey('q', label, this._onkeyhide);
186+
label = pht('Collapse or expand inline comment.');
187+
this._installKey('q', label, this._onkeycollapse);
188188
},
189189

190190
isAsleep: function() {
@@ -261,12 +261,12 @@ JX.install('DiffChangesetList', {
261261
.register();
262262
},
263263

264-
_installJumpKey: function(key, label, delta, filter, show_hidden) {
264+
_installJumpKey: function(key, label, delta, filter, show_collapsed) {
265265
filter = filter || null;
266266

267267
var options = {
268268
filter: filter,
269-
hidden: show_hidden
269+
collapsed: show_collapsed
270270
};
271271

272272
var handler = JX.bind(this, this._onjumpkey, delta, options);
@@ -424,16 +424,16 @@ JX.install('DiffChangesetList', {
424424
this._warnUser(pht('You must select a file to hide or show.'));
425425
},
426426

427-
_onkeyhide: function() {
427+
_onkeycollapse: function() {
428428
var cursor = this._cursorItem;
429429

430430
if (cursor) {
431431
if (cursor.type == 'comment') {
432432
var inline = cursor.target;
433-
if (inline.canHide()) {
433+
if (inline.canCollapse()) {
434434
this.setFocus(null);
435435

436-
inline.setHidden(!inline.isHidden());
436+
inline.setCollapsed(!inline.isCollapsed());
437437
return;
438438
}
439439
}
@@ -455,7 +455,7 @@ JX.install('DiffChangesetList', {
455455
var state = this._getSelectionState();
456456

457457
var filter = options.filter || null;
458-
var hidden = options.hidden || false;
458+
var collapsed = options.collapsed || false;
459459
var wrap = options.wrap || false;
460460
var attribute = options.attribute || null;
461461

@@ -507,10 +507,10 @@ JX.install('DiffChangesetList', {
507507
}
508508
}
509509

510-
// If the item is hidden, don't select it when iterating with jump
510+
// If the item is collapsed, don't select it when iterating with jump
511511
// keys. It can still potentially be selected in other ways.
512-
if (!hidden) {
513-
if (items[cursor].hidden) {
512+
if (!collapsed) {
513+
if (items[cursor].collapsed) {
514514
continue;
515515
}
516516
}
@@ -851,20 +851,12 @@ JX.install('DiffChangesetList', {
851851
menu.open();
852852
},
853853

854-
_onhide: function(e) {
855-
this._onhidereveal(e, true);
856-
},
857-
858-
_onreveal: function(e) {
859-
this._onhidereveal(e, false);
860-
},
861-
862-
_onhidereveal: function(e, is_hide) {
854+
_oncollapse: function(is_collapse, e) {
863855
e.kill();
864856

865857
var inline = this._getInlineForEvent(e);
866858

867-
inline.setHidden(is_hide);
859+
inline.setCollapsed(is_collapse);
868860
},
869861

870862
_onresize: function() {

webroot/rsrc/js/application/diff/DiffInline.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ JX.install('DiffInline', {
1414
_phid: null,
1515
_changesetID: null,
1616
_row: null,
17-
_hidden: false,
1817
_number: null,
1918
_length: null,
2019
_displaySide: null,
@@ -30,6 +29,7 @@ JX.install('DiffInline', {
3029

3130
_changeset: null,
3231

32+
_isCollapsed: false,
3333
_isDraft: null,
3434
_isFixed: null,
3535
_isEditing: false,
@@ -41,7 +41,7 @@ JX.install('DiffInline', {
4141

4242
var row_data = JX.Stratcom.getData(row);
4343
row_data.inline = this;
44-
this._hidden = row_data.hidden || false;
44+
this._isCollapsed = row_data.hidden || false;
4545

4646
// TODO: Get smarter about this once we do more editing, this is pretty
4747
// hacky.
@@ -225,7 +225,7 @@ JX.install('DiffInline', {
225225
return true;
226226
},
227227

228-
canHide: function() {
228+
canCollapse: function() {
229229
if (!JX.DOM.scry(this._row, 'a', 'hide-inline').length) {
230230
return false;
231231
}
@@ -254,20 +254,18 @@ JX.install('DiffInline', {
254254

255255
this._id = null;
256256
this._phid = null;
257-
this._hidden = false;
257+
this._isCollapsed = false;
258258

259259
this._originalText = null;
260260

261261
return row;
262262
},
263263

264-
setHidden: function(hidden) {
265-
this._hidden = hidden;
266-
267-
JX.DOM.alterClass(this._row, 'inline-hidden', this._hidden);
264+
setCollapsed: function(collapsed) {
265+
this._isCollapsed = collapsed;
268266

269267
var op;
270-
if (hidden) {
268+
if (collapsed) {
271269
op = 'hide';
272270
} else {
273271
op = 'show';
@@ -280,11 +278,12 @@ JX.install('DiffInline', {
280278
.setHandler(JX.bag)
281279
.start();
282280

281+
this._redraw();
283282
this._didUpdate(true);
284283
},
285284

286-
isHidden: function() {
287-
return this._hidden;
285+
isCollapsed: function() {
286+
return this._isCollapsed;
288287
},
289288

290289
toggleDone: function() {
@@ -703,11 +702,13 @@ JX.install('DiffInline', {
703702

704703
_redraw: function() {
705704
var is_invisible = (this._isInvisible || this._isDeleted);
706-
var is_loading = (this._isLoading);
705+
var is_loading = this._isLoading;
706+
var is_collapsed = this._isCollapsed;
707707

708708
var row = this._row;
709709
JX.DOM.alterClass(row, 'differential-inline-hidden', is_invisible);
710710
JX.DOM.alterClass(row, 'differential-inline-loading', is_loading);
711+
JX.DOM.alterClass(row, 'inline-hidden', is_collapsed);
711712
},
712713

713714
_removeRow: function(row) {

0 commit comments

Comments
 (0)