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: show fireworks only if all core categories score 100 #9073

Merged
merged 2 commits into from
May 30, 2019

Conversation

connorjclark
Copy link
Collaborator

Fixes #9058

Copy link
Collaborator

@patrickhulce patrickhulce left a 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 =
Copy link
Collaborator

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 😆

Copy link
Member

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 :)

Copy link
Collaborator Author

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) {
Copy link
Collaborator

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 😉

Copy link
Member

@brendankenny brendankenny left a 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 */
Copy link
Member

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)

Copy link
Collaborator Author

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 =
Copy link
Member

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 :)

@connorjclark connorjclark changed the title report: only show fireworks if all core categories are present report: show fireworks only if all core categories score 100 May 30, 2019
@connorjclark connorjclark merged commit f17e6be into master May 30, 2019
@brendankenny brendankenny deleted the firework-all-core branch May 30, 2019 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fireworks don't work for solo category
4 participants