-
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
report(psi): add lab data summary sentence #5961
Conversation
@@ -57,7 +65,8 @@ function prepareLabData(LHResultJsonString, document) { | |||
scoreGaugeWrapperEl.removeAttribute('href'); | |||
|
|||
const finalScreenshotDataUri = _getFinalScreenshot(perfCategory); | |||
return {scoreGaugeEl, perfCategoryEl, finalScreenshotDataUri}; | |||
const psiDescription = lhResult.i18n.rendererFormattedStrings.psiDescription; |
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, let's just provide this in the right spot so they dont have to.
here, el
is the perfCategoryEl
:
i was writing this but maybe you want to do it differently:
const descriptionText = lhResult.i18n.rendererFormattedStrings.psiDescription;
const descriptionEl = dom.convertMarkdownLinkSnippets(descriptionText);
const catDescriptionEl = dom.find('.lh-category-header__description', perfCategoryEl);
catDescriptionEl.appendChild(descriptionEl);
@@ -481,6 +481,9 @@ Util.UIStrings = { | |||
crcInitialNavigation: 'Initial Navigation', | |||
/** Label of value shown in the summary of critical request chains. Refers to the total amount of time (milliseconds) of the longest critical path chain/sequence of network requests. Example value: 2310 ms */ | |||
crcLongestDurationLabel: 'Maximum critical path latency:', | |||
|
|||
/** Explanation shown to users below performance results to inform them that the test was done with a 3G network connection and to warn them that the numbers they see will likely change slightly the next time they run Lighthouse. 'Lighthouse' becomes link text to additional documentation. */ | |||
psiDescription: '[Lighthouse](https://developers.google.com/web/tools/lighthouse/) analysis of the current page on emulated 3G. Values are estimated and may vary.', |
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.
naming tweak: lsPerformanceCategoryDescription
.. more inline with the ones we have in default-config.js
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
@@ -57,7 +65,8 @@ function prepareLabData(LHResultJsonString, document) { | |||
scoreGaugeWrapperEl.removeAttribute('href'); | |||
|
|||
const finalScreenshotDataUri = _getFinalScreenshot(perfCategory); | |||
return {scoreGaugeEl, perfCategoryEl, finalScreenshotDataUri}; | |||
const psiDescription = lhResult.i18n.rendererFormattedStrings.psiDescription; |
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.
and we gotta do the markdown conversion :)
updated. Now uses the metrics title/description to include these custom strings since that's where we actually want them. |
|
||
// Description supports markdown links, so take everything after the last link. | ||
const descriptionEnd = /[^)]+$/.exec(Util.UIStrings.lsPerformanceCategoryDescription)[0]; | ||
assert.ok(descriptionEnd.length > 6); // If this gets too short, pick a different comparison :) |
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 a little silly, but difficult to test it isn't accidentally using a default description (if we ever add one to metrics) and support i18n otherwise :)
(could just create a local version of dom using jsdom, I suppose)
looks ace. |
fixes #5882