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

renderer: fix word break issue for display text, move metric disclaimer #9030

Merged
merged 4 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {

// 'Values are estimated and may vary' is used as the category description for PSI
if (environment !== 'PSI') {
const estValuesEl = this.dom.createChildOf(metricsColumn1El, 'div', 'lh-metrics__disclaimer');
const estValuesEl = this.dom.createChildOf(metricAuditsEl, 'div', 'lh-metrics__disclaimer');
estValuesEl.textContent = Util.UIStrings.varianceDisclaimer;
}

Expand Down
1 change: 1 addition & 0 deletions lighthouse-core/report/html/report-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@

.lh-audit__display-text {
flex: 1;
word-break: normal;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would love to see a diagram of our web of word-break fixes over the course of LH history 😆

}

/* Prepend display text with em dash separator. But not in Opportunities. */
Expand Down
4 changes: 4 additions & 0 deletions lighthouse-core/scripts/build-report-for-autodeployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ lhr.categories['lighthouse-plugin-someplugin'] = {
auditRefs: [],
};

// Make opprotunities estimated savings longer to test word break behavior.
// @ts-ignore - details are defined.
lhr.audits['render-blocking-resources'].details.overallSavingsMs = 12345; // 12.35 s

console.log('🕒 Generating report for sample_v2.json...');
const html = ReportGenerator.generateReport(lhr, 'html');
const filename = path.join(__dirname, '../../dist/index.html');
Expand Down