Skip to content
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

Merged
merged 10 commits into from
Nov 10, 2016
Merged

Conversation

chowse
Copy link
Contributor

@chowse chowse commented Nov 9, 2016

  • Moved pass/fail/score from the right side to the left for better readability
  • Added icons for pass/fail/help
  • Added chromeless styling (based on data-report-context) for future integrations.
  • Various other visual cleanups and consolidations.

Old report:
image

New report:
image

Chromeless report:
image

@ebidel
Copy link
Contributor

ebidel commented Nov 9, 2016

This looks great!

Should we default the .helpText to open when the audit doesn't pass?

screen shot 2016-11-09 at 10 07 39 am

Can we add .debugString support, similar to #925 (comment)

@paulirish
Copy link
Member

Awesome!

One of my fav parts is fixing our details/summary blocks:

image
image

<span class="http-resource__protocol">({{this.label}})</span>
{{/if}}
{{#if this.code}}
<pre class="http-resource__code">{{this.code}}</pre>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something is up with the indentation of code snippets:

screen shot 2016-11-09 at 10 28 33 am

before:
screen shot 2016-11-09 at 10 28 56 am

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Member

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 }}}
Copy link
Contributor

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 @@
{{!--
Copy link
Contributor

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>
Copy link
Contributor

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

Copy link
Contributor Author

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?
Copy link
Contributor

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 */
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

}



Copy link
Contributor

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;
}


Copy link
Contributor

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">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Copy link
Contributor Author

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">
Copy link
Contributor

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 :)

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor Author

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">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is off here.

Copy link
Contributor Author

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?

Copy link
Contributor

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) => {
Copy link
Contributor

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++) {
Copy link
Contributor

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.

@ebidel ebidel merged commit 0affcf4 into GoogleChrome:master Nov 10, 2016
@ebidel
Copy link
Contributor

ebidel commented Nov 10, 2016

Woot!

andrewrota pushed a commit to andrewrota/lighthouse that referenced this pull request Jan 13, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants