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

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

+66 -73
+25 -25
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '1475bd91', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '4e99863c', 16 - 'differential.pkg.js' => 'b7504037', 16 + 'differential.pkg.js' => 'ee50e5ae', 17 17 'diffusion.pkg.css' => 'b93d9b8c', 18 18 'diffusion.pkg.js' => '6134c5a1', 19 19 'favicon.ico' => '30672e08', ··· 395 395 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 396 396 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 397 397 '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', 401 401 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 402 402 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 403 403 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', ··· 774 774 'phabricator-darklog' => 'c8e1ffe3', 775 775 'phabricator-darkmessage' => 'c48cccdd', 776 776 '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', 780 780 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 781 781 'phabricator-draggable-list' => 'bea6e7f4', 782 782 'phabricator-fatal-config-template-css' => '8f18fa41', ··· 1039 1039 'javelin-install', 1040 1040 'javelin-dom', 1041 1041 ), 1042 - '20553f71' => array( 1043 - 'javelin-dom', 1044 - ), 1045 1042 '2290aeef' => array( 1046 1043 'javelin-install', 1047 1044 'javelin-dom', ··· 1066 1063 '29274e2b' => array( 1067 1064 'javelin-install', 1068 1065 'javelin-util', 1069 - ), 1070 - '29bbc02c' => array( 1071 - 'javelin-install', 1072 - 'phuix-button-view', 1073 1066 ), 1074 1067 '2ae077e1' => array( 1075 1068 'javelin-behavior', ··· 1619 1612 'javelin-resource', 1620 1613 'javelin-routable', 1621 1614 ), 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 + ), 1622 1626 '960f6a39' => array( 1623 1627 'javelin-behavior', 1624 1628 'javelin-dom', ··· 1661 1665 ), 1662 1666 'a37126bd' => array( 1663 1667 'javelin-install', 1668 + 'javelin-dom', 1669 + ), 1670 + 'a386f83c' => array( 1664 1671 'javelin-dom', 1665 1672 ), 1666 1673 'a3a63478' => array( ··· 1986 1993 'javelin-uri', 1987 1994 'javelin-util', 1988 1995 ), 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 - ), 2000 1996 'd4eecc63' => array( 2001 1997 'javelin-behavior', 2002 1998 'javelin-dom', ··· 2157 2153 'javelin-mask', 2158 2154 'javelin-behavior-device', 2159 2155 'phabricator-keyboard-shortcut', 2156 + ), 2157 + 'fc6e482d' => array( 2158 + 'javelin-install', 2159 + 'phuix-button-view', 2160 2160 ), 2161 2161 'fc91ab6c' => array( 2162 2162 'javelin-behavior',
+6 -6
src/applications/differential/view/DifferentialChangesetListView.php
··· 257 257 'You must select a comment to mark done.' => 258 258 pht('You must select a comment to mark done.'), 259 259 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.'), 262 262 'You must select a comment to hide.' => 263 263 pht('You must select a comment to hide.'), 264 264 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.'), 269 269 270 270 'This file content has been collapsed.' => 271 271 pht('This file content has been collapsed.'),
+1 -1
src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
··· 265 265 if (!$this->preview && $this->canHide()) { 266 266 $action_buttons[] = id(new PHUIButtonView()) 267 267 ->setTag('a') 268 - ->setTooltip(pht('Hide Comment')) 268 + ->setTooltip(pht('Collapse')) 269 269 ->setIcon('fa-times') 270 270 ->addSigil('hide-inline') 271 271 ->setMustCapture(true);
+1 -1
src/infrastructure/diff/view/PHUIDiffRevealIconView.php
··· 8 8 ->addSigil('has-tooltip') 9 9 ->setMetadata( 10 10 array( 11 - 'tip' => pht('Show Hidden Comment'), 11 + 'tip' => pht('Expand'), 12 12 'align' => 'E', 13 13 'size' => 275, 14 14 ));
+1 -1
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 446 446 type: block.type, 447 447 changeset: this, 448 448 target: inline, 449 - hidden: inline.isHidden(), 449 + collapsed: inline.isCollapsed(), 450 450 deleted: !inline.getID() && !inline.isEditing(), 451 451 nodes: { 452 452 begin: block.items[jj],
+19 -27
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 19 19 var onmenu = JX.bind(this, this._ifawake, this._onmenu); 20 20 JX.Stratcom.listen('click', 'differential-view-options', onmenu); 21 21 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); 24 24 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); 27 27 28 28 var onedit = JX.bind(this, this._ifawake, this._onaction, 'edit'); 29 29 JX.Stratcom.listen( ··· 158 158 label = pht('Jump to previous inline comment.'); 159 159 this._installJumpKey('p', label, -1, 'comment'); 160 160 161 - label = pht('Jump to next inline comment, including hidden comments.'); 161 + label = pht('Jump to next inline comment, including collapsed comments.'); 162 162 this._installJumpKey('N', label, 1, 'comment', true); 163 163 164 164 label = pht( 165 - 'Jump to previous inline comment, including hidden comments.'); 165 + 'Jump to previous inline comment, including collapsed comments.'); 166 166 this._installJumpKey('P', label, -1, 'comment', true); 167 167 168 168 label = pht('Hide or show the current file.'); ··· 183 183 label = pht('Mark or unmark selected inline comment as done.'); 184 184 this._installKey('w', label, this._onkeydone); 185 185 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); 188 188 }, 189 189 190 190 isAsleep: function() { ··· 261 261 .register(); 262 262 }, 263 263 264 - _installJumpKey: function(key, label, delta, filter, show_hidden) { 264 + _installJumpKey: function(key, label, delta, filter, show_collapsed) { 265 265 filter = filter || null; 266 266 267 267 var options = { 268 268 filter: filter, 269 - hidden: show_hidden 269 + collapsed: show_collapsed 270 270 }; 271 271 272 272 var handler = JX.bind(this, this._onjumpkey, delta, options); ··· 424 424 this._warnUser(pht('You must select a file to hide or show.')); 425 425 }, 426 426 427 - _onkeyhide: function() { 427 + _onkeycollapse: function() { 428 428 var cursor = this._cursorItem; 429 429 430 430 if (cursor) { 431 431 if (cursor.type == 'comment') { 432 432 var inline = cursor.target; 433 - if (inline.canHide()) { 433 + if (inline.canCollapse()) { 434 434 this.setFocus(null); 435 435 436 - inline.setHidden(!inline.isHidden()); 436 + inline.setCollapsed(!inline.isCollapsed()); 437 437 return; 438 438 } 439 439 } ··· 455 455 var state = this._getSelectionState(); 456 456 457 457 var filter = options.filter || null; 458 - var hidden = options.hidden || false; 458 + var collapsed = options.collapsed || false; 459 459 var wrap = options.wrap || false; 460 460 var attribute = options.attribute || null; 461 461 ··· 507 507 } 508 508 } 509 509 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 511 511 // 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) { 514 514 continue; 515 515 } 516 516 } ··· 851 851 menu.open(); 852 852 }, 853 853 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) { 863 855 e.kill(); 864 856 865 857 var inline = this._getInlineForEvent(e); 866 858 867 - inline.setHidden(is_hide); 859 + inline.setCollapsed(is_collapse); 868 860 }, 869 861 870 862 _onresize: function() {
+13 -12
webroot/rsrc/js/application/diff/DiffInline.js
··· 14 14 _phid: null, 15 15 _changesetID: null, 16 16 _row: null, 17 - _hidden: false, 18 17 _number: null, 19 18 _length: null, 20 19 _displaySide: null, ··· 30 29 31 30 _changeset: null, 32 31 32 + _isCollapsed: false, 33 33 _isDraft: null, 34 34 _isFixed: null, 35 35 _isEditing: false, ··· 41 41 42 42 var row_data = JX.Stratcom.getData(row); 43 43 row_data.inline = this; 44 - this._hidden = row_data.hidden || false; 44 + this._isCollapsed = row_data.hidden || false; 45 45 46 46 // TODO: Get smarter about this once we do more editing, this is pretty 47 47 // hacky. ··· 225 225 return true; 226 226 }, 227 227 228 - canHide: function() { 228 + canCollapse: function() { 229 229 if (!JX.DOM.scry(this._row, 'a', 'hide-inline').length) { 230 230 return false; 231 231 } ··· 254 254 255 255 this._id = null; 256 256 this._phid = null; 257 - this._hidden = false; 257 + this._isCollapsed = false; 258 258 259 259 this._originalText = null; 260 260 261 261 return row; 262 262 }, 263 263 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; 268 266 269 267 var op; 270 - if (hidden) { 268 + if (collapsed) { 271 269 op = 'hide'; 272 270 } else { 273 271 op = 'show'; ··· 280 278 .setHandler(JX.bag) 281 279 .start(); 282 280 281 + this._redraw(); 283 282 this._didUpdate(true); 284 283 }, 285 284 286 - isHidden: function() { 287 - return this._hidden; 285 + isCollapsed: function() { 286 + return this._isCollapsed; 288 287 }, 289 288 290 289 toggleDone: function() { ··· 703 702 704 703 _redraw: function() { 705 704 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; 707 707 708 708 var row = this._row; 709 709 JX.DOM.alterClass(row, 'differential-inline-hidden', is_invisible); 710 710 JX.DOM.alterClass(row, 'differential-inline-loading', is_loading); 711 + JX.DOM.alterClass(row, 'inline-hidden', is_collapsed); 711 712 }, 712 713 713 714 _removeRow: function(row) {