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

[Redesign] People, Profile, Feed UI

Summary: Ref T8099, Mostly a Feed cleanup, removing old CSS, relying on modern display objects, adds back the feed to profile (I miss it, but maybe you don't).

Test Plan: Visit Feed on Profiles, Projects, Feed, and Dashboards. Same UI Everywhere. TODO, "Public Feed".

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8099

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

+55 -150
+3 -5
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '1b6e6a39', 10 + 'core.pkg.css' => '63bd9495', 11 11 'core.pkg.js' => 'fbf1d615', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => 'f89b49b6', ··· 98 98 'rsrc/css/application/ponder/feed.css' => 'e62615b6', 99 99 'rsrc/css/application/ponder/post.css' => '9d415218', 100 100 'rsrc/css/application/ponder/vote.css' => '8ed6ed8b', 101 - 'rsrc/css/application/profile/profile-view.css' => 'cb6f56b7', 102 101 'rsrc/css/application/projects/project-icon.css' => 'c2ecb7f1', 103 102 'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733', 104 103 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', ··· 130 129 'rsrc/css/phui/phui-button.css' => 'b995182d', 131 130 'rsrc/css/phui/phui-crumbs-view.css' => 'ce840ec2', 132 131 'rsrc/css/phui/phui-document.css' => '08f33f08', 133 - 'rsrc/css/phui/phui-feed-story.css' => '06872ae9', 132 + 'rsrc/css/phui/phui-feed-story.css' => '153a2ebf', 134 133 'rsrc/css/phui/phui-fontkit.css' => 'b664ac96', 135 134 'rsrc/css/phui/phui-form-view.css' => 'a0e8f168', 136 135 'rsrc/css/phui/phui-form.css' => 'f535f938', ··· 723 722 'phabricator-object-selector-css' => '029a133d', 724 723 'phabricator-phtize' => 'd254d646', 725 724 'phabricator-prefab' => '6920d200', 726 - 'phabricator-profile-css' => 'cb6f56b7', 727 725 'phabricator-remarkup-css' => '67a4ee29', 728 726 'phabricator-search-results-css' => 'ce897fb9', 729 727 'phabricator-shaped-request' => '7cbe244b', ··· 764 762 'phui-calendar-month-css' => '476be7e0', 765 763 'phui-crumbs-view-css' => 'ce840ec2', 766 764 'phui-document-view-css' => '08f33f08', 767 - 'phui-feed-story-css' => '06872ae9', 765 + 'phui-feed-story-css' => '153a2ebf', 768 766 'phui-font-icon-base-css' => '3dad2ae3', 769 767 'phui-fontkit-css' => 'b664ac96', 770 768 'phui-form-css' => 'f535f938',
-2
src/__phutil_library_map__.php
··· 2223 2223 'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php', 2224 2224 'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php', 2225 2225 'PhabricatorPeopleExternalPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalPHIDType.php', 2226 - 'PhabricatorPeopleFeedController' => 'applications/people/controller/PhabricatorPeopleFeedController.php', 2227 2226 'PhabricatorPeopleHovercardEventListener' => 'applications/people/event/PhabricatorPeopleHovercardEventListener.php', 2228 2227 'PhabricatorPeopleInviteController' => 'applications/people/controller/PhabricatorPeopleInviteController.php', 2229 2228 'PhabricatorPeopleInviteListController' => 'applications/people/controller/PhabricatorPeopleInviteListController.php', ··· 5633 5632 'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController', 5634 5633 'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController', 5635 5634 'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType', 5636 - 'PhabricatorPeopleFeedController' => 'PhabricatorPeopleController', 5637 5635 'PhabricatorPeopleHovercardEventListener' => 'PhabricatorEventListener', 5638 5636 'PhabricatorPeopleInviteController' => 'PhabricatorPeopleController', 5639 5637 'PhabricatorPeopleInviteListController' => 'PhabricatorPeopleInviteController',
+7 -5
src/applications/feed/builder/PhabricatorFeedBuilder.php
··· 83 83 $null_view->appendChild($view); 84 84 } 85 85 86 + $box = id(new PHUIObjectBoxView()) 87 + ->appendChild($null_view); 88 + 86 89 if (empty($stories)) { 87 90 $nodatastring = pht('No Stories.'); 88 91 if ($this->noDataString) { 89 92 $nodatastring = $this->noDataString; 90 93 } 91 94 92 - $view = id(new PHUIInfoView()) 93 - ->setSeverity(PHUIInfoView::SEVERITY_NODATA) 95 + $view = id(new PHUIBoxView()) 96 + ->addClass('mlt mlb msr msl') 94 97 ->appendChild($nodatastring); 95 - $null_view->appendChild($view); 98 + $box->appendChild($view); 96 99 } 97 100 98 - return id(new PHUIObjectBoxView()) 99 - ->appendChild($null_view); 101 + return $box; 100 102 101 103 } 102 104
-2
src/applications/people/controller/PhabricatorPeopleController.php
··· 16 16 if ($name) { 17 17 $nav->setBaseURI(new PhutilURI('/p/')); 18 18 $nav->addFilter("{$name}/", $name); 19 - $nav->addFilter("{$name}/feed/", pht('Feed')); 20 19 $nav->addFilter("{$name}/calendar/", pht('Calendar')); 21 20 } 22 21 } ··· 54 53 $nav->setIconNav(true); 55 54 $nav->setBaseURI(new PhutilURI('/p/')); 56 55 $nav->addIcon("{$name}/", $name, null, $picture); 57 - $nav->addIcon("{$name}/feed/", pht('Feed'), 'fa-newspaper-o'); 58 56 59 57 $class = 'PhabricatorCalendarApplication'; 60 58 if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
-61
src/applications/people/controller/PhabricatorPeopleFeedController.php
··· 1 - <?php 2 - 3 - final class PhabricatorPeopleFeedController 4 - extends PhabricatorPeopleController { 5 - 6 - private $username; 7 - 8 - public function shouldRequireAdmin() { 9 - return false; 10 - } 11 - 12 - public function willProcessRequest(array $data) { 13 - $this->username = idx($data, 'username'); 14 - } 15 - 16 - public function processRequest() { 17 - require_celerity_resource('phabricator-profile-css'); 18 - $viewer = $this->getRequest()->getUser(); 19 - $user = id(new PhabricatorPeopleQuery()) 20 - ->setViewer($viewer) 21 - ->withUsernames(array($this->username)) 22 - ->needProfileImage(true) 23 - ->executeOne(); 24 - 25 - if (!$user) { 26 - return new Aphront404Response(); 27 - } 28 - 29 - $query = new PhabricatorFeedQuery(); 30 - $query->setFilterPHIDs( 31 - array( 32 - $user->getPHID(), 33 - )); 34 - $query->setLimit(100); 35 - $query->setViewer($viewer); 36 - $stories = $query->execute(); 37 - 38 - $builder = new PhabricatorFeedBuilder($stories); 39 - $builder->setUser($viewer); 40 - $builder->setShowHovercards(true); 41 - $builder->setNoDataString( 42 - pht( 43 - 'To begin on such a grand journey, requires but just a single step.')); 44 - $view = $builder->buildView(); 45 - 46 - $feed = phutil_tag_div( 47 - 'phabricator-project-feed', 48 - $view->render()); 49 - $name = $user->getUsername(); 50 - 51 - $nav = $this->buildIconNavView($user); 52 - $nav->selectFilter("{$name}/feed/"); 53 - $nav->appendChild($feed); 54 - 55 - return $this->buildApplicationPage( 56 - $nav, 57 - array( 58 - 'title' => pht('Feed'), 59 - )); 60 - } 61 - }
+40 -17
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 26 26 return new Aphront404Response(); 27 27 } 28 28 29 - require_celerity_resource('phabricator-profile-css'); 30 - 31 29 $profile = $user->loadUserProfile(); 32 30 $username = phutil_escape_uri($user->getUserName()); 33 31 ··· 63 61 ->setHref($this->getApplicationURI('picture/'.$user->getID().'/')) 64 62 ->setDisabled(!$can_edit) 65 63 ->setWorkflow(!$can_edit)); 64 + 65 + $class = 'PhabricatorConpherenceApplication'; 66 + if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) { 67 + $href = '/conpherence/new/?participant='.$user->getPHID(); 68 + $actions->addAction( 69 + id(new PhabricatorActionView()) 70 + ->setIcon('fa-comments') 71 + ->setName(pht('Send Message')) 72 + ->setWorkflow(true) 73 + ->setHref($href)); 74 + } 66 75 67 76 if ($viewer->getIsAdmin()) { 68 77 $actions->addAction( ··· 134 143 $crumbs = $this->buildApplicationCrumbs(); 135 144 $crumbs->addTextCrumb($name); 136 145 137 - $class = 'PhabricatorConpherenceApplication'; 138 - if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) { 139 - $href = '/conpherence/new/?participant='.$user->getPHID(); 140 - $image = id(new PHUIIconView()) 141 - ->setIconFont('fa-comments'); 142 - $button = id(new PHUIButtonView()) 143 - ->setTag('a') 144 - ->setColor(PHUIButtonView::SIMPLE) 145 - ->setIcon($image) 146 - ->setHref($href) 147 - ->setText(pht('Send Message')) 148 - ->setWorkflow(true); 149 - $header->addActionLink($button); 150 - } 151 - 152 146 $object_box = id(new PHUIObjectBoxView()) 153 147 ->setHeader($header) 154 148 ->addPropertyList($properties); 155 149 150 + $feed = id(new PHUIObjectBoxView()) 151 + ->setHeaderText(pht('Recent Activity')) 152 + ->appendChild($this->buildPeopleFeed($user, $viewer)); 153 + 156 154 $nav = $this->buildIconNavView($user); 157 155 $nav->selectFilter("{$name}/"); 158 156 $nav->appendChild($object_box); 157 + $nav->appendChild($feed); 159 158 160 159 return $this->buildApplicationPage( 161 160 $nav, ··· 180 179 $field_list->appendFieldsToPropertyList($user, $viewer, $view); 181 180 182 181 return $view; 182 + } 183 + 184 + private function buildPeopleFeed( 185 + PhabricatorUser $user, 186 + $viewer) { 187 + 188 + $query = new PhabricatorFeedQuery(); 189 + $query->setFilterPHIDs( 190 + array( 191 + $user->getPHID(), 192 + )); 193 + $query->setLimit(100); 194 + $query->setViewer($viewer); 195 + $stories = $query->execute(); 196 + 197 + $builder = new PhabricatorFeedBuilder($stories); 198 + $builder->setUser($viewer); 199 + $builder->setShowHovercards(true); 200 + $builder->setNoDataString(pht('To begin on such a grand journey, '. 201 + 'requires but just a single step.')); 202 + $view = $builder->buildView(); 203 + 204 + return phutil_tag_div('phabricator-project-feed', $view->render()); 205 + 183 206 } 184 207 185 208 }
+4 -4
src/applications/project/controller/PhabricatorProjectFeedController.php
··· 32 32 ->setURI('/tag/'.$project->getPrimarySlug().'/'); 33 33 } 34 34 35 - require_celerity_resource('phabricator-profile-css'); 36 - 37 35 $query = new PhabricatorFeedQuery(); 38 36 $query->setFilterPHIDs( 39 37 array( ··· 44 42 $stories = $query->execute(); 45 43 $feed = $this->renderStories($stories); 46 44 47 - $content = phutil_tag_div('phabricator-project-feed', $feed); 45 + $box = id(new PHUIObjectBoxView()) 46 + ->setHeaderText(pht('Project Activity')) 47 + ->appendChild($feed); 48 48 49 49 $nav = $this->buildIconNavView($project); 50 50 $nav->selectFilter("feed/{$id}/"); 51 - $nav->appendChild($content); 51 + $nav->appendChild($box); 52 52 53 53 return $this->buildApplicationPage( 54 54 $nav,
-53
webroot/rsrc/css/application/profile/profile-view.css
··· 1 - /** 2 - * @provides phabricator-profile-css 3 - */ 4 - 5 - .device-desktop .profile-feed, 6 - .device-tablet .profile-feed { 7 - padding: 0 16px 16px 0; 8 - } 9 - 10 - .device-phone .profile-feed { 11 - padding: 12px 0; 12 - } 13 - 14 - .device-phone .phabricator-project-layout .profile-feed { 15 - padding: 12px 8px; 16 - } 17 - 18 - .profile-feed .phui-action-header-title { 19 - font-size: 16px; 20 - margin-bottom: 5px; 21 - } 22 - 23 - .profile-activity-view { 24 - padding-top: 16px; 25 - } 26 - 27 - .profile-activity-view .profile-calendar { 28 - float: left; 29 - margin: 0 16px; 30 - } 31 - 32 - .profile-activity-view .profile-feed { 33 - margin-left: 16px; 34 - } 35 - 36 - .device-phone .profile-activity-view .profile-feed { 37 - float: none; 38 - margin: 0 8px; 39 - } 40 - 41 - .device-desktop .phabricator-project-layout .profile-feed, 42 - .device-tablet .phabricator-project-layout .profile-feed { 43 - padding: 16px; 44 - } 45 - 46 - .phabricator-project-feed .phui-info-view { 47 - margin: 12px 0; 48 - } 49 - 50 - .device-phone .phabricator-project-feed { 51 - padding: 0 12px; 52 - width: auto; 53 - }
+1 -1
webroot/rsrc/css/phui/phui-feed-story.css
··· 2 2 * @provides phui-feed-story-css 3 3 */ 4 4 5 - .phabricator-feed-frame .phui-box.phui-feed-story { 5 + .phui-object-box .phui-box.phui-feed-story { 6 6 border-bottom: 1px solid {$thinblueborder}; 7 7 } 8 8