You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(browser): Add CLS sources to span attributes (#16710)
resolves#16707
The session focused on enhancing CLS (Cumulative Layout Shift) spans by
adding attributes detailing the elements that caused layout shifts.
* In `packages/browser-utils/src/metrics/cls.ts`, the
`sendStandaloneClsSpan` function was updated. It now iterates over
`LayoutShift` entry sources and adds them as `cls.source.N` attributes
to the span, converting DOM nodes to readable CSS selectors using
`htmlTreeAsString()`. This aligns standalone CLS spans with the existing
implementation for regular pageload spans.
* Test expectations in
`dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-cls-standalone-spans/test.ts`
were updated to assert the presence of these new `cls.source.N`
attributes on the captured CLS spans.
* `yarn.lock` was updated to reflect changes in dependency resolutions,
likely due to package installations during the session.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
0 commit comments