-
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: new score display, metrics display, rich tooltips #5009
Conversation
This looks AMAZING! CC: @hwikyounglee I especially love the initial animation, makes the UI look #snazzy. Thanks @paulirish ! |
const gauge = this.dom.find('.lh-gauge', tmpl); | ||
gauge.setAttribute('data-progress', scoreOutOf100); // .dataset not supported in jsdom. | ||
gauge.classList.add(`lh-gauge--${Util.calculateRating(category.score)}`); | ||
wrapper.classList.add(`lh-gauge__wrapper--${Util.calculateRating(category.score)}`); |
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.
nit let's move this up to where we add the href?
const otherMetrics = metricAudits.filter(a => a.weight < 3); | ||
|
||
const metricsBoxesEl = this.dom.createChildOf(metricAuditsEl, 'div', 'lh-metrics-container'); | ||
const keyBox = this.dom.createChildOf(metricsBoxesEl, 'div', 'lh-metrics lh-metrics__key'); |
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.
key is a bit confusing on it's own, but headline
and primary
aren't exactly much clearer 🤔 IDK
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.
maybe just adding in Metrics
is enough? like keyMetricsBox
?
|
||
.lh-metrics { | ||
flex: 1; | ||
margin-right: 20px; |
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 is to separate the boxes, or just right padding?
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.
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.
gotcha, should we call this lh-metrics-column
or something then?
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 call. 👍
.lh-timeline-metric--fail .lh-timeline-metric__value { | ||
color: var(--fail-color); | ||
.lh-perf-metric--pass .lh-perf-metric__value span::after { | ||
background: url('data:image/svg+xml;utf8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130.2 130.2"><circle class="path circle" fill="#73AF55" cx="65.1" cy="65.1" r="62.1"/><polyline class="path check" fill="none" stroke="white" stroke-width="16" stroke-linecap="round" stroke-miterlimit="10" points="100.2,40.2 51.5,88.8 29.8,67.5 "/></svg>') no-repeat 50% 50%; |
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.
oooh this is the circle with a checkmark? could add a quick comment what shape each of these SVGs are? :) i.e. /* circle with checkmark */
/* triangle with exclamation point */
..
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.
great idea. will do when i update to hwi's new assets.
position: absolute; | ||
right: var(--section-padding); | ||
bottom: var(--section-padding); | ||
color: #757575; |
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.
stick this in var or reuse?
const otherMetrics = metricAudits.filter(a => a.weight < 3); | ||
|
||
const metricsBoxesEl = this.dom.createChildOf(metricAuditsEl, 'div', 'lh-metrics-container'); | ||
const keyBox = this.dom.createChildOf(metricsBoxesEl, 'div', 'lh-metrics lh-metrics__key'); |
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.
maybe just adding in Metrics
is enough? like keyMetricsBox
?
<div class="lh-timeline-metric__description"><!-- fill me --></div> | ||
</details> | ||
</div> | ||
<template id="tmpl-lh-perf-metric"> |
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.
update comment above?
@@ -5347,6 +5347,6 @@ | |||
} | |||
}, | |||
"timing": { | |||
"total": 830 | |||
"total": 1142 |
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.
no need to update
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.
I'm not 100% sure I'm going to grok the SVG animation stuff, but LGTM outside bit o' cleanup/pending comments on incoming icons :)
so slick! awesome teamwork @hwikyounglee @paulirish !
|
||
const metricsBoxesEl = this.dom.createChildOf(metricAuditsEl, 'div', 'lh-metrics-container'); | ||
const metricsColumn1El = this.dom.createChildOf(metricsBoxesEl, 'div', | ||
'lh-metrics-column lh-metrics-column__key'); |
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.
nit: seems like this should be a modifier on column rather than a child :) lh-metrics-column--key
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.
lol i have been mixing up elements and modifier syntax for a while now.
|
||
/* Contain the layout style paint & layers during animation*/ | ||
contain: content; | ||
will-change: opacity; |
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.
does the opacity change? seems like it's just stroke-dasharray
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.
it doesn't. just abusing it for a layer promotion.
border-radius: 50%; | ||
|
||
.lh-gauge { | ||
text-anchor: middle; |
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.
so. much. TIL.
does any text actually go into the SVG though? what are the percentage elements for?
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 property was old. removed now.
Score display
New gauges, done in SVG instead of crazytime css. Added in the score scale.
Oh, they animate, too. :)
Before:
After:
And check out the difference in CC layers:

Metrics display
Not 100% finished but getting there.
I've added in a rich tooltip system to support this and other things.. here's how it works:
#ref #5008