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

Fancier tooltips for revision lists

Summary:
Put flag note in a Javelin tooltip on the flag, and extra
reviewers in a Javelin tooltip on the (+N). This is a bit more expensive
because we have to fetch all of their usernames but I'm hoping that's
okay?

Test Plan:
Load a bunch of revision lists. Mouse on. Mouse off. Mouse
on. Mouse off.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

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

+29 -9
+16 -6
src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php
··· 145 145 $other_reviewers = array_flip($revision->getReviewers()); 146 146 unset($other_reviewers[$primary_reviewer]); 147 147 if ($other_reviewers) { 148 - $suffix = ' (+'.(count($other_reviewers)).')'; 148 + $names = array(); 149 + foreach ($other_reviewers as $reviewer => $_) { 150 + $names[] = phutil_escape_html( 151 + $this->getHandle($reviewer)->getLinkName()); 152 + } 153 + $suffix = ' '.javelin_render_tag( 154 + 'abbr', 155 + array( 156 + 'sigil' => 'has-tooltip', 157 + 'meta' => array( 158 + 'tip' => implode(', ', $names), 159 + 'align' => 'E', 160 + ), 161 + ), 162 + '(+'.(count($names)).')'); 149 163 } else { 150 164 $suffix = null; 151 165 } ··· 157 171 158 172 public function getRequiredHandlePHIDsForRevisionList( 159 173 DifferentialRevision $revision) { 160 - $primary_reviewer = $revision->getPrimaryReviewer(); 161 - if ($primary_reviewer) { 162 - return array($primary_reviewer); 163 - } 164 - return array(); 174 + return $revision->getReviewers(); 165 175 } 166 176 167 177 public function renderValueForMail($phase) {
+13 -3
src/applications/differential/view/DifferentialRevisionListView.php
··· 67 67 throw new Exception("Call setUser() before render()!"); 68 68 } 69 69 70 + Javelin::initBehavior('phabricator-tooltips', array()); 71 + require_celerity_resource('aphront-tooltip-css'); 72 + 70 73 $flags = id(new PhabricatorFlagQuery()) 71 74 ->withOwnerPHIDs(array($user->getPHID())) 72 75 ->withObjectPHIDs(mpull($this->revisions, 'getPHID')) ··· 85 88 if (isset($flagged[$phid])) { 86 89 $class = PhabricatorFlagColor::getCSSClass($flagged[$phid]->getColor()); 87 90 $note = $flagged[$phid]->getNote(); 88 - $flag = phutil_render_tag( 91 + $flag = javelin_render_tag( 89 92 'div', 90 - array( 93 + $note ? array( 94 + 'class' => 'phabricator-flag-icon '.$class, 95 + 'sigil' => 'has-tooltip', 96 + 'meta' => array( 97 + 'tip' => $note, 98 + 'align' => 'N', 99 + 'size' => 240, 100 + ), 101 + ) : array( 91 102 'class' => 'phabricator-flag-icon '.$class, 92 - 'title' => $note, 93 103 ), 94 104 ''); 95 105 }