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

report: minimum time scale, text tweaks #5183

Merged
merged 5 commits into from
May 11, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lighthouse-core/audits/byte-efficiency/unused-css-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UnusedCSSRules extends ByteEfficiencyAudit {
static get meta() {
return {
name: 'unused-css-rules',
description: 'Unused CSS rules',
description: 'Remove unused CSS',
Copy link
Member

Choose a reason for hiding this comment

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

or maybe

Remove or defer unused CSS

scoreDisplayMode: ByteEfficiencyAudit.SCORING_MODES.NUMERIC,
helpText: 'Remove unused rules from stylesheets to reduce unnecessary ' +
'bytes consumed by network activity. ' +
Expand Down
9 changes: 4 additions & 5 deletions lighthouse-core/audits/screenshot-thumbnails.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,16 @@ class ScreenshotThumbnails extends Audit {

const speedline = await artifacts.requestSpeedline(trace);

let minimumTimelineDuration = 0;
// Make the minimum time range 3s so sites that load super quickly don't get a single screenshot
let minimumTimelineDuration = 3000;
// Ensure thumbnails cover the full range of the trace (TTI can be later than visually complete)
if (context.settings.throttlingMethod !== 'simulate') {
const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];
const metricComputationData = {trace, devtoolsLog, settings: context.settings};
const tti = artifacts.requestInteractive(metricComputationData);
try {
minimumTimelineDuration = (await tti).timing;
} catch (_) {
minimumTimelineDuration = 0;
}
minimumTimelineDuration = Math.max((await tti).timing, minimumTimelineDuration);
} catch (_) {}
}

const thumbnails = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,11 @@ class PerformanceCategoryRenderer extends CategoryRenderer {
.sort((auditA, auditB) => this._getWastedMs(auditB) - this._getWastedMs(auditA));

if (opportunityAudits.length) {
// Scale the sparklines relative to savings, minimum 2s to not overstate small savings
const minimumScale = 2000;
const wastedMsValues = opportunityAudits.map(audit => this._getWastedMs(audit));
const maxWaste = Math.max(...wastedMsValues);
const scale = Math.ceil(maxWaste / 1000) * 1000;
const scale = Math.max(Math.ceil(maxWaste / 1000) * 1000, minimumScale);
const groupEl = this.renderAuditGroup(groups['load-opportunities'], {expandable: false});
const tmpl = this.dom.cloneTemplate('#tmpl-lh-opportunity-header', this.templateContext);
const headerEl = this.dom.find('.lh-load-opportunity__header', tmpl);
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/report/html/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
}
.lh-metadata {
flex: 1 1 0;
padding-right: calc(var(--default-padding) / 2);
margin-right: calc(var(--default-padding) * 8);
line-height: 20px;
color: var(--report-header-color);
z-index: 1;
Expand Down Expand Up @@ -269,9 +269,9 @@
.lh-env {
padding: var(--default-padding) 0 var(--default-padding) calc(var(--default-padding) * 2);
left: 0;
right: calc(var(--default-padding) * -8);
top: 100%;
position: absolute;
width: 100%;
background-color: var(--header-bg-color);
border-top: 1px solid var(--report-secondary-border-color);
border-bottom: 1px solid var(--report-secondary-border-color);
Expand Down