Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Feature request: double click the cell output to show the code

Open barucden opened this issue 2 years ago • 10 comments

It is currently possible to show/hide code using the quite small "eye" button next to the cell. I frequently use it to hide code containing markdown to display only the nicely formatted output. Sometimes, after hiding the code, I would like to display the code again and edit the wording etc., which is currently only possible by clicking the "eye" button.

I was thinking that it would be more convenient to show the code by double-clicking the cell output. The cursor might even jump inside of the cell code. I believe this would be also useful for cells producing figures or even plain julia code.

Would it be desired by other users too? And is it possible to implement technically?

Thanks!

barucden avatar May 02 '22 16:05 barucden

Another advantage of this is it could be temporary, like is the case with erroring cells, so that shift+enter hides the source again.

gustaphe avatar May 31 '22 09:05 gustaphe

We could add a button to copy output to the cell context menu (which only shows when the output mime is text/plain)!

Schermafbeelding 2022-06-03 om 00 24 20

fonsp avatar Jun 02 '22 22:06 fonsp

I think there is some confusion here. The suggestion and the new title do not reflect the original feature request (Though it is a decent idea).

gustaphe avatar Jun 03 '22 05:06 gustaphe

Right! Normally, when an issue is a direct feature request instead of problem statement, we either convert it to a discussion or submit it to our feedback system, and close it: https://github.com/fonsp/Pluto.jl/issues/182

This time, I just changed the implementation to something that works with in our context, and I decided to keep the same issue instead of closing it and creating a new one.

fonsp avatar Jun 03 '22 09:06 fonsp

Oh, I apologize for that. I now see that I should have used a different communication channel.

However, I would still like to hear what other people think about the original proposal. I, for instance, liked the @gustaphe's idea of showing the code only temporarily. Should I just open a discussion for that (it seems that sending a message through the feedback system does not allow for a discussion)?

I don't see how the new proposal is related to my original one so I cannot comment on that.

barucden avatar Jun 03 '22 11:06 barucden

Oh oops, I misread the original post 😅

fonsp avatar Jun 03 '22 11:06 fonsp

Sorry for the confusion, I created https://github.com/fonsp/Pluto.jl/issues/2151 about my separate issue

fonsp avatar Jun 03 '22 11:06 fonsp

My concern with double clicking is that it already has a function in selection (select the whole word).

I think that the feature suggestion makes sense from a purely IDE viewpoint, but I am worried that the behaviour is unexpected for notebooks that contain more prose, like https://computationalthinking.mit.edu/Spring21/hw3/ We want Pluto notebooks to be both: an IDE, but it should also look and feel like a web article.

fonsp avatar Jun 03 '22 11:06 fonsp

It's not important to me exactly what the interaction is, but a "temporarily edit cell code" functionality would be nice (and is already implemented for erroring cells)

gustaphe avatar Jun 03 '22 12:06 gustaphe

I am also not certain about the interaction. It would be great if we could come up with something more convenient (bigger, easier to click it) than the eye button.

barucden avatar Jun 03 '22 15:06 barucden