Repository navigation
Align navigation insights with trace metrics and shift data - #17
Merged
jackfranklin merged 6 commits intoNov 19, 2026
Merged
Conversation
kurtextrem
force-pushed
the
codex/trace-insight-accuracy
branch
5 times, most recently
from
November 19, 2026 13:13
72f9f72 to
e8d91b3
Compare
kurtextrem
marked this pull request as ready for review
November 19, 2026 13:14
jackfranklin
left a comment
Collaborator
There was a problem hiding this comment.
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:
- Default
insightsCLS culprits aren't scoped to the selected navigation: InextractInsights()(src/engine/extractors/insights.ts),selectedonly filters layout shifts whenoptions?.navigationIdis explicitly passed. In a multi-navigation trace wherefindInsightEntry()picks e.g.NAV_1by default,result.navigationIdis'NAV_1'and LCP/INP/render-blocking/third-parties all reflectNAV_1, whileclsCulpritsincludes clusters from all navigations. Scoping byentry?.navigationIdwhen present would keep all categories consistent with the reportednavigationId. extractOverview()aligns LCP toentry.navigationIdbut not FCP: Insrc/engine/extractors/overview.ts, thepageMetricsloop prefersentry.navigationIdforlcp, whilefcpstill takes the first navigation (!fcp). In a multi-navigation trace, that can mix navigation 1's FCP with navigation 2's LCP—using the sameentry.navigationIdpreference forfcpavoids that mismatch.- Culprit deduplication key collides when
nodeIdisundefined: InextractShifts()(src/engine/extractors/shifts.ts),JSON.stringify([node.processId, node.frameId, node.nodeId])collapses distinct nodes that lacknode_ideven if they have differentselector,debugName, ortagName. Falling back toselector/debugName/tagNamewhennodeId === undefinedwould prevent merging unrelated nodes. - 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,
thirdPartiesretaining a third-party entity while excludingfirstPartyEntity,lcpBreakdownwithnullsubparts + warning, andshiftsrect formatting / missing-DOM-metadata warning?
kurtextrem
force-pushed
the
codex/trace-insight-accuracy
branch
from
November 19, 2026 15:17
e8d91b3 to
262e494
Compare
jackfranklin
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
overviewand for the CLS and INP cards ininsights. Report unavailable LCP subparts explicitly, reuse layout-shift node details in CLS insights, and exclude the first-party entity from third-party summaries.insightsselects from navigation windows that overlap--time-range.navigationslists 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-rangeoninsightsandnavigationsand the missing default navigation ID ininsights, as reported in #9.Depends on #16.