-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Show runtime configuration on report #1485
Conversation
background-position: center center; | ||
background-repeat: no-repeat; | ||
background-size: contain; | ||
background-color: transparent; |
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.
Move background-* into its on selector? .report-body__icon, .runtime-config__icon
.
Perhaps consider using the shorthand for background too. https://developer.mozilla.org/en/docs/Web/CSS/background
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.
Deleted .report-body__icon {...}
because it's redundant and I prefer to stick with the longhand version because I feel it's more readable.
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 think I saw @brendankenny mention this somewhere else, and I've been thinking the same...
Can we start a new perfx.css stylesheet and dump all the perfx stuff in that? The template can inject it dynamically based the context. We want to limit stylesheet bloat for CLI/CRX/Devtools users.
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 we start a new perfx.css stylesheet and dump all the perfx stuff in that?
Sure. I will separate all the perf-x related CSS code to another file. But for this particular case, I think runtime config section belongs to the main report not just perf-x.
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.
Actually, the ticks/crosses & the negation "disabled" are super confusing; can we change that please?
Maybe use bullet points and change the text depending on the configuration:
- "Network throttling enabled'
- "CPU throttling disabled"
can you give a screenshot of this in context of the whole report? |
I wanted it to be consistent with cli-flags (e.g. |
background-position: center center; | ||
background-repeat: no-repeat; | ||
background-size: contain; | ||
background-color: transparent; |
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 think I saw @brendankenny mention this somewhere else, and I've been thinking the same...
Can we start a new perfx.css stylesheet and dump all the perfx stuff in that? The template can inject it dynamically based the context. We want to limit stylesheet bloat for CLI/CRX/Devtools users.
My initial feedback from looking at the screenshot is that the "Runtime configuration" section looks very similar to report results. Users might get confused and think these X's and checked items are part of their perf results (as opposed to the way the run was setup). We may need to think about how to best surface the emulation settings in the report. #784 was another approach of adding emulation settings to the report. |
If this part needs to be under perf-x folder, ignore this PR for now. I will move it to perf-x folder and inject this to main report as a partial (when in |
I think this should be in the core code, and not living in perf-x. But I also have a different idea on UI which we can first discuss offline. |
We discussed using a |
7b4cacc
to
09305dc
Compare
09305dc
to
a0cd4fb
Compare
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.
lighthouse-core/runner.js
Outdated
@@ -133,14 +133,24 @@ class Runner { | |||
a => Aggregate.aggregate(a, runResults.auditResults)); | |||
} | |||
|
|||
const runtimeConfig = { | |||
environment: [ | |||
{name: 'CPU Throttling', value: !opts.flags.disableCpuThrottling}, |
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.
let's put CPU throttling last of the three and add the extra detail hardcoded in here.
Network throttling (150ms RTT, 1.6Mbps down, 750Kbps up): enabled
Device emulation (Nexus 5X): enabled
CPU throttling (5x slowdown): disabled
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.
Added. Was thinking about adding more details (like screen size, etc)
background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); | ||
} | ||
|
||
.report-body__header-dropdown { |
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 think it'd be better if the header just grew in side when you expand this.
So we could use a ▶ and it goes to ▼ when you click on it. cursor: pointer
on the icon so its clearly actionable.
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 think it'd be better if the header just grew in side when you expand this.
Sorry, I don't have a clear idea what you mean here. Do you mean grow the header itself when we expand it (so it looks like the current UI but without the line between header bar and drop down)? If not, would you mind explaining in a little bit detail?
<a href="#" data-action="save-json">Save as JSON...</a> | ||
</ul> | ||
</span> | ||
<button class="report-body__icon share js-share" title="Share report on Github"></button> |
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.
"GitHub"
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.
fixed
Like that dropdown UI. Should we incorporate some sort of setting icon too? |
5df40cb
to
3af4362
Compare
Hmm. But the top bar does not allow users to configure anything. I'm not sure if a setting icon fits here. |
a470bf5
to
3e42a05
Compare
@@ -790,6 +839,7 @@ body { | |||
|
|||
.export-section { | |||
position: relative; | |||
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.
instead of hiding the export-button, hide the entire export-section when not in viewer context. So the dropdown won't cause the report page to be wider than it should be, which could make the report page scroll-able on x direction.
<li class="config-section__item"> | ||
<p class="config-section__desc"> | ||
{{ this.name }} ({{ this.description }}) | ||
<strong>: {{#if this.value }}Enabled{{else}}Disabled{{/if}}</strong> |
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 bold :
and remove the extra space before the :
in the UI.
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.
fixed. thx.
lighthouse-core/runner.js
Outdated
const environment = [ | ||
{ | ||
name: 'CPU Throttling', | ||
value: !flags.disableCpuThrottling, |
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.
rename value
to enabled
?
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.
fixed
Added a section at the end of the report page which shows the runtime configuration of this report (e.g. disable CUP throttling).
![current-config](https://cloud.githubusercontent.com/assets/20240088/22046443/ce0d4478-dd74-11e6-849d-6b6eeab73e42.png)
Screenshot [updated]:
Will add some test cases later.