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

Give application actors in feed reasonable icons

Summary:
Ref T8952. Currently, when an application (most commonly Herald, but sometimes Drydock, Diffusion, etc) publishes a feed story, we get an empty grey box for it in feed.

Instead, give the story a little application icon kind of "profile picture"-like thing.

Test Plan:
Here's how it looks:

{F1239003}

Feel free to tweak/counter-diff.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8952

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

+54 -12
+3 -3
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '31417876', 10 + 'core.pkg.css' => '04a95108', 11 11 'core.pkg.js' => '37344f3c', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '7ba78475', ··· 131 131 'rsrc/css/phui/phui-document-pro.css' => '73e45fd2', 132 132 'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf', 133 133 'rsrc/css/phui/phui-document.css' => '9c71d2bf', 134 - 'rsrc/css/phui/phui-feed-story.css' => '04aec08f', 134 + 'rsrc/css/phui/phui-feed-story.css' => 'd8440402', 135 135 'rsrc/css/phui/phui-fontkit.css' => '9cda225e', 136 136 'rsrc/css/phui/phui-form-view.css' => '6a51768e', 137 137 'rsrc/css/phui/phui-form.css' => 'aac1d51d', ··· 823 823 'phui-document-summary-view-css' => '9ca48bdf', 824 824 'phui-document-view-css' => '9c71d2bf', 825 825 'phui-document-view-pro-css' => '73e45fd2', 826 - 'phui-feed-story-css' => '04aec08f', 826 + 'phui-feed-story-css' => 'd8440402', 827 827 'phui-font-icon-base-css' => '6449bce8', 828 828 'phui-fontkit-css' => '9cda225e', 829 829 'phui-form-css' => 'aac1d51d',
+4 -2
src/applications/meta/phid/PhabricatorApplicationApplicationPHIDType.php
··· 37 37 foreach ($handles as $phid => $handle) { 38 38 $application = $objects[$phid]; 39 39 40 - $handle->setName($application->getName()); 41 - $handle->setURI($application->getApplicationURI()); 40 + $handle 41 + ->setName($application->getName()) 42 + ->setURI($application->getApplicationURI()) 43 + ->setIcon($application->getIcon()); 42 44 } 43 45 } 44 46
+9 -2
src/applications/transactions/feed/PhabricatorApplicationTransactionFeedStory.php
··· 99 99 } 100 100 } 101 101 102 - $view->setImage( 103 - $this->getHandle($xaction->getAuthorPHID())->getImageURI()); 102 + $author_phid = $xaction->getAuthorPHID(); 103 + $author_handle = $this->getHandle($author_phid); 104 + $author_image = $author_handle->getImageURI(); 105 + 106 + if ($author_image) { 107 + $view->setImage($author_image); 108 + } else { 109 + $view->setAuthorIcon($author_handle->getIcon()); 110 + } 104 111 105 112 return $view; 106 113 }
+22 -2
src/view/phui/PHUIFeedStoryView.php
··· 16 16 private $actions = array(); 17 17 private $chronologicalKey; 18 18 private $tags; 19 + private $authorIcon; 19 20 20 21 public function setTags($tags) { 21 22 $this->tags = $tags; ··· 80 81 public function setHref($href) { 81 82 $this->href = $href; 82 83 return $this; 84 + } 85 + 86 + public function setAuthorIcon($author_icon) { 87 + $this->authorIcon = $author_icon; 88 + return $this; 89 + } 90 + 91 + public function getAuthorIcon() { 92 + return $this->authorIcon; 83 93 } 84 94 85 95 public function setTokenBar(array $tokens) { ··· 163 173 $foot = null; 164 174 165 175 $actor = new PHUIIconView(); 166 - $actor->setImage($this->image); 167 - $actor->addClass('phui-feed-story-actor-image'); 176 + $actor->addClass('phui-feed-story-actor'); 177 + 178 + $author_icon = $this->getAuthorIcon(); 179 + 180 + if ($this->image) { 181 + $actor->addClass('phui-feed-story-actor-image'); 182 + $actor->setImage($this->image); 183 + } else if ($author_icon) { 184 + $actor->addClass('phui-feed-story-actor-icon'); 185 + $actor->setIcon($author_icon); 186 + } 187 + 168 188 if ($this->imageHref) { 169 189 $actor->setHref($this->imageHref); 170 190 }
+16 -3
webroot/rsrc/css/phui/phui-feed-story.css
··· 10 10 border: none; 11 11 } 12 12 13 - .phui-feed-story-head .phui-feed-story-actor-image { 13 + .phui-feed-story-head .phui-feed-story-actor { 14 14 width: 35px; 15 15 height: 35px; 16 - background-size: 35px; 17 16 float: left; 18 17 margin-right: 8px; 18 + border-radius: 3px; 19 19 box-shadow: {$borderinset}; 20 - border-radius: 3px; 20 + } 21 + 22 + .phui-feed-story-head .phui-feed-story-actor-image { 23 + background-size: 35px; 24 + } 25 + 26 + .phui-feed-story-head .phui-feed-story-actor-icon { 27 + text-align: center; 28 + vertical-align: middle; 29 + font-size: 24px; 30 + line-height: 35px; 31 + color: {$lightgreytext}; 32 + background: {$greybackground}; 21 33 } 34 + 22 35 23 36 .phui-feed-story-head { 24 37 padding: 12px 4px;