Skip to content

Detect LCP images after soft navigations in NgOptimizedImage #71812

Open

Description

@SkyZeroZx

Which @angular/* package(s) are relevant/related to the feature request?

common

Description

NgOptimizedImage warns during development when an LCP image is not marked as priority. I think it would be useful to extend this diagnostic to soft navigations, so it also covers images displayed after navigating between routes without reloading the page.

e.g navigating from a product list to a product detail page can introduce a different LCP image.
Developers should receive the same missing-priority warning when the browser identifies that image as the LCP of the soft navigation.

Proposed solution

Extend LCPImageObserver to observe soft-navigation and interaction-contentful-paint entries when supported, associating them through interactionId.

Only paints associated with a detected soft navigation should trigger this diagnostic. An unrelated interaction that displays another large image should not be treated as a new navigation.

Keep the existing initial-page-load observation and use feature detection so browsers without these entry types continue to work as they do today.

Alternatives considered

I previously opened #69963 if someone can take care of it or suggest an better alternative

References

Activity

  1. added this to the needsTriage milestone on Nov 4, 2026
  2. added this to the needsTriage milestone on Nov 4, 2026
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

    area: commonIssues related to APIs in the @angular/common package

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions