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

Add support for rendering section dividers in tables; use section dividers for changes on tasks

Summary: Depends on D20883. Ref T13440. In most cases, all changes belong to the same repository, which makes the "Repository" column redundant and visually noisy. Show repository information in a section header.

Test Plan: {F6989932}

Maniphest Tasks: T13440

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

+71 -20
+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' => '686ae87c', 12 + 'core.pkg.css' => '9a391b14', 13 13 'core.pkg.js' => '6e5c894f', 14 14 'differential.pkg.css' => '607c84be', 15 15 'differential.pkg.js' => '1b97518d', ··· 30 30 'rsrc/css/aphront/notification.css' => '30240bd2', 31 31 'rsrc/css/aphront/panel-view.css' => '46923d46', 32 32 'rsrc/css/aphront/phabricator-nav-view.css' => 'f8a0c1bf', 33 - 'rsrc/css/aphront/table-view.css' => '5f13a9e4', 33 + 'rsrc/css/aphront/table-view.css' => '061e45eb', 34 34 'rsrc/css/aphront/tokenizer.css' => 'b52d0668', 35 35 'rsrc/css/aphront/tooltip.css' => 'e3f2412f', 36 36 'rsrc/css/aphront/typeahead-browse.css' => 'b7ed02d2', ··· 535 535 'aphront-list-filter-view-css' => 'feb64255', 536 536 'aphront-multi-column-view-css' => 'fbc00ba3', 537 537 'aphront-panel-view-css' => '46923d46', 538 - 'aphront-table-view-css' => '5f13a9e4', 538 + 'aphront-table-view-css' => '061e45eb', 539 539 'aphront-tokenizer-control-css' => 'b52d0668', 540 540 'aphront-tooltip-css' => 'e3f2412f', 541 541 'aphront-typeahead-control-css' => '8779483d',
+36 -16
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 594 594 $handle_phids = array(); 595 595 $any_linked = false; 596 596 597 - $tail = array(); 597 + $idx = 0; 598 + $objects = array(); 598 599 foreach ($commit_phids as $commit_phid) { 599 600 $handle_phids[] = $commit_phid; 600 601 ··· 654 655 ); 655 656 } 656 657 657 - $tail[] = array( 658 + $objects[] = array( 658 659 'objectPHID' => $commit_phid, 659 660 'objectLink' => $object_link, 660 661 'repositoryPHID' => $repository_phid, 661 662 'revisionPHIDs' => $link_phids, 662 663 'status' => $status_view, 664 + 'order' => id(new PhutilSortVector()) 665 + ->addInt($repository_phid ? 1 : 0) 666 + ->addString((string)$repository_phid) 667 + ->addInt(1) 668 + ->addInt($idx++), 663 669 ); 664 670 } 665 671 666 - $head = array(); 667 672 foreach ($revision_phids as $revision_phid) { 668 673 $handle_phids[] = $revision_phid; 669 674 ··· 717 722 ); 718 723 } 719 724 720 - $head[] = array( 725 + $objects[] = array( 721 726 'objectPHID' => $revision_phid, 722 727 'objectLink' => $object_link, 723 728 'repositoryPHID' => $repository_phid, 724 729 'revisionPHIDs' => array(), 725 730 'status' => $status_view, 731 + 'order' => id(new PhutilSortVector()) 732 + ->addInt($repository_phid ? 1 : 0) 733 + ->addString((string)$repository_phid) 734 + ->addInt(0) 735 + ->addInt($idx++), 726 736 ); 727 737 } 728 738 729 - $objects = array_merge($head, $tail); 730 739 $handles = $viewer->loadHandles($handle_phids); 731 740 741 + $order = ipull($objects, 'order'); 742 + $order = msortv($order, 'getSelf'); 743 + $objects = array_select_keys($objects, array_keys($order)); 744 + 745 + $last_repository = false; 732 746 $rows = array(); 747 + $rowd = array(); 733 748 foreach ($objects as $object) { 749 + $repository_phid = $object['repositoryPHID']; 750 + if ($repository_phid !== $last_repository) { 751 + $repository_link = null; 752 + if ($repository_phid) { 753 + $repository_link = $handles[$repository_phid]->renderLink(); 754 + $rows[] = array( 755 + $repository_link, 756 + ); 757 + $rowd[] = true; 758 + } 759 + 760 + $last_repository = $repository_phid; 761 + } 762 + 734 763 $object_phid = $object['objectPHID']; 735 764 $handle = $handles[$object_phid]; 736 765 ··· 742 771 $object_icon = id(new PHUIIconView()) 743 772 ->setIcon($handle->getIcon()); 744 773 745 - $repository_link = null; 746 - $repository_phid = $object['repositoryPHID']; 747 - if ($repository_phid) { 748 - $repository_link = $handles[$repository_phid]->renderLink(); 749 - } 750 - 751 774 $status_view = $object['status']; 752 775 753 776 $revision_tags = array(); ··· 762 785 phutil_tag('br'), 763 786 $revision_tags); 764 787 788 + $rowd[] = false; 765 789 $rows[] = array( 766 790 $object_icon, 767 791 $status_view, 768 - $repository_link, 769 792 $revision_tags, 770 793 $object_link, 771 794 ); ··· 773 796 774 797 $changes_table = id(new AphrontTableView($rows)) 775 798 ->setNoDataString(pht('This task has no related commits or revisions.')) 799 + ->setRowDividers($rowd) 776 800 ->setHeaders( 777 801 array( 778 802 null, 779 803 null, 780 - pht('Repository'), 781 804 null, 782 805 pht('Revision/Commit'), 783 806 )) ··· 786 809 'center', 787 810 null, 788 811 null, 789 - null, 790 812 'wide pri object-link', 791 813 )) 792 814 ->setColumnVisibility( 793 815 array( 794 - true, 795 816 true, 796 817 true, 797 818 $any_linked, ··· 801 822 array( 802 823 false, 803 824 true, 804 - false, 805 825 false, 806 826 true, 807 827 ));
+26 -1
src/view/control/AphrontTableView.php
··· 24 24 protected $sortValues = array(); 25 25 private $deviceReadyTable; 26 26 27 + private $rowDividers = array(); 28 + 27 29 public function __construct(array $data) { 28 30 $this->data = $data; 29 31 } ··· 50 52 51 53 public function setColumnWidths(array $widths) { 52 54 $this->columnWidths = $widths; 55 + return $this; 56 + } 57 + 58 + public function setRowDividers(array $dividers) { 59 + $this->rowDividers = $dividers; 53 60 return $this; 54 61 } 55 62 ··· 258 265 } 259 266 } 260 267 268 + $dividers = $this->rowDividers; 269 + 261 270 $data = $this->data; 262 271 if ($data) { 263 272 $row_num = 0; 273 + $row_idx = 0; 264 274 foreach ($data as $row) { 275 + $is_divider = !empty($dividers[$row_num]); 276 + 265 277 $row_size = count($row); 266 278 while (count($row) > count($col_classes)) { 267 279 $col_classes[] = null; ··· 289 301 $class = trim($class.' '.$this->cellClasses[$row_num][$col_num]); 290 302 } 291 303 304 + if ($is_divider) { 305 + $tr[] = phutil_tag( 306 + 'td', 307 + array( 308 + 'class' => 'row-divider', 309 + 'colspan' => count($headers), 310 + ), 311 + $value); 312 + $row_idx = -1; 313 + break; 314 + } 315 + 292 316 $tr[] = phutil_tag( 293 317 'td', 294 318 array( ··· 299 323 } 300 324 301 325 $class = idx($this->rowClasses, $row_num); 302 - if ($this->zebraStripes && ($row_num % 2)) { 326 + if ($this->zebraStripes && ($row_idx % 2)) { 303 327 if ($class !== null) { 304 328 $class = 'alt alt-'.$class; 305 329 } else { ··· 309 333 310 334 $table[] = phutil_tag('tr', array('class' => $class), $tr); 311 335 ++$row_num; 336 + ++$row_idx; 312 337 } 313 338 } else { 314 339 $colspan = max(count(array_filter($visibility)), 1);
+6
webroot/rsrc/css/aphront/table-view.css
··· 55 55 background-color: {$lightbluebackground}; 56 56 } 57 57 58 + .aphront-table-view td.row-divider { 59 + background-color: {$bluebackground}; 60 + font-weight: bold; 61 + padding: 8px 12px; 62 + } 63 + 58 64 .aphront-table-view th { 59 65 border-bottom: 1px solid {$thinblueborder}; 60 66 }