Skip to content

Commit c4856c3

Browse files
author
epriestley
committedMar 29, 2019
Fix content overflow in user hovercards
Summary: Fixes T13273. This element is a bit weird, but I think I fixed it without breaking anything. The CSS is used by project hovercards and user hovercards, but they each have a class which builds mostly-shared-but-not-really-identical CSS, instead of having a single `View` class with modes. So I'm not 100% sure I didn't break something obscure, but I couldn't find anything this breaks. The major issue is that all the text content has "position: absolute". Instead, make the image "absolute" and the text actual positioned content. Then fix all the margins/padding/spacing/layout and add overflow. Seems to work? Plus: hide availability for disabled users, for consistency with D20342. Test Plan: Before: {F6320155} After: {F6320156} I think this is pixel-exact except for the overflow behavior. Also: - Viewed some other user hovercards, including a disabled user. They all looked unchanged. - Viewed some project hovercards. They all looked good, too. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13273 Differential Revision: https://secure.phabricator.com/D20344
1 parent eecee17 commit c4856c3

File tree

3 files changed

+33
-16
lines changed

3 files changed

+33
-16
lines changed
 

‎resources/celerity/map.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
'rsrc/css/application/policy/policy-transaction-detail.css' => 'c02b8384',
100100
'rsrc/css/application/policy/policy.css' => 'ceb56a08',
101101
'rsrc/css/application/ponder/ponder-view.css' => '05a09d0a',
102-
'rsrc/css/application/project/project-card-view.css' => '3b1f7b20',
102+
'rsrc/css/application/project/project-card-view.css' => '4e7371cd',
103103
'rsrc/css/application/project/project-triggers.css' => 'cb866c2d',
104104
'rsrc/css/application/project/project-view.css' => '567858b3',
105105
'rsrc/css/application/releeph/releeph-core.css' => 'f81ff2db',
@@ -881,7 +881,7 @@
881881
'policy-edit-css' => '8794e2ed',
882882
'policy-transaction-detail-css' => 'c02b8384',
883883
'ponder-view-css' => '05a09d0a',
884-
'project-card-view-css' => '3b1f7b20',
884+
'project-card-view-css' => '4e7371cd',
885885
'project-triggers-css' => 'cb866c2d',
886886
'project-view-css' => '567858b3',
887887
'releeph-core' => 'f81ff2db',

‎src/applications/people/view/PhabricatorUserCardView.php

+12-9
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,17 @@ protected function getTagContent() {
9595
'fa-user-plus',
9696
phabricator_date($user->getDateCreated(), $viewer));
9797

98-
if (PhabricatorApplication::isClassInstalledForViewer(
99-
'PhabricatorCalendarApplication',
100-
$viewer)) {
101-
$body[] = $this->addItem(
102-
'fa-calendar-o',
103-
id(new PHUIUserAvailabilityView())
104-
->setViewer($viewer)
105-
->setAvailableUser($user));
98+
$has_calendar = PhabricatorApplication::isClassInstalledForViewer(
99+
'PhabricatorCalendarApplication',
100+
$viewer);
101+
if ($has_calendar) {
102+
if (!$user->getIsDisabled()) {
103+
$body[] = $this->addItem(
104+
'fa-calendar-o',
105+
id(new PHUIUserAvailabilityView())
106+
->setViewer($viewer)
107+
->setAvailableUser($user));
108+
}
106109
}
107110

108111
$classes[] = 'project-card-image';
@@ -150,8 +153,8 @@ protected function getTagContent() {
150153
'class' => 'project-card-inner',
151154
),
152155
array(
153-
$image,
154156
$header,
157+
$image,
155158
));
156159

157160
return $card;

‎webroot/rsrc/css/application/project/project-card-view.css

+19-5
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,36 @@
3636
}
3737

3838
.project-card-view .project-card-image {
39+
position: absolute;
3940
height: 140px;
4041
width: 140px;
41-
margin: 6px;
42+
top: 6px;
43+
left: 6px;
4244
border-radius: 3px;
4345
}
4446

4547
.project-card-view .project-card-image-href {
46-
display: inline-block;
48+
display: block;
4749
}
4850

4951
.project-card-view .project-card-item div {
5052
display: inline;
5153
}
5254

55+
.project-card-inner {
56+
position: relative;
57+
}
58+
59+
.people-card-view .project-card-inner {
60+
padding: 6px;
61+
min-height: 140px;
62+
}
63+
5364
.project-card-view .project-card-item {
5465
margin-bottom: 2px;
66+
white-space: nowrap;
67+
overflow: hidden;
68+
text-overflow: ellipsis;
5569
}
5670

5771
.project-card-view .project-card-item-text {
@@ -63,9 +77,9 @@
6377
}
6478

6579
.project-card-view .project-card-header {
66-
position: absolute;
67-
top: 12px;
68-
left: 158px;
80+
margin-top: 6px;
81+
margin-left: 152px;
82+
overflow: hidden;
6983
}
7084

7185
.project-card-header .project-card-name {

0 commit comments

Comments
 (0)
Failed to load comments.