sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Bug: rrweb doesn't correctly serialize values for `grid-template-areas`

Open ryan953 opened this issue 1 year ago • 7 comments

See also https://github.com/getsentry/team-replay/issues/382

I noticed that on my demo site i had a css class defined as:

.layout {
  display: grid;
  grid-template-areas:
    'img'
    'title'
    'desc';
  grid-template-rows: max-content;
  grid-template-columns: 1fr;
}

but when playing it back inside the replay (example replay) the css was instead:

.Media_layout__lkQuJ { display: grid; grid-template: "img" max-content / 1fr; }

^ this is the serialized css coming from the server.

Notice how the only grid-area defined is img. The other areas are automatically created, but not named, based on the definition max-content / 1fr which creates a 2 column, N row grid that gets filled in with children left-to-right, top-to-bottom.

The result is that the playback shows a different layout than what the user saw, things looking really broken inside the replay.

ryan953 avatar Feb 16 '24 22:02 ryan953

Action plan: Write a test to repro this, so we can create a ticket upstream. We can follow that with a PR to try to address this.

bruno-garcia avatar Feb 26 '24 15:02 bruno-garcia

Hello! I'm having the same problem. I'm using grid-area and the layout is totally broken on Session Replay. The image bellow shows a Replay with 4 inputs above each other. In the original layout all the 4 inputs are rearranged with grid-area.

image

vctormb avatar Mar 07 '24 19:03 vctormb

Hey @vctormb are you able to provide a minimal reproducible example? This would help us investigate and fix the problem. Thanks!

Lms24 avatar Mar 08 '24 08:03 Lms24

Hey @vctormb are you able to provide a minimal reproducible example? This would help us investigate and fix the problem. Thanks!

Here it is a repo reproducing the issue.

vctormb avatar Mar 08 '24 14:03 vctormb

Thank you! We'll look into this and try to fix this in rrweb.

mydea avatar Mar 11 '24 08:03 mydea

Hello everyone! Any updates on this one?

vctormb avatar Apr 05 '24 19:04 vctormb

Hey,

we haven't gotten around to fixing this yet, sadly. It is on our TODO list, but we are pretty swamped with tasks right now - we'll hopefully get to it soon! We'd also happily accept a PR to https://github.com/getsentry/rrweb fixing the issue in the meanwhile.

mydea avatar Apr 08 '24 07:04 mydea