posit-dev / positron

Positron, a next-generation data science IDE
Other
2.57k stars 79 forks source link

Console: Easily accessible buttons for restarting and quitting #1123

Closed lionel- closed 7 months ago

lionel- commented 1 year ago

Restarting is such a common operation, I was thinking it would be nice to provide an easily accessible button for users who don't use keybindings. We could reproduce the restart and quit controls of the main runtime launcher menu at the top and put those next to the runtime "switcher" menu (is that how we call these?) of the console. To me it feels like the most intuitive place for these controls:

Screenshot 2023-08-22 at 08 41 33
DavisVaughan commented 1 year ago

I'd be slightly worried about people accidentally clicking that and losing their work, so if we did that then it should probably use the same "safety" popup we've talked about using elsewhere, i.e. a UI prompt saying "are you sure?"

Notably in RStudio we don't have any UI for restarts that I know of beyond hitting Session -> Restart R

I'm not actually sure it is that common in data science (but definitely is in development work, but those people are more likely to be aware of the keyboard shortcut)

lionel- commented 1 year ago

Agreed that restarting should prompt the user.

I'm not actually sure it is that common in data science

I'd say we still want to make it easy to start from fresh as opposed to rm(list = ls())?

kevinushey commented 1 year ago

I'd be slightly worried about people accidentally clicking that and losing their work, so if we did that then it should probably use the same "safety" popup we've talked about using elsewhere, i.e. a UI prompt saying "are you sure?"

I agree pretty strongly with this. I like the idea of just having a command + keyboard shortcut for unprompted restarts, as that's overall harder to unintentionally fire.

isabelizimm commented 1 year ago

I had a similar comment in https://github.com/rstudio/positron/issues/906. For Python, restarting your kernel is very common, so I would be in favor of a restart button. What if the restart button was all the way to the right, not adjacent to other tabs? You'd be less likely to misfire on your way to Console/Output/Terminal/etc

jennybc commented 1 year ago

When someone does rm(list = ls()), I think Clippy should appear and ask the user if what they really want to do is restart R 📎

jmcphers commented 1 year ago

Agree that a restart button would be very helpful, but as it's destructive we probably want to wait until #649 is done before adding a one-click restart button.

chendaniely commented 10 months ago

I think I found the console restart button on a lucky educated guess, but I do agree it's not totally obvious.

Scenario:

I was loading up a project with renv::init() and it asked me to restart my R session.

My thought process:

jmcphers commented 7 months ago

This is addressed in https://github.com/posit-dev/positron/pull/2415.

jmcphers commented 7 months ago
image

I wound up putting the buttons on the right instead of on the left as in the mockup, so that they wouldn't move around when you change directories/interpreters.

Also borrowed the start/restart icons from the top bar to reuse here; they look a little out of place since all the other art in the actions bar for the Console uses thinner lines. Maybe we should switch to thinner lines everywhere or use different assets for these.

juliasilge commented 7 months ago

In Positron 2024.03.0 (Universal) build 1058, I now see and can use these buttons:

Image

They behave as expected.