fix(pagespeed): issue count excludes informative/unscored audits

Only audits with a real score (non-null) count toward the issue total.
Informative audits (score: null) are shown but not counted.
This commit is contained in:
Usman Baig
2026-03-22 22:11:49 +01:00
parent 98429f82f5
commit 9d1d2dbb80

View File

@@ -520,7 +520,10 @@ export default function PageSpeedPage() {
{group.label}
</h3>
<p className="text-xs text-neutral-500 dark:text-neutral-400">
{groupAudits.length === 0 ? 'No issues found' : `${groupAudits.length} issue${groupAudits.length !== 1 ? 's' : ''} found`}
{(() => {
const realIssues = groupAudits.filter(a => a.score !== null && a.score !== undefined).length
return realIssues === 0 ? 'No issues found' : `${realIssues} issue${realIssues !== 1 ? 's' : ''} found`
})()}
</p>
</div>
</div>