posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.78k stars 85 forks source link

Data Explorer: Move into New Window does not work in web mode #5090

Open jmcphers opened 3 weeks ago

jmcphers commented 3 weeks ago

System details:

Positron and OS details:

Latest main as of 2024-10-21

Interpreter details:

Any

Describe the issue:

If you attempt to pop out the data explorer to a new window, you get a blank window.

Image

Steps to reproduce the issue:

e.g. in R:

View(mtcars)

then press the Move into New Window button

Image

Expected or desired behavior:

The new window should show the data explorer. If we can't make this work in web mode, an alternative would be to disable this button in web mode.

Were there any error messages in the UI, Output panel, or Developer Tools console?

Surprisingly, I did not see any.

timtmok commented 3 weeks ago

I think there's some kind of event that's missing or required to tell Data Explorer the viewport size. It's rendering all the content but it's all zero width. Resizing the new window causes the UI to redraw to the correct size.

https://github.com/user-attachments/assets/9d677a09-1fc9-4bb8-9f37-84f932ce6a75

timtmok commented 3 weeks ago

I tried playing around with widths and we might need a way to know the editor is in a new window and use window.innerWidth for setting the initial width. The DataGridWaffle also seems to have zero initial width as well.

timtmok commented 1 day ago

I thought this was only occurring with Data Explorer but I now notice that all editors get the wrong size when the layout runs. In EditorPanes.layout(), new windows get an improper size so the editor contents don't know what size to be.

Then I tried it on Workbench and it wasn't a problem at all. Text, plots, and data explorer editors all show properly when moved into a new window. In dev with a web deployment, it never shows the editor properly until a manual resize. 😕