-
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
Lighthouse Report Style Refresh #926
Conversation
428caf2
to
6da83a7
Compare
6da83a7
to
7206622
Compare
This looks great! Should we default the Can we add |
<span class="http-resource__protocol">({{this.label}})</span> | ||
{{/if}} | ||
{{#if this.code}} | ||
<pre class="http-resource__code">{{this.code}}</pre> |
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.
I need a test case to reproduce this. Where can I see some examples with the old flexbox?
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.
Start a server in lighthouse/lighthouse-cli/test/fixtures/dobetterweb
and run:
node lighthouse-cli --output=html --output-path=results.html http://localhost:8080/dbw_tester.html
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 suppose you could also use a jsbin: http://jsbin.com/ruzanisodu
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.
Can reproduce, but can't identify the cause. The extra leading space is within the string (extendedInfo.value.code). That extra space doesn't appear in the original page, though. I tracked it through StyleHelper.getFormattedStyleRule, which doesn't appear to add any extra whitespace. I didn't change the element or the styling applied to that element directly. No Handlebars helpers are being applied to the string. I'm at a loss to what's causing 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.
No worries. Thanks for investigating. I can look into this later.
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.
Is this a blocker on the PR? @paulirish
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.
nope not a blocker.
eric can you give this a green check? :)
* Made subitems with errors expand their help text by default
{{/if}} | ||
|
||
{{#if subItem.debugString }} | ||
<div class="subitem__debug"> | ||
{{{ subItem.helpText }}} |
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.
subItem.debugString
@@ -1,3 +1,4 @@ | |||
{{!-- |
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 remove?
</div> | ||
</div> | ||
<ul class="subitem__details"> | ||
<li class="subitem__detail">First Visual Change: <strong>{{this.first}}ms</strong></li> |
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.
2 space indent to be consistent
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.
done
@@ -104,6 +102,27 @@ class ReportGenerator { | |||
} | |||
return number; | |||
}); | |||
|
|||
// Is a value is boolean? |
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.
"// value is a boolean?"
} | ||
|
||
|
||
/* have to deal with */ |
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.
deal with....?
height: 27px; | ||
} | ||
/* | ||
.report { |
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.
remove
} | ||
|
||
|
||
|
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.
remove extra newlines
display: none; | ||
} | ||
|
||
|
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.
newlines :)
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
<title>Lighthouse report: {{ url }}</title> | ||
{{!-- | ||
<link rel="stylesheet" href="lighthouse-core/report/styles/report.css"> |
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.
remove?
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.
done
|
||
<div class="js-report-by-user-feature"> | ||
{{#each this.score as |aggregation|}} | ||
<section class="report-body__breakdown-item"> | ||
<section class="section2"> |
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.
section2 and header2 could be more descriptive :)
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.
That's tough. In the User Feature view, these represent aggregations. In Technology view, they represent categories. Both are styled identically. Is there a generic term that describes both of these? I'm following the HTML convention of H1 for level-1 headings, H2 for level-2 headings, etc. but am open to alternatives.
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.
TBH, I don't care for the technology view and was hoping we'd get rid of it. It's also pretty broken for Best Practices b/c, with items showing up twice in the report.
@paulirish wdyt think about removing that toggle? Do people actually use it?
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.
k. let's nuke the toggle. don't need it.
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.
🕹 💥
|
||
{{#if aggregation.name }} | ||
<h1 class="report-section__subtitle">{{ aggregation.name }}</h1> | ||
<header class="header2"> |
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.
indentation is off here.
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 fixed the closing tag's indent. Is that what you were referring to?
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.
yep
* Fixed debugString * Removed extra comments and newlines from CSS
Handlebars.registerHelper('not', value => !value); | ||
|
||
// arg1 && arg2 && ... && argn | ||
Handlebars.registerHelper('and', (...args) => { |
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.
travis is failing b/c node 5 doesn't support the spread operator in function args. You'll have to use arguments
.
// arg1 && arg2 && ... && argn | ||
Handlebars.registerHelper('and', () => { | ||
let arg = false; | ||
for (let i = 0, n = arguments.length-1; i < n; 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.
this is throwing some linting errors.
Woot! |
* Refresh Lighthouse report * Fixed bug: technology sections visible by default * Fixed eslint errors * * Added debug string field to report * Made subitems with errors expand their help text by default * * eslint fixes * Fixed debugString * Removed extra comments and newlines from CSS * Rewrote 'and' Handlebar helper to remove spread operator * Fixed speedline spacing * eslint fix * Removed stylesheet comment from report.html * Removed feature/technology toggle
Old report:
New report:
Chromeless report: