Commit 4d8581a
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>1 parent ebdd485 commit 4d8581a
3 files changed
+28
-17
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
| 207 | + | |
205 | 208 | | |
206 | 209 | | |
207 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27038 | 27038 | | |
27039 | 27039 | | |
27040 | 27040 | | |
27041 | | - | |
| 27041 | + | |
27042 | 27042 | | |
27043 | 27043 | | |
27044 | 27044 | | |
| |||
27148 | 27148 | | |
27149 | 27149 | | |
27150 | 27150 | | |
| 27151 | + | |
| 27152 | + | |
| 27153 | + | |
| 27154 | + | |
| 27155 | + | |
| 27156 | + | |
| 27157 | + | |
27151 | 27158 | | |
27152 | 27159 | | |
27153 | 27160 | | |
| |||
27169 | 27176 | | |
27170 | 27177 | | |
27171 | 27178 | | |
27172 | | - | |
27173 | | - | |
27174 | | - | |
27175 | | - | |
27176 | | - | |
27177 | | - | |
27178 | | - | |
27179 | 27179 | | |
27180 | 27180 | | |
27181 | 27181 | | |
| |||
27311 | 27311 | | |
27312 | 27312 | | |
27313 | 27313 | | |
27314 | | - | |
| 27314 | + | |
27315 | 27315 | | |
27316 | 27316 | | |
27317 | 27317 | | |
| |||
29955 | 29955 | | |
29956 | 29956 | | |
29957 | 29957 | | |
29958 | | - | |
29959 | | - | |
29960 | | - | |
29961 | | - | |
| 29958 | + | |
| 29959 | + | |
| 29960 | + | |
| 29961 | + | |
29962 | 29962 | | |
29963 | 29963 | | |
29964 | 29964 | | |
29965 | 29965 | | |
29966 | 29966 | | |
29967 | | - | |
29968 | | - | |
29969 | | - | |
29970 | | - | |
| 29967 | + | |
| 29968 | + | |
| 29969 | + | |
| 29970 | + | |
29971 | 29971 | | |
29972 | 29972 | | |
29973 | 29973 | | |
| |||
0 commit comments