Skip to content

feat: We only need pages which are actionable for all customers#2299

Merged
tkotthakota-adobe merged 5 commits intomainfrom
SITES-42676
Apr 8, 2026
Merged

feat: We only need pages which are actionable for all customers#2299
tkotthakota-adobe merged 5 commits intomainfrom
SITES-42676

Conversation

@tkotthakota-adobe
Copy link
Copy Markdown
Contributor

@tkotthakota-adobe tkotthakota-adobe commented Apr 3, 2026

https://jira.corp.adobe.com/browse/SITES-42676
https://jira.corp.adobe.com/browse/SITES-42074

Problem

CWV audit was storing suggestions for all pages, including pages where every
metric is already within acceptable thresholds (LCP ≤ 2500ms, CLS ≤ 0.1, INP ≤
200ms). These pages are not actionable and added noise to the opportunity.

Changes

src/cwv/kpi-metrics.js

  • Exported METRICS and THRESHOLDS constants (previously unexported) so they can be reused outside the file.

src/cwv/opportunity-sync.js

  • Added hasFailingMetrics(entry) — returns true if any device type has at least one metric exceeding its "good" threshold. Null/undefined values are treated as passing (no data = not failing).
  • Before syncing suggestions, filters auditResult.cwv through hasFailingMetrics. Only pages with at least one failing metric become suggestions.
  • Added a guard (Math.max(0, ...)) for the edge case where all URL entries are filtered out.
  • Logs how many entries survived the filter (e.g. "site X — 2 of 15 CWV entries have failing metrics").

Why global, not PLG-only

Pages that pass all CWV thresholds are not actionable for any customer. There is
no value in storing or displaying them regardless of site type.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@ramboz ramboz left a comment

Choose a reason for hiding this comment

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

Looks overall good to me, but I would change it to all sites and not just PLG ones

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

This PR will trigger no release when merged.

@tkotthakota-adobe tkotthakota-adobe requested a review from ramboz April 3, 2026 13:36
@tkotthakota-adobe
Copy link
Copy Markdown
Contributor Author

@ramboz PR is updated.

@tkotthakota-adobe tkotthakota-adobe changed the title feat: We only need to analyze top 3 pages for PLG customers feat: We only need to pages which are actionable for all customers Apr 3, 2026
@tkotthakota-adobe tkotthakota-adobe changed the title feat: We only need to pages which are actionable for all customers feat: We only need pages which are actionable for all customers Apr 3, 2026
@tkotthakota-adobe tkotthakota-adobe merged commit 316813f into main Apr 8, 2026
19 checks passed
@tkotthakota-adobe tkotthakota-adobe deleted the SITES-42676 branch April 8, 2026 18:48
solaris007 pushed a commit that referenced this pull request Apr 8, 2026
# [1.405.0](v1.404.0...v1.405.0) (2026-04-08)

### Features

* We only need pages which are actionable for all customers ([#2299](#2299)) ([316813f](316813f))
@solaris007
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.405.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants