From d6340fae3fcf2ff001ac0a2795c4e7707103e895 Mon Sep 17 00:00:00 2001 From: Adriana Ixba Date: Fri, 8 Dec 2023 16:20:44 -0800 Subject: [PATCH] report: blend impact and guidance level to sort audits (#15669) --- report/renderer/performance-category-renderer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/report/renderer/performance-category-renderer.js b/report/renderer/performance-category-renderer.js index 6868050336ed..01bf180b5b32 100644 --- a/report/renderer/performance-category-renderer.js +++ b/report/renderer/performance-category-renderer.js @@ -246,14 +246,16 @@ export class PerformanceCategoryRenderer extends CategoryRenderer { if (scoreA !== scoreB) return scoreA - scoreB; // Overall impact is the estimated improvement to the performance score - if (a.overallImpact !== b.overallImpact) return b.overallImpact - a.overallImpact; + if (a.overallImpact !== b.overallImpact) { + return b.overallImpact * b.guidanceLevel - a.overallImpact * a.guidanceLevel; + } // Fall back to the linear impact if the normal impact is rounded down to 0 if ( a.overallImpact === 0 && b.overallImpact === 0 && a.overallLinearImpact !== b.overallLinearImpact ) { - return b.overallLinearImpact - a.overallLinearImpact; + return b.overallLinearImpact * b.guidanceLevel - a.overallLinearImpact * a.guidanceLevel; } // Audits that have no estimated savings should be prioritized by the guidance level