-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
report(redesign): tooltip for category description #8840
Conversation
<div class="lh-category-header__description"></div> | ||
<div class="lh-score__gauge"> | ||
<!-- Will be added to .lh-gauge__label via renderCategoryHeader --> | ||
<!-- <span class="tooltip-boundary"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should i make this a template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, i think so. include in this one and .remove() if there's no description?
<div class="lh-category-header__description"></div> | ||
<div class="lh-score__gauge"> | ||
<!-- Will be added to .lh-gauge__label via renderCategoryHeader --> | ||
<!-- <span class="tooltip-boundary"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, i think so. include in this one and .remove() if there's no description?
--lh-group-icon-background-size: var(--lh-score-icon-background-size); | ||
--lh-info-icon-background-size: 20px; | ||
--lh-score-icon-background-size: 24px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just -lh-score-icon-size ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw ur commenting on something i just reordered
i added --lh-info-icon-background-size
could rename stuff after all this tho
@@ -1289,7 +1291,7 @@ | |||
position: absolute; | |||
display: none; /* Don't retain these layers when not needed */ | |||
opacity: 0; | |||
background: #ffffff; | |||
background: var(--body-background-color); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
lighthouse-core/test/report/html/renderer/category-renderer-test.js is cranky. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm once tests are happy.
done. had to introduce a wrapper el so that the label el makes more sense :) |
@@ -185,7 +185,7 @@ describe('CategoryRenderer', () => { | |||
const categoryDOM = renderer.render(category, sampleResults.categoryGroups); | |||
assert.ok(categoryDOM.querySelector('.lh-gauge__wrapper--plugin')); | |||
const label = categoryDOM.querySelector('.lh-gauge__label').textContent; | |||
assert.equal(category.title, label); | |||
assert.equal(label, category.title); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was backwards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was backwards
just for code correctness purposes, not a functional change in the test, I hope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
can you resolve the conflict? |
Not functional. Error message was wrong when the test was failing.
…On Mon, May 6, 2019, 4:10 PM Brendan Kenny ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lighthouse-core/test/report/html/renderer/category-renderer-test.js
<#8840 (comment)>
:
> @@ -185,7 +185,7 @@ describe('CategoryRenderer', () => {
const categoryDOM = renderer.render(category, sampleResults.categoryGroups);
assert.ok(categoryDOM.querySelector('.lh-gauge__wrapper--plugin'));
const label = categoryDOM.querySelector('.lh-gauge__label').textContent;
- assert.equal(category.title, label);
+ assert.equal(label, category.title);
was backwards
just for code correctness purposes, not a functional change in the test, I
hope?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8840 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA7CAMVWFJGSEMJUS34OI63PUC3HNANCNFSM4HKWPGSA>
.
|
merged master next steps on this? |
|
incorporated @brendankenny's feedback |
Sorry @hoten seems like this regressed again at some point in the feedback cycle. |
oops, fixed that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -1246,7 +1281,6 @@ | |||
} | |||
|
|||
.lh-category-header .lh-score__gauge { | |||
max-width: 400px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just unnecessary or do we want the gauges to get bigger than this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary
@@ -1470,7 +1504,6 @@ | |||
display: block; | |||
animation: fadeInTooltip 250ms; | |||
animation-fill-mode: forwards; | |||
animation-delay: 850ms; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this removes this everywhere, we want that right? I would guess so because a lot of folks don't seem to know that they can hover over the error to get the tooltip 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I figured it doesn't make sense to inject 850ms of latency for this.
} | ||
.lh-gauge__label-info-icon { | ||
pointer-events: fill; | ||
cursor: help; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels a tad odd to me to flip the cursor since there's no actual click action here, is there a broader UX strategy here? I would love to learn more about these kinds of things :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly, I had the bring the cursor back with CSS so I just picked one. Since there's no click action to prompt perhaps it should just remain a normal cursor. IDK.
@yuinchien what do you think of this?
https://lighthouse-33lan68g9.now.sh/#accessibility (hover over i
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hoten I suggest shifting the position 4px downward and to the right.
I applied transform: translate3d(4px,4px,0)
to the info icon and it looks like this.
@@ -242,7 +242,7 @@ describe('PwaCategoryRenderer', () => { | |||
describe('#renderScoreGauge', () => { | |||
it('renders an error score gauge in case of category error', () => { | |||
category.score = null; | |||
const badgeGauge = pwaRenderer.renderScoreGauge(category); | |||
const badgeGauge = pwaRenderer.renderScoreGauge(category, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the point of this one? typedef suggests both are unexpected but looking through the code it looks like we never used groups for the score gauge no matter what.... 🤷♂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't recall, removed.
is an argument against moving the accessibility description to a tooltip (see especially the conclusion at the end). Maybe it would be better just to shorten + only exist if there's something really important to say |
what are we doing with this? |
I don't think we want to do this. Implementation complexity, not a huge win in terms of simplification, and an arguable net loss of explainable utility |
#8185
@yuinchien