Skip to content

Align navigation insights with trace metrics and shift data - #17

Merged
jackfranklin merged 6 commits into
ChromeDevTools:mainfrom
kurtextrem:codex/trace-insight-accuracy
Nov 19, 2026
Merged

jackfranklin merged 6 commits into
ChromeDevTools:mainfrom
kurtextrem:codex/trace-insight-accuracy

Conversation

@kurtextrem

@kurtextrem kurtextrem commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

View just this PR’s diff

This series comes from a fork. GitHub requires all branches in a native stack to be in the same repository.

Select the main-frame navigation with a measured LCP by default and show the navigation and insight set IDs. Use that navigation for both paint metrics in overview and for the CLS and INP cards in insights. Report unavailable LCP subparts explicitly, reuse layout-shift node details in CLS insights, and exclude the first-party entity from third-party summaries.

insights selects from navigation windows that overlap --time-range. navigations lists starts inside the range. Layout shift output includes process and frame IDs and recorded rectangles for nodes whose DOM metadata may be missing.

Synthetic tests cover multiple navigations, measured LCP without subparts, first-party exclusion alongside third-party requests, and layout shifts with missing node metadata.

Part 3 of 5 for #14. Papercuts 5, 12, and 14.

Fixes ignored --time-range on insights and navigations and the missing default navigation ID in insights, as reported in #9.

Depends on #16.

@kurtextrem
kurtextrem force-pushed the codex/trace-insight-accuracy branch 5 times, most recently from 72f9f72 to e8d91b3 Compare November 19, 2026 13:13
@kurtextrem
kurtextrem marked this pull request as ready for review November 19, 2026 13:14

@jackfranklin jackfranklin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice improvements overall—explicit null LCP subparts, excluding firstPartyEntity, and wiring --time-range into insights/navigations are all great fixes. A few issues to address once rebased after #16:

  1. Default insights CLS culprits aren't scoped to the selected navigation: In extractInsights() (src/engine/extractors/insights.ts), selected only filters layout shifts when options?.navigationId is explicitly passed. In a multi-navigation trace where findInsightEntry() picks e.g. NAV_1 by default, result.navigationId is 'NAV_1' and LCP/INP/render-blocking/third-parties all reflect NAV_1, while clsCulprits includes clusters from all navigations. Scoping by entry?.navigationId when present would keep all categories consistent with the reported navigationId.
  2. extractOverview() aligns LCP to entry.navigationId but not FCP: In src/engine/extractors/overview.ts, the pageMetrics loop prefers entry.navigationId for lcp, while fcp still takes the first navigation (!fcp). In a multi-navigation trace, that can mix navigation 1's FCP with navigation 2's LCP—using the same entry.navigationId preference for fcp avoids that mismatch.
  3. Culprit deduplication key collides when nodeId is undefined: In extractShifts() (src/engine/extractors/shifts.ts), JSON.stringify([node.processId, node.frameId, node.nodeId]) collapses distinct nodes that lack node_id even if they have different selector, debugName, or tagName. Falling back to selector/debugName/tagName when nodeId === undefined would prevent merging unrelated nodes.
  4. Test coverage: Could you add tests covering the new behaviors that aren't exercised by the existing single-nav fixture—specifically multi-navigation default selection, thirdParties retaining a third-party entity while excluding firstPartyEntity, lcpBreakdown with null subparts + warning, and shifts rect formatting / missing-DOM-metadata warning?

@kurtextrem
kurtextrem force-pushed the codex/trace-insight-accuracy branch from e8d91b3 to 262e494 Compare November 19, 2026 15:17
@jackfranklin
jackfranklin merged commit 6ddefe1 into ChromeDevTools:main Nov 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants