1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Curtain: add Hovercard support

Summary:
Before this change, the right navigation panel (Curtain) had info without Hovercard support.

After this change, all fields, like Subscribers, Tags, Referenced Files etc. have Hovercards.

If you meet an UX problem with a specific field with Hovercard, you can disable that specific
Hovercard, calling PHUICurtainObjectRefView::setHovercarded(false).

This is an example, now with Hovercard support:

{F342785}

Closes T15577

Test Plan:
No nuclear implosions when, on desktop and with a mouse:

Browse Maniphest Task and mouse hover Authored By, Assigned To, Subscribers, Referenced Files, ...

Browse Phriction document and mouse Tags, Referenced Files, Subscribers, ...

Browse single commit and mouse hover Referenced Files, Subscribers, ...

Browse Ponder question and mouse hover Tags, Referenced Files, Subscribers, ...

Browse Differential revision and mouse hover Tags, Referenced Files, Subscribers, ...

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15577

Differential Revision: https://we.phorge.it/D25424
This commit is contained in:
Valerio Bozzolan 2023-12-10 16:55:02 +01:00 committed by Valerio Bozzolan
parent 2ba2cbaf9b
commit 2295bcda14

View file

@ -7,6 +7,7 @@ final class PHUICurtainObjectRefView
private $epoch;
private $highlighted;
private $exiled;
private $hovercarded = true;
private $exileNote = false;
public function setHandle(PhabricatorObjectHandle $handle) {
@ -30,6 +31,11 @@ final class PHUICurtainObjectRefView
return $this;
}
public function setHovercarded($hovercarded) {
$this->hovercarded = $hovercarded;
return $this;
}
protected function getTagAttributes() {
$classes = array();
$classes[] = 'phui-curtain-object-ref-view';
@ -155,7 +161,11 @@ final class PHUICurtainObjectRefView
$handle = $this->handle;
if ($handle) {
$title_view = $handle->renderLink();
if ($this->hovercarded) {
$title_view = $handle->renderHovercardLink();
} else {
$title_view = $handle->renderLink();
}
}
return $title_view;