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

Provide a clearer UI for "view all results" in partial result panels

Summary:
In some cases, we show a limited number of one type of object somewhere else, like "Recent Such-And-Such" or "Herald Rules Which Use This" or whatever.

We don't do a very good job of communicating that these are partial lists, or how to see all the results. Usually there's a button in the upper right, which is fine, but this could be better.

Add an explicit "more stuff" button that shows up where a pager would appear and makes it clear that (a) the list is partial; and (b) you can click the button to see everything.

Test Plan: {F6302793}

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

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

+53 -5
+3 -3
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '3c8a0668', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => 'b797945d', 12 + 'core.pkg.css' => '2dd936d6', 13 13 'core.pkg.js' => 'eb53fc5b', 14 14 'differential.pkg.css' => '8d8360fb', 15 15 'differential.pkg.js' => '67e02996', ··· 132 132 'rsrc/css/phui/object-item/phui-oi-color.css' => 'b517bfa0', 133 133 'rsrc/css/phui/object-item/phui-oi-drag-ui.css' => 'da15d3dc', 134 134 'rsrc/css/phui/object-item/phui-oi-flush-ui.css' => '490e2e2e', 135 - 'rsrc/css/phui/object-item/phui-oi-list-view.css' => '909f3844', 135 + 'rsrc/css/phui/object-item/phui-oi-list-view.css' => 'a65865a7', 136 136 'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => '6a30fa46', 137 137 'rsrc/css/phui/phui-action-list.css' => 'c4972757', 138 138 'rsrc/css/phui/phui-action-panel.css' => '6c386cbf', ··· 853 853 'phui-oi-color-css' => 'b517bfa0', 854 854 'phui-oi-drag-ui-css' => 'da15d3dc', 855 855 'phui-oi-flush-ui-css' => '490e2e2e', 856 - 'phui-oi-list-view-css' => '909f3844', 856 + 'phui-oi-list-view-css' => 'a65865a7', 857 857 'phui-oi-simple-ui-css' => '6a30fa46', 858 858 'phui-pager-css' => 'd022c7ad', 859 859 'phui-pinboard-view-css' => '1f08f5d8',
+20 -2
src/applications/harbormaster/controller/HarbormasterPlanViewController.php
··· 455 455 private function newBuildsView(HarbormasterBuildPlan $plan) { 456 456 $viewer = $this->getViewer(); 457 457 458 + $limit = 10; 458 459 $builds = id(new HarbormasterBuildQuery()) 459 460 ->setViewer($viewer) 460 461 ->withBuildPlanPHIDs(array($plan->getPHID())) 461 - ->setLimit(10) 462 + ->setLimit($limit + 1) 462 463 ->execute(); 464 + 465 + $more_results = (count($builds) > $limit); 466 + $builds = array_slice($builds, 0, $limit); 463 467 464 468 $list = id(new HarbormasterBuildView()) 465 469 ->setViewer($viewer) ··· 471 475 $more_href = new PhutilURI( 472 476 $this->getApplicationURI('/build/'), 473 477 array('plan' => $plan->getPHID())); 478 + 479 + if ($more_results) { 480 + $list->newTailButton() 481 + ->setHref($more_href); 482 + } 474 483 475 484 $more_link = id(new PHUIButtonView()) 476 485 ->setTag('a') ··· 491 500 private function newRulesView(HarbormasterBuildPlan $plan) { 492 501 $viewer = $this->getViewer(); 493 502 503 + $limit = 10; 494 504 $rules = id(new HeraldRuleQuery()) 495 505 ->setViewer($viewer) 496 506 ->withDisabled(false) 497 507 ->withAffectedObjectPHIDs(array($plan->getPHID())) 498 508 ->needValidateAuthors(true) 499 - ->setLimit(10) 509 + ->setLimit($limit + 1) 500 510 ->execute(); 511 + 512 + $more_results = (count($rules) > $limit); 513 + $rules = array_slice($rules, 0, $limit); 501 514 502 515 $list = id(new HeraldRuleListView()) 503 516 ->setViewer($viewer) ··· 509 522 $more_href = new PhutilURI( 510 523 '/herald/', 511 524 array('affectedPHID' => $plan->getPHID())); 525 + 526 + if ($more_results) { 527 + $list->newTailButton() 528 + ->setHref($more_href); 529 + } 512 530 513 531 $more_link = id(new PHUIButtonView()) 514 532 ->setTag('a')
+24
src/view/phui/PHUIObjectItemListView.php
··· 12 12 private $drag; 13 13 private $allowEmptyList; 14 14 private $itemClass = 'phui-oi-standard'; 15 + private $tail = array(); 15 16 16 17 public function setAllowEmptyList($allow_empty_list) { 17 18 $this->allowEmptyList = $allow_empty_list; ··· 72 73 return 'ul'; 73 74 } 74 75 76 + public function newTailButton() { 77 + $button = id(new PHUIButtonView()) 78 + ->setTag('a') 79 + ->setColor(PHUIButtonView::GREY) 80 + ->setIcon('fa-chevron-down') 81 + ->setText(pht('View All Results')); 82 + 83 + $this->tail[] = $button; 84 + 85 + return $button; 86 + } 87 + 75 88 protected function getTagAttributes() { 76 89 $classes = array(); 77 90 $classes[] = 'phui-oi-list-view'; ··· 149 162 $pager = $this->pager; 150 163 } 151 164 165 + $tail = array(); 166 + foreach ($this->tail as $tail_item) { 167 + $tail[] = phutil_tag( 168 + 'li', 169 + array( 170 + 'class' => 'phui-oi-tail', 171 + ), 172 + $tail_item); 173 + } 174 + 152 175 return array( 153 176 $header, 154 177 $items, 178 + $tail, 155 179 $pager, 156 180 $this->renderChildren(), 157 181 );
+6
webroot/rsrc/css/phui/object-item/phui-oi-list-view.css
··· 720 720 .differential-revision-small .phui-icon-view { 721 721 color: #6699ba; 722 722 } 723 + 724 + .phui-oi-tail { 725 + text-align: center; 726 + padding: 8px 0; 727 + background: linear-gradient({$lightbluebackground}, #fff 66%, #fff); 728 + }