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

For actions in list views, render name as tooltip if available

Summary: While the icons are sometimes pretty obvious ("X" for delete, "pencil" for edit), some are more obscure ("Disable", "Ignore"), especially if you haven't seen the interface before. If a name is available, render it as a tooltip.

Test Plan: {F49905}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

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

+39 -14
+3
src/view/layout/PhabricatorObjectItemView.php
··· 427 427 428 428 $actions = array(); 429 429 if ($this->actions) { 430 + Javelin::initBehavior('phabricator-tooltips'); 431 + 430 432 foreach (array_reverse($this->actions) as $action) { 433 + $action->setRenderNameAsTooltip(true); 431 434 $actions[] = $action; 432 435 } 433 436 $actions = phutil_tag(
+36 -14
src/view/phui/PHUIListItemView.php
··· 19 19 private $selected; 20 20 private $containerAttrs; 21 21 private $disabled; 22 + private $renderNameAsTooltip; 23 + 24 + 25 + public function setRenderNameAsTooltip($render_name_as_tooltip) { 26 + $this->renderNameAsTooltip = $render_name_as_tooltip; 27 + return $this; 28 + } 29 + 30 + public function getRenderNameAsTooltip() { 31 + return $this->renderNameAsTooltip; 32 + } 22 33 23 34 public function setSelected($selected) { 24 35 $this->selected = $selected; ··· 117 128 protected function getTagContent() { 118 129 $name = null; 119 130 $icon = null; 131 + $meta = null; 132 + $sigil = null; 120 133 121 134 if ($this->name) { 122 - $external = null; 123 - if ($this->isExternal) { 124 - $external = " \xE2\x86\x97"; 135 + if ($this->getRenderNameAsTooltip()) { 136 + $sigil = 'has-tooltip'; 137 + $meta = array( 138 + 'tip' => $this->name, 139 + ); 140 + } else { 141 + $external = null; 142 + if ($this->isExternal) { 143 + $external = " \xE2\x86\x97"; 144 + } 145 + 146 + $name = phutil_tag( 147 + 'span', 148 + array( 149 + 'class' => 'phui-list-item-name', 150 + ), 151 + array( 152 + $this->name, 153 + $external, 154 + )); 125 155 } 126 - 127 - $name = phutil_tag( 128 - 'span', 129 - array( 130 - 'class' => 'phui-list-item-name', 131 - ), 132 - array( 133 - $this->name, 134 - $external, 135 - )); 136 156 } 137 157 138 158 if ($this->icon) { ··· 147 167 ->setSpriteIcon($icon_name); 148 168 } 149 169 150 - return phutil_tag( 170 + return javelin_tag( 151 171 $this->href ? 'a' : 'div', 152 172 array( 153 173 'href' => $this->href, 154 174 'class' => $this->href ? 'phui-list-item-href' : null, 175 + 'meta' => $meta, 176 + 'sigil' => $sigil, 155 177 ), 156 178 array( 157 179 $icon,