-
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: show fireworks only if all core categories score 100 #9073
Conversation
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.
LGTM
@@ -98,7 +99,9 @@ class ReportUIFeatures { | |||
|
|||
// Fireworks. | |||
const scoresAll100 = Object.values(report.categories).every(cat => cat.score === 1); | |||
if (!this._dom.isDevTools() && scoresAll100) { | |||
const hasAllCoreCategories = |
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.
hm, I guess this would still get fireworks for custom config categories but if the user is going all that way to get some fireworks they probably deserve 'em 😆
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 kind of feel like it should be at least perf + any other categories need to be 100. So solo perf 100 would be ok.
But I also don't care that much and this seems fine :)
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.
solo + fireworks would require a refactor, since the fireworks were designed to work with the scores container header.
if (!this._dom.isDevTools() && scoresAll100) { | ||
const hasAllCoreCategories = | ||
Object.keys(report.categories).filter(id => !Util.isPluginCategory(id)).length >= 5; | ||
if (!this._dom.isDevTools() && scoresAll100 && hasAllCoreCategories) { |
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.
brave soul creating merge conflicts for yourself 😉
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.
one nit and LGTM
@@ -26,6 +26,7 @@ | |||
/* globals getFilenamePrefix Util */ | |||
|
|||
/** @typedef {import('./dom.js')} DOM */ | |||
/** @typedef {import('./util.js')} Util */ |
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.
doesn't the html-renderer.d.ts
take care of this? (I don't think either typedef is needed)
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.
ya, removed
@@ -98,7 +99,9 @@ class ReportUIFeatures { | |||
|
|||
// Fireworks. | |||
const scoresAll100 = Object.values(report.categories).every(cat => cat.score === 1); | |||
if (!this._dom.isDevTools() && scoresAll100) { | |||
const hasAllCoreCategories = |
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 kind of feel like it should be at least perf + any other categories need to be 100. So solo perf 100 would be ok.
But I also don't care that much and this seems fine :)
Fixes #9058