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(performance): use metric savings for metric filter #15540

Merged
merged 10 commits into from
Jan 3, 2024

Conversation

adamraine
Copy link
Member

@adamraine adamraine commented Oct 13, 2023

#15445 (comment)

Metric filter was still using relevantAudits which is just a manually curated list that we haven't touched in a while. This PR uses metricSavings instead to determine filter applicability and sorts the audits on the filtered metric.

@@ -338,7 +372,7 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {

const labelEl = this.dom.createChildOf(metricFilterEl, 'label', 'lh-metricfilter__label');
labelEl.htmlFor = elemId;
labelEl.title = metric.result?.title;
labelEl.title = 'result' in metric ? metric.result.title : '';
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixes a bug where the title of the "All" filter button is "undefined"

@adamraine adamraine changed the title WIP: use metric savings for metric filter report(performance): use metric savings for metric filter Oct 16, 2023
@adamraine adamraine marked this pull request as ready for review October 16, 2023 20:56
@adamraine adamraine requested a review from a team as a code owner October 16, 2023 20:56
@adamraine adamraine requested review from connorjclark and removed request for a team October 16, 2023 20:56
@@ -197,6 +197,8 @@ declare module Result {

/** Gather mode used to collect artifacts. */
type GatherMode = 'navigation'|'timespan'|'snapshot';

type MetricAcronym = 'FCP' | 'LCP' | 'TBT' | 'CLS' | 'INP' | 'SI' | 'TTI' | 'FMP';
Copy link
Member Author

Choose a reason for hiding this comment

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

@paulirish
Copy link
Member

ping @connorjclark

Copy link
Collaborator

@adrianaixba adrianaixba left a comment

Choose a reason for hiding this comment

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

lgtm!

report/renderer/performance-category-renderer.js Outdated Show resolved Hide resolved
*/
renderAudit(audit) {
const component = this.dom.createComponent('audit');
return this.populateAuditValues(audit, component);
return /** @type {HTMLElement} */ (this.populateAuditValues(audit, component));
Copy link
Collaborator

Choose a reason for hiding this comment

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

which part required this change to return type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants