posit-dev / positron

Positron, a next-generation data science IDE
Other
2.45k stars 73 forks source link

Provide a `View()` and Data-Explorer-like experience for list objects #3028

Open juliasilge opened 4 months ago

juliasilge commented 4 months ago

In Positron, we represent list objects in our Variables pane with quite a lot of detail:

list-viewer

Early users have shared they would like to be able to explore this kind of view with more space in its own tab, like the Data Explorer. In RStudio, you can get a whole pane like that by doing View(my_amazing_model):

Screenshot 2024-05-06 at 1 59 10 PM

In Positron, View() errors on anything that is not rectangular.

cc @hadley

artmg commented 5 days ago

Following on from #4717 this would be a valuable addition, that would also comfort those making the transition from RStudio. The Variables pane in the Session panel does a reasonable job of allowing some exploration, but it allows just a limited space and distinguishing between different objects or their subelements is not obvious.

On the other hand having 'Data: Explorer' tabs up with the file editing tabs replicates very well the large view ability to navigate the structure of distinct objects that people will be familiar with in RStudio.

So perhaps, on View(object), if is.data.frame(x) || is.matrix(x) is not TRUE then an 'Object: Explorer' tab could be shown instead of the 'Data: Explorer'. It could have similar abilities to expand or hide that the Variables pane currently has, and always show the type. Perhaps to enhance the current RStudio experience it could bring over the 'show summary when closed' feature from the Variables pane. Finally 'breadcrumb' header or footer like in RStudio giving the navigation point, e.g. object[[2]][["structure"]][["path"]] is handy to view, copy or insert into the console.

artmg commented 5 days ago

By extrapolation of the 'can we have a Viewer for Objects like Data Explorer?', this make me wonder if there should be another feature request issue for the Session panel to have a separate expansion, in addition to Data, Valuables and Functions, a new one for Objects. Like in Data there could be a little icon at the end, which opens the Object Explorer. Or is that going too far?