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

Improve handle/status list display on devices in commit graph lists

Summary: Ref T13552. Provide a richer handle/status list item for commit lists.

Test Plan: Viewed commits in various interfaces, saw richer information.

Maniphest Tasks: T13552

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

+234 -17
+4 -2
resources/celerity/map.php
··· 122 122 'rsrc/css/font/font-lato.css' => '23631304', 123 123 'rsrc/css/font/phui-font-icon-base.css' => '303c9b87', 124 124 'rsrc/css/fuel/fuel-grid.css' => '66697240', 125 + 'rsrc/css/fuel/fuel-handle-list.css' => '2c4cbeca', 125 126 'rsrc/css/fuel/fuel-map.css' => 'd6e31510', 126 - 'rsrc/css/fuel/fuel-menu.css' => 'cb35abe3', 127 + 'rsrc/css/fuel/fuel-menu.css' => '21f5d199', 127 128 'rsrc/css/layout/phabricator-source-code-view.css' => '03d7ac28', 128 129 'rsrc/css/phui/button/phui-button-bar.css' => 'a4aa75c4', 129 130 'rsrc/css/phui/button/phui-button-simple.css' => '1ff278aa', ··· 578 579 'font-fontawesome' => '3883938a', 579 580 'font-lato' => '23631304', 580 581 'fuel-grid-css' => '66697240', 582 + 'fuel-handle-list-css' => '2c4cbeca', 581 583 'fuel-map-css' => 'd6e31510', 582 - 'fuel-menu-css' => 'cb35abe3', 584 + 'fuel-menu-css' => '21f5d199', 583 585 'global-drag-and-drop-css' => '1d2713a4', 584 586 'harbormaster-css' => '8dfe16b2', 585 587 'herald-css' => '648d39e2',
+4
src/__phutil_library_map__.php
··· 1309 1309 'FuelGridCellView' => 'view/fuel/FuelGridCellView.php', 1310 1310 'FuelGridRowView' => 'view/fuel/FuelGridRowView.php', 1311 1311 'FuelGridView' => 'view/fuel/FuelGridView.php', 1312 + 'FuelHandleListItemView' => 'view/fuel/FuelHandleListItemView.php', 1313 + 'FuelHandleListView' => 'view/fuel/FuelHandleListView.php', 1312 1314 'FuelMapItemView' => 'view/fuel/FuelMapItemView.php', 1313 1315 'FuelMapView' => 'view/fuel/FuelMapView.php', 1314 1316 'FuelMenuItemView' => 'view/fuel/FuelMenuItemView.php', ··· 7452 7454 'FuelGridCellView' => 'FuelComponentView', 7453 7455 'FuelGridRowView' => 'FuelView', 7454 7456 'FuelGridView' => 'FuelComponentView', 7457 + 'FuelHandleListItemView' => 'FuelView', 7458 + 'FuelHandleListView' => 'FuelComponentView', 7455 7459 'FuelMapItemView' => 'AphrontView', 7456 7460 'FuelMapView' => 'FuelComponentView', 7457 7461 'FuelMenuItemView' => 'FuelView',
+28 -11
src/applications/diffusion/view/DiffusionCommitGraphView.php
··· 122 122 } 123 123 } 124 124 125 + $commits = $this->getCommitMap(); 126 + 127 + foreach ($commits as $commit) { 128 + $author_phid = $commit->getAuthorDisplayPHID(); 129 + if ($author_phid !== null) { 130 + $phids[] = $author_phid; 131 + } 132 + } 133 + 125 134 if ($show_auditors) { 126 - $commits = $this->getCommitMap(); 127 135 foreach ($commits as $commit) { 128 136 $audits = $commit->getAudits(); 129 137 foreach ($audits as $auditor) { ··· 188 196 if ($commit) { 189 197 $revisions = $this->getRevisions($commit); 190 198 if ($revisions) { 191 - $revision = head($revisions); 192 - $handle = $handles[$revision->getPHID()]; 199 + $list_view = $handles->newSublist(mpull($revisions, 'getPHID')) 200 + ->newListView(); 193 201 194 202 $property_list->newItem() 195 - ->setName(pht('Revision')) 196 - ->setValue($handle->renderLink()); 203 + ->setName(pht('Revisions')) 204 + ->setValue($list_view); 197 205 } 198 206 } 199 207 } ··· 422 430 423 431 $viewer = $this->getViewer(); 424 432 433 + $author_phid = $commit->getAuthorDisplayPHID(); 434 + if ($author_phid) { 435 + return $viewer->loadHandles(array($author_phid)) 436 + ->newListView(); 437 + } 438 + 425 439 return $commit->newCommitAuthorView($viewer); 426 440 } 427 441 ··· 504 518 $status = $commit->getAuditStatusObject(); 505 519 506 520 $text = $status->getName(); 507 - $color = $status->getColor(); 508 521 $icon = $status->getIcon(); 509 522 510 - $uri = $commit->getURI(); 511 - 512 - $is_disabled = false; 523 + $is_disabled = $status->isNoAudit(); 524 + if ($is_disabled) { 525 + $uri = null; 526 + $color = 'grey'; 527 + } else { 528 + $color = $status->getColor(); 529 + $uri = $commit->getURI(); 530 + } 513 531 } else { 514 532 $text = pht('No Audit'); 515 533 $color = 'grey'; ··· 616 634 617 635 $auditor_phids = mpull($auditors, 'getAuditorPHID'); 618 636 $auditor_list = $handles->newSublist($auditor_phids) 619 - ->renderList() 620 - ->setAsInline(true); 637 + ->newListView(); 621 638 622 639 return $auditor_list; 623 640 }
+4
src/applications/phid/handle/pool/PhabricatorHandleList.php
··· 104 104 ->setHandleList($this); 105 105 } 106 106 107 + public function newListView() { 108 + return id(new FuelHandleListView()) 109 + ->addHandleList($this); 110 + } 107 111 108 112 /** 109 113 * Return a @{class:PHUIHandleView} which can render a specific handle.
+99
src/view/fuel/FuelHandleListItemView.php
··· 1 + <?php 2 + 3 + final class FuelHandleListItemView 4 + extends FuelView { 5 + 6 + private $handle; 7 + 8 + public function setHandle(PhabricatorObjectHandle $handle) { 9 + $this->handle = $handle; 10 + return $this; 11 + } 12 + 13 + public function render() { 14 + $cells = array(); 15 + 16 + $cells[] = phutil_tag( 17 + 'div', 18 + array( 19 + 'class' => 'fuel-handle-list-item-cell fuel-handle-list-item-icon', 20 + ), 21 + $this->newIconView()); 22 + 23 + $cells[] = phutil_tag( 24 + 'div', 25 + array( 26 + 'class' => 'fuel-handle-list-item-cell fuel-handle-list-item-handle', 27 + ), 28 + $this->newHandleView()); 29 + 30 + $cells[] = phutil_tag( 31 + 'div', 32 + array( 33 + 'class' => 'fuel-handle-list-item-cell fuel-handle-list-item-note', 34 + ), 35 + $this->newNoteView()); 36 + 37 + return phutil_tag( 38 + 'div', 39 + array( 40 + 'class' => 'fuel-handle-list-item', 41 + ), 42 + $cells); 43 + } 44 + 45 + 46 + private function newIconView() { 47 + $icon_icon = null; 48 + $icon_image = null; 49 + $icon_color = null; 50 + 51 + $handle = $this->handle; 52 + if ($handle) { 53 + $icon_image = $handle->getImageURI(); 54 + if (!$icon_image) { 55 + $icon_icon = $handle->getIcon(); 56 + $icon_color = $handle->getIconColor(); 57 + } 58 + } 59 + 60 + if ($icon_image === null && $icon_icon === null) { 61 + return null; 62 + } 63 + 64 + $view = new PHUIIconView(); 65 + 66 + if ($icon_image !== null) { 67 + $view->setImage($icon_image); 68 + } else { 69 + if ($icon_color === null) { 70 + $icon_color = 'bluegrey'; 71 + } 72 + 73 + if ($icon_icon !== null) { 74 + $view->setIcon($icon_icon); 75 + } 76 + 77 + if ($icon_color !== null) { 78 + $view->setColor($icon_color); 79 + } 80 + } 81 + 82 + 83 + return $view; 84 + } 85 + 86 + private function newHandleView() { 87 + $handle = $this->handle; 88 + if ($handle) { 89 + return $handle->renderLink(); 90 + } 91 + 92 + return null; 93 + } 94 + 95 + private function newNoteView() { 96 + return null; 97 + } 98 + 99 + }
+58
src/view/fuel/FuelHandleListView.php
··· 1 + <?php 2 + 3 + final class FuelHandleListView 4 + extends FuelComponentView { 5 + 6 + private $items = array(); 7 + 8 + public function addHandleList(PhabricatorHandleList $list) { 9 + $this->items[] = array( 10 + 'type' => 'list', 11 + 'item' => $list, 12 + ); 13 + return $this; 14 + } 15 + 16 + public function render() { 17 + require_celerity_resource('fuel-handle-list-css'); 18 + 19 + $items = $this->items; 20 + 21 + $item_views = array(); 22 + foreach ($items as $item) { 23 + $item_type = $item['type']; 24 + $item_item = $item['item']; 25 + 26 + switch ($item_type) { 27 + case 'list': 28 + foreach ($item_item as $handle) { 29 + $item_views[] = id(new FuelHandleListItemView()) 30 + ->setHandle($handle); 31 + } 32 + break; 33 + } 34 + } 35 + 36 + $body = phutil_tag( 37 + 'div', 38 + array( 39 + 'class' => 'fuel-handle-list-body', 40 + ), 41 + $item_views); 42 + 43 + $list = phutil_tag( 44 + 'div', 45 + array( 46 + 'class' => 'fuel-handle-list', 47 + ), 48 + $body); 49 + 50 + return $this->newComponentTag( 51 + 'div', 52 + array( 53 + 'class' => 'fuel-handle-list-component', 54 + ), 55 + $list); 56 + } 57 + 58 + }
+33
webroot/rsrc/css/fuel/fuel-handle-list.css
··· 1 + /** 2 + * @provides fuel-handle-list-css 3 + */ 4 + 5 + .fuel-handle-list { 6 + display: table; 7 + max-width: 100%; 8 + } 9 + 10 + .fuel-handle-list-body { 11 + display: table-row-group; 12 + } 13 + 14 + .fuel-handle-list-item { 15 + display: table-row; 16 + } 17 + 18 + .fuel-handle-list-item-cell { 19 + display: table-cell; 20 + vertical-align: top; 21 + } 22 + 23 + .fuel-handle-list-item-icon { 24 + padding-right: 4px; 25 + } 26 + 27 + .fuel-handle-list-item-icon > .phui-icon-view { 28 + width: 18px; 29 + height: 18px; 30 + text-align: center; 31 + display: inline-block; 32 + background-size: 100%; 33 + }
+4 -4
webroot/rsrc/css/fuel/fuel-menu.css
··· 23 23 border-radius: 3px; 24 24 } 25 25 26 - .fuel-menu-item.disabled > .fuel-menu-item-link { 27 - color: {$lightgreytext}; 28 - } 29 - 30 26 .fuel-menu-item.has-link > .fuel-menu-item-link { 31 27 color: {$darkbluetext}; 32 28 cursor: pointer; 29 + } 30 + 31 + .fuel-menu-item.disabled > .fuel-menu-item-link { 32 + color: {$lightgreytext}; 33 33 } 34 34 35 35 .device-desktop .fuel-menu-item > .fuel-menu-item-link:hover {