diff --git a/packages/ui/client/components/trace/TraceView.vue b/packages/ui/client/components/trace/TraceView.vue index 4cf7bd13dea4..bbd2ed03a7d7 100644 --- a/packages/ui/client/components/trace/TraceView.vue +++ b/packages/ui/client/components/trace/TraceView.vue @@ -52,6 +52,9 @@ watch([selectedStep, iframeEl], ([step, iframe]) => { cache: createCache(), mirror, UNSAFE_allowUnprotectedRebuild: true, + // opt into mirroring the user-action pseudo-classes we track, so their + // snapshot-time styles paint (rrweb-io/rrweb#1896, replaces our local patch) + hackCssPseudoClasses: Object.keys(pseudoClassIds) as any, }) for (const [className, ids] of Object.entries(pseudoClassIds)) { for (const id of ids) { diff --git a/patches/rrweb-snapshot@2.0.1.patch b/patches/rrweb-snapshot@2.0.1.patch deleted file mode 100644 index 8240c7a8ed09..000000000000 --- a/patches/rrweb-snapshot@2.0.1.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/dist/rrweb-snapshot.js b/dist/rrweb-snapshot.js -index f2694ac8c01dd248a2d659f1ec2628bc9e65729a..ed99e153f33e5235602cf09efc8dab5bd6c98903 100644 ---- a/dist/rrweb-snapshot.js -+++ b/dist/rrweb-snapshot.js -@@ -1534,6 +1534,18 @@ const pseudoClassPlugin = { - if (selector.includes(":hover")) { - rule2.selector += ",\n" + selector.replace(/:hover/g, ".\\:hover"); - } -+ if (selector.includes(":active")) { -+ rule2.selector += ",\n" + selector.replace(/:active/g, ".\\:active"); -+ } -+ if (selector.includes(":focus-visible")) { -+ rule2.selector += ",\n" + selector.replace(/:focus-visible/g, ".\\:focus-visible"); -+ } -+ if (selector.includes(":focus-within")) { -+ rule2.selector += ",\n" + selector.replace(/:focus-within/g, ".\\:focus-within"); -+ } -+ if (/:focus(?![-\w])/.test(selector)) { -+ rule2.selector += ",\n" + selector.replace(/:focus(?![-\w])/g, ".\\:focus"); -+ } - }); - } - }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2de63f234f3e..e5741a932461 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -186,6 +186,7 @@ overrides: rollup: ^4.59.0 vite: 8.0.11 vitest: workspace:* + rrweb-snapshot: file:./rrweb-snapshot-2.1.0.tgz patchedDependencies: '@sinonjs/fake-timers@15.4.0': 8fb375421f30746697394082b6fcf4a218fe07a8db36474ac335c48aff32c0cb @@ -193,7 +194,6 @@ patchedDependencies: cac@6.7.14: a8f0f3517a47ce716ed90c0cfe6ae382ab763b021a664ada2a608477d0621588 istanbul-lib-instrument: fa76adf262fdb0bf545d5c529c5420e0ae33df7f5e344a6c8a727a2ffc0b0b11 istanbul-lib-source-maps: be977704c4b9838da456619fe2421b5e24df2103a25967bd383b2246c88ddf6e - rrweb-snapshot@2.0.1: 9e976b2c55a5c2ed589c41b8f46cc44b6fe6f528ebb4d3780a44b1ca8cbb17a4 importers: @@ -590,8 +590,8 @@ importers: specifier: 'catalog:' version: 2.0.3 rrweb-snapshot: - specifier: 2.0.1 - version: 2.0.1(patch_hash=9e976b2c55a5c2ed589c41b8f46cc44b6fe6f528ebb4d3780a44b1ca8cbb17a4) + specifier: file:../../rrweb-snapshot-2.1.0.tgz + version: file:rrweb-snapshot-2.1.0.tgz vitest: specifier: workspace:* version: link:../vitest @@ -939,8 +939,8 @@ importers: specifier: ^4.59.0 version: 4.59.0 rrweb-snapshot: - specifier: 2.0.1 - version: 2.0.1(patch_hash=9e976b2c55a5c2ed589c41b8f46cc44b6fe6f528ebb4d3780a44b1ca8cbb17a4) + specifier: file:../../rrweb-snapshot-2.1.0.tgz + version: file:rrweb-snapshot-2.1.0.tgz splitpanes: specifier: ^4.0.4 version: 4.0.4(vue@3.5.29(typescript@5.9.3)) @@ -9451,8 +9451,9 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rrweb-snapshot@2.0.1: - resolution: {integrity: sha512-H8TA29ct2tpYtr5oaB0N+ksRY9bhEErfAYcKbce4+w8lqEUQChpKZd41HpBJLkp04b5QUfWUg4v6r9Okf8r7vA==} + rrweb-snapshot@file:rrweb-snapshot-2.1.0.tgz: + resolution: {integrity: sha512-8PAHthBm1fUAM/6zZWPAzVk2Rz0YpZ7RTAcdlbilqoa1fOpkQy8p76t2uOrrspH4rMfJMAIavj0xa6u6oQvGTg==, tarball: file:rrweb-snapshot-2.1.0.tgz} + version: 2.1.0 run-applescript@7.0.0: resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==} @@ -19108,7 +19109,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.62.2 fsevents: 2.3.3 - rrweb-snapshot@2.0.1(patch_hash=9e976b2c55a5c2ed589c41b8f46cc44b6fe6f528ebb4d3780a44b1ca8cbb17a4): + rrweb-snapshot@file:rrweb-snapshot-2.1.0.tgz: dependencies: postcss: 8.5.14 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7efe13da660f..8c050dab1726 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -37,13 +37,14 @@ overrides: rollup: 'catalog:' vite: 'catalog:' vitest: workspace:* + # local tarball of rrweb-snapshot built from rrweb-io/rrweb#1896 (hackCssPseudoClasses) + rrweb-snapshot: file:./rrweb-snapshot-2.1.0.tgz patchedDependencies: '@sinonjs/fake-timers@15.4.0': patches/@sinonjs__fake-timers@15.4.0.patch acorn@8.11.3: patches/acorn@8.11.3.patch cac@6.7.14: patches/cac@6.7.14.patch istanbul-lib-instrument: patches/istanbul-lib-instrument.patch istanbul-lib-source-maps: patches/istanbul-lib-source-maps.patch - rrweb-snapshot@2.0.1: patches/rrweb-snapshot@2.0.1.patch catalog: '@babel/core': ^7.29.0 '@babel/plugin-proposal-decorators': ^7.29.0 diff --git a/rrweb-snapshot-2.1.0.tgz b/rrweb-snapshot-2.1.0.tgz new file mode 100644 index 000000000000..57b5bfb270a3 Binary files /dev/null and b/rrweb-snapshot-2.1.0.tgz differ