Skip to content

perf/lcp-hints: lcp-preload warning does not name the likely-LCP image(s) #1074

Closed

Description

@deniskern

Summary

perf/lcp-hints → check lcp-preload reports "N likely-LCP image(s) loaded without preload" per page, but neither the report JSON nor rule_results names which image(s) it means. On pages that already preload their hero (<link rel="preload" as="image" fetchpriority="high">), nobody can tell which candidate triggered the warning, so the hint can neither be fixed nor confirmed as a false alarm.

Observed (v0.0.131)

Expected

Per warned page, the candidate image(s) in items/details, for example:

{ "src": "https://…/image.jpg", "reason": "above-fold, eager, no matching preload", "preloads": ["https://…/hero.jpg"] }

so the result names the image and the preload hrefs that were compared.

Related

#516 (small logos/avatars counted as likely-LCP) — with the candidate URL in the output, such cases would be visible directly.

Acceptance Criteria

  • A warned lcp-preload check on perf/lcp-hints names each likely-LCP candidate image it counted (resolved URL) and the preload hrefs it compared them against, in the check's details, in the JSON report and in stored rule_results; the list is bounded per page
  • A page whose hero image is preloaded with <link rel="preload" as="image"> (with or without fetchpriority="high", matching by href or imagesrcset after URL resolution) is not warned for that image
  • The per-page count message stays, and the earlier decision not to dump images into items (Improve LCP information #16) is either kept (details only) or explicitly revised
  • Rule tests cover a preloaded hero (no warning), an unpreloaded hero (warning naming its URL) and a page with more candidates than the bound
  • docs/rules/perf/lcp-hints.mdx describes what the check reports and where the candidate URLs appear

Activity

  1. WilliamK112 commented on Oct 24, 2026

    @WilliamK112
    Contributor

    I would like to take this. I will keep the existing per-page count and leave items empty, add bounded details with each unmatched candidate’s resolved URL plus the resolved preload URLs compared against it, preserve href/imagesrcset matching after URL resolution, add focused preloaded/unpreloaded/bound regressions, and update the rule docs and changelog.

  2. added
    enhancement
    rules
    size: S
    on Oct 26, 2026
  3. nc9 commented on Oct 26, 2026

    @nc9
    Contributor

    Fixed in #1127 (main 4e891ec): the lcp-preload check now names the page, each likely-LCP candidate and the preload hrefs compared, in bounded details. Thank you @deniskern for the report, the example made it easy to reproduce. Ships in v0.0.134.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions