binaryage / cljs-devtools

A collection of Chrome DevTools enhancements for ClojureScript developers
Other
1.11k stars 51 forks source link

Rendering issue in devtools scope tree #52

Open hipitihop opened 5 years ago

hipitihop commented 5 years ago

Problem

We have recently noticed the following rendering issue with the devtools scope tree.

image

Environment / Observations

This might be a cljs-devtools issue I see latest 0.9.10 was released over a year ago. I'm not sure but did dirac embed the devtools and is it possibly running a more up to date version ? (we don't use dirac at the moment, but if installing it instead of cljs-devtools would that solve it ?

darwin commented 5 years ago

Thanks for reporting. My wild guess is that this will be related to some weird CSS interaction between cljs-devtools markup and official DevTools stylesheets.

darwin commented 5 years ago

I investigated it and my conclusion is following:

  1. it is a CSS issue, caused by overflow:hidden rule defined on some parent DOM nodes in "object properties" section and the fact that custom formatter "cells" are now rendered as if they overflowed their bounding boxes (for some reason unclear to me).
  2. DevTools css styles haven't changed recently to introduce this problem, it must be some recent Chrome CSS engine change
  3. I don't see a possible workaround for this in cljs-devtools itself.
  4. in short term I can work around it in Dirac
  5. in long term we need to prepare a minimal repro case and raise this to Chrome bug tracker as a regression
darwin commented 5 years ago

After further investigation. The overflow is triggered when scope area is small enough to fit whole custom formatter content. Display of disclosure triangles, seq numbers or "fn" markers is just a visual bug - for some reason overflow:hidden does not apply to them.

So a workaround is to resize right pane horizontally to fit whole custom formatter content.

darwin commented 5 years ago

Filled upstream as bug 1004070.

hipitihop commented 5 years ago

@darwin Many thanks for jumping on to this quickly and reporting upstream. As you discovered, I too have noticed that resizing the pane horizontally sometimes helps, however frequently there is simply not enough horizontal space even when set to the width of the window. In my case, this is on a 1920px monitor.

darwin commented 5 years ago

I'm with you. That is why I recommended them to get rid of that overflow:hidden logic and let the content scroll horizontally instead.

mike-thompson-day8 commented 3 years ago

For those that follow, a workaround is to right-click on any "scoped variable" not being rendered correctly, and select "store as global variable" . You can then inspect the data in the js console where there's no render issues. Idea credit @melissjs

https://blittle.github.io/chrome-dev-tools/sources/store-as-global.html