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

Reduce drag-and-drop jank on dashboards

Summary:
Depends on D20414. Ref T13272. Several minor things here:

- Currently, you can drag panels underneath the invisible "there are no items in this column" div and the "Create Panel / Add Existing Panel" buttons. This is silly; stop it.
- Currently, when viewing a tab panel on a dashboard, you can drag the panels inside it. This is extremely silly. Make "movable" off by default and pass it through the async flow only when we actually need it.
- Make the whole "Add Tab..." virtual tab clickable to open the dropdown. This removes the rare exception/todo combo I added earlier. {key F}
- Add or remove some icons or something.

Test Plan: Moved panels around on dashboards. Tried to drag panels inside tab panels. Added tab. Things were less obviously broken.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13272

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

+70 -39
+21 -21
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '3c8a0668', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => '20f3fea5', 13 - 'core.pkg.js' => '69247edd', 12 + 'core.pkg.css' => '3dc188c0', 13 + 'core.pkg.js' => '9ac8af68', 14 14 'differential.pkg.css' => '8d8360fb', 15 15 'differential.pkg.js' => '67e02996', 16 16 'diffusion.pkg.css' => '42c75c37', ··· 134 134 'rsrc/css/phui/object-item/phui-oi-flush-ui.css' => '490e2e2e', 135 135 'rsrc/css/phui/object-item/phui-oi-list-view.css' => 'd7723ecc', 136 136 'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => '6a30fa46', 137 - 'rsrc/css/phui/phui-action-list.css' => '48a45c51', 137 + 'rsrc/css/phui/phui-action-list.css' => 'e820263c', 138 138 'rsrc/css/phui/phui-action-panel.css' => '6c386cbf', 139 139 'rsrc/css/phui/phui-badge.css' => '666e25ad', 140 140 'rsrc/css/phui/phui-basic-nav-view.css' => '56ebd66d', ··· 371 371 'rsrc/js/application/conpherence/behavior-toggle-widget.js' => '8f959ad0', 372 372 'rsrc/js/application/countdown/timer.js' => '6a162524', 373 373 'rsrc/js/application/daemon/behavior-bulk-job-reload.js' => '3829a3cf', 374 - 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => 'a871fe00', 375 - 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '7d33143d', 374 + 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '9c01e364', 375 + 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => 'a2ab19be', 376 376 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9', 377 377 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 378 378 'rsrc/js/application/diff/DiffChangeset.js' => 'd0a85a85', ··· 594 594 'javelin-behavior-conpherence-search' => '91befbcc', 595 595 'javelin-behavior-countdown-timer' => '6a162524', 596 596 'javelin-behavior-dark-console' => 'f39d968b', 597 - 'javelin-behavior-dashboard-async-panel' => 'a871fe00', 598 - 'javelin-behavior-dashboard-move-panels' => '7d33143d', 597 + 'javelin-behavior-dashboard-async-panel' => '9c01e364', 598 + 'javelin-behavior-dashboard-move-panels' => 'a2ab19be', 599 599 'javelin-behavior-dashboard-query-panel-select' => '1e413dc9', 600 600 'javelin-behavior-dashboard-tab-panel' => '0116d3e8', 601 601 'javelin-behavior-day-view' => '727a5a61', ··· 757 757 'path-typeahead' => 'ad486db3', 758 758 'people-picture-menu-item-css' => 'fe8e07cf', 759 759 'people-profile-css' => '2ea2daa1', 760 - 'phabricator-action-list-view-css' => '48a45c51', 760 + 'phabricator-action-list-view-css' => 'e820263c', 761 761 'phabricator-busy' => '5202e831', 762 762 'phabricator-chatlog-css' => 'abdc76ee', 763 763 'phabricator-content-source-view-css' => 'cdf0d579', ··· 1581 1581 'javelin-install', 1582 1582 'javelin-dom', 1583 1583 ), 1584 - '7d33143d' => array( 1585 - 'javelin-behavior', 1586 - 'javelin-dom', 1587 - 'javelin-util', 1588 - 'javelin-stratcom', 1589 - 'javelin-workflow', 1590 - 'phabricator-draggable-list', 1591 - ), 1592 1584 '80bff3af' => array( 1593 1585 'javelin-install', 1594 1586 'javelin-typeahead-source', ··· 1736 1728 'javelin-install', 1737 1729 'javelin-util', 1738 1730 ), 1731 + '9c01e364' => array( 1732 + 'javelin-behavior', 1733 + 'javelin-dom', 1734 + 'javelin-workflow', 1735 + ), 1739 1736 '9cec214e' => array( 1740 1737 'javelin-behavior', 1741 1738 'javelin-stratcom', ··· 1760 1757 'a241536a' => array( 1761 1758 'javelin-install', 1762 1759 ), 1760 + 'a2ab19be' => array( 1761 + 'javelin-behavior', 1762 + 'javelin-dom', 1763 + 'javelin-util', 1764 + 'javelin-stratcom', 1765 + 'javelin-workflow', 1766 + 'phabricator-draggable-list', 1767 + ), 1763 1768 'a4356cde' => array( 1764 1769 'javelin-install', 1765 1770 'javelin-dom', ··· 1788 1793 'a5257c4e' => array( 1789 1794 'javelin-install', 1790 1795 'javelin-dom', 1791 - ), 1792 - 'a871fe00' => array( 1793 - 'javelin-behavior', 1794 - 'javelin-dom', 1795 - 'javelin-workflow', 1796 1796 ), 1797 1797 'a9942052' => array( 1798 1798 'javelin-behavior',
+1
src/applications/dashboard/controller/panel/PhabricatorDashboardPanelRenderController.php
··· 36 36 ->setPanel($panel) 37 37 ->setPanelPHID($panel->getPHID()) 38 38 ->setParentPanelPHIDs($parent_phids) 39 + ->setMovable($request->getBool('movable')) 39 40 ->setHeaderMode($request->getStr('headerMode')) 40 41 ->setPanelKey($request->getStr('panelKey')); 41 42
+1
src/applications/dashboard/controller/panel/PhabricatorDashboardPanelViewController.php
··· 40 40 $timeline = $this->buildTransactionTimeline( 41 41 $panel, 42 42 new PhabricatorDashboardPanelTransactionQuery()); 43 + $timeline->setShouldTerminate(true); 43 44 44 45 $rendered_panel = id(new PhabricatorDashboardPanelRenderingEngine()) 45 46 ->setViewer($viewer)
+2 -1
src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
··· 12 12 private $enableAsyncRendering; 13 13 private $parentPanelPHIDs; 14 14 private $headerMode = self::HEADER_MODE_NORMAL; 15 - private $movable = true; 15 + private $movable; 16 16 private $panelHandle; 17 17 private $editMode; 18 18 private $contextObject; ··· 195 195 'headerMode' => $this->getHeaderMode(), 196 196 'contextPHID' => $context_phid, 197 197 'panelKey' => $this->getPanelKey(), 198 + 'movable' => $this->getMovable(), 198 199 'uri' => '/dashboard/panel/render/'.$panel->getID().'/', 199 200 )); 200 201
+21 -6
src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
··· 80 80 ->setParentPanelPHIDs(array()) 81 81 ->setHeaderMode($h_mode) 82 82 ->setEditMode($is_editable) 83 + ->setMovable(true) 83 84 ->setPanelHandle($handles[$panel_phid]); 84 85 85 86 $panel = idx($panels, $panel_phid); ··· 92 93 93 94 $column_classes = $column->getClasses(); 94 95 96 + $column_tail = array(); 95 97 if ($is_editable) { 96 - $column_views[] = $this->renderAddPanelPlaceHolder(); 97 - $column_views[] = $this->renderAddPanelUI($column); 98 + $column_tail[] = $this->renderAddPanelPlaceHolder(); 99 + $column_tail[] = $this->renderAddPanelUI($column); 98 100 } 99 101 100 102 $sigil = 'dashboard-column'; ··· 103 105 'columnKey' => $column->getColumnKey(), 104 106 ); 105 107 108 + $column_view = javelin_tag( 109 + 'div', 110 + array( 111 + 'sigil' => $sigil, 112 + 'meta' => $metadata, 113 + ), 114 + $column_views); 115 + 106 116 $result->addColumn( 107 - $column_views, 108 - implode(' ', $column_classes), 109 - $sigil, 110 - $metadata); 117 + array( 118 + $column_view, 119 + $column_tail, 120 + ), 121 + implode(' ', $column_classes)); 111 122 } 112 123 113 124 if ($is_editable) { ··· 159 170 $create_button = id(new PHUIButtonView()) 160 171 ->setTag('a') 161 172 ->setHref($create_uri) 173 + ->setIcon('fa-plus') 174 + ->setColor(PHUIButtonView::GREY) 162 175 ->setWorkflow(true) 163 176 ->setText(pht('Create Panel')) 164 177 ->addClass(PHUI::MARGIN_MEDIUM); ··· 166 179 $add_button = id(new PHUIButtonView()) 167 180 ->setTag('a') 168 181 ->setHref($add_uri) 182 + ->setIcon('fa-window-maximize') 183 + ->setColor(PHUIButtonView::GREY) 169 184 ->setWorkflow(true) 170 185 ->setText(pht('Add Existing Panel')) 171 186 ->addClass(PHUI::MARGIN_MEDIUM);
+2 -5
src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php
··· 200 200 $list->addMenuItem( 201 201 id(new PHUIListItemView()) 202 202 ->setHref('#') 203 - ->setDisabled(true) 204 203 ->setSelected(false) 205 - ->setName(pht("\xC2\xB7 \xC2\xB7 \xC2\xB7")) 206 - ->setActionIcon('fa-caret-down', '#') 204 + ->setName(pht('Add Tab...')) 207 205 ->setDropdownMenu($actions)); 208 206 } 209 207 ··· 232 230 ->setPanel($subpanel) 233 231 ->setPanelPHID($subpanel->getPHID()) 234 232 ->setHeaderMode($no_headers) 235 - ->setMovable(false) 236 233 ->renderPanel(); 237 234 } else { 238 235 $panel_content = pht('(Invalid Panel)'); ··· 257 254 if (!$content) { 258 255 if ($is_edit) { 259 256 $message = pht( 260 - 'This tab panel does not have any tabs yet. Use "Add Tab" to '. 257 + 'This tab panel does not have any tabs yet. Use "Add Tab..." to '. 261 258 'create or place a tab.'); 262 259 } else { 263 260 $message = pht(
+15 -5
src/view/phui/PHUIListItemView.php
··· 245 245 $classes[] = 'phui-list-item-has-action-icon'; 246 246 } 247 247 248 + $sigil = null; 249 + $metadata = null; 248 250 if ($this->dropdownMenu) { 249 251 $classes[] = 'dropdown'; 250 252 if (!$this->actionIcon) { 251 - throw new Exception( 252 - pht( 253 - 'List item views can not currently render a dropdown without '. 254 - 'an action icon, because no application uses one. Clean up '. 255 - 'PHUICrumbsView, then add this capability.')); 253 + $classes[] = 'dropdown-with-caret'; 254 + Javelin::initBehavior('phui-dropdown-menu'); 255 + $sigil = 'phui-dropdown-menu'; 256 + $metadata = $this->dropdownMenu->getDropdownMenuMetadata(); 256 257 } 257 258 } 258 259 259 260 return array( 260 261 'class' => $classes, 262 + 'sigil' => $sigil, 263 + 'meta' => $metadata, 261 264 ); 262 265 } 263 266 ··· 372 375 $this->count); 373 376 } 374 377 378 + $caret = null; 379 + if ($this->dropdownMenu && !$this->actionIcon) { 380 + $caret = id(new PHUIIconView()) 381 + ->setIcon('fa-caret-down'); 382 + } 383 + 375 384 $icons = $this->getIcons(); 376 385 377 386 $list_item = javelin_tag( ··· 391 400 $this->renderChildren(), 392 401 $name, 393 402 $count, 403 + $caret, 394 404 )); 395 405 396 406 return array($list_item, $action_link);
+5
webroot/rsrc/css/phui/phui-action-list.css
··· 237 237 background-color: rgba({$alphablue}, 0.07); 238 238 color: {$sky}; 239 239 } 240 + 241 + .phui-list-navbar .dropdown-with-caret .phui-list-item-href 242 + .phui-icon-view { 243 + margin-left: 12px; 244 + }
+1
webroot/rsrc/js/application/dashboard/behavior-dashboard-async-panel.js
··· 13 13 parentPanelPHIDs: config.parentPanelPHIDs.join(','), 14 14 headerMode: config.headerMode, 15 15 contextPHID: config.contextPHID, 16 + movable: config.movable, 16 17 panelKey: config.panelKey 17 18 }; 18 19
+1 -1
webroot/rsrc/js/application/dashboard/behavior-dashboard-move-panels.js
··· 17 17 } 18 18 19 19 function markcolempty(col, toggle) { 20 - JX.DOM.alterClass(col, 'dashboard-column-empty', toggle); 20 + JX.DOM.alterClass(col.parentNode, 'dashboard-column-empty', toggle); 21 21 } 22 22 23 23 function onupdate(col) {