Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove stale 'recent' notebooks #877

Open
pankgeorg opened this issue Jan 28, 2021 · 12 comments
Open

Remove stale 'recent' notebooks #877

pankgeorg opened this issue Jan 28, 2021 · 12 comments
Labels
good first issue Good for newcomers

Comments

@pankgeorg
Copy link
Collaborator

pankgeorg commented Jan 28, 2021

definitions

stale means notebooks that no longer exist in user's filesystem (deleted or moved)
recent are the notebooks that appear in the 'Welcome' page. This list is populated when you open a notebook.

useful information / pointers

The recent notebooks list is saved in the localStorage object. The list is updated on the edit page (here) and is read on the Welcome page, here

suggested implementation outline

The browser cannot check if local files exist, so the test should take place in the backend.

Communication with the Pluto backend happens through Websockets from the /edit page.
Also, Pluto has some tricks to open a notebook remotely (when you click the '>' button on the recent notebook list) and understands that the file doesn't exist if you try to start the notebook it and that fails.

  • A basic implementation could remove the local storage entry when such a call (e.g. when it fails to open the notebook)
  • A more advanced implementation would use Editor's "this.client.send" to send a new request, through the websockets mechanism. The request would be handled like this one but instead of the :connect symbol it would have your own (:clean_recent?). Then a function on the backend would receive the list you'll have sent, check if the files exists, and return the new list. Then the frontend (which patiently awaits all this time) will update the localStorage accordinly. This can run once each time the /edit is opened.

If you're interested in doing that and have more questions, feel free to ask here or in zulip topic on this

@pankgeorg pankgeorg added the good first issue Good for newcomers label Jan 28, 2021
@stillyslalom
Copy link

Some other subtleties to handle:

  • Automatically redirecting paths when switching between Windows 10 and WSL (to avoid duplicate entries)
  • Instead of removing all inaccessible notebooks from local storage, only removing the ones in system temporary directories. Notebooks may have been loaded from a network drive that's not always accessible, but they shouldn't permanently disappear from history just because the network drive is unmounted.

@BrettKnoss
Copy link

BrettKnoss commented Jan 28, 2021

I suggested a notebook that was suggested to be broken up into pieces. Can we have sections? Getting Started, Calculus, Statistics, Visualization (maybe something with Cairo.jl) I'd also like it if when you opened a new notebook, it asked to enter a title, or even where to save, instead of just a goofy name (can have a random name button).

@pjgoodall
Copy link

Why is this closed?

@pankgeorg
Copy link
Collaborator Author

It's a duplicate of this #877 right?

@BrettKnoss
Copy link

I saw that notbooks can be closed and reopened from the main menue. It would be nice if there was a way to refresh a whole notebook, even if updating something like include(). I already mentioned the value of being able to reload sections.

@pjgoodall
Copy link

@pankgeorg Yes #877 expresses my needs - thankyou.

@shengjiex98
Copy link

shengjiex98 commented Jul 8, 2022

I second this--sometimes just renaming the parent folder of a notebook leaves multiple copies of the same notebook in the recent section and things quickly become messy. I think a simple Clear Recent Files button would suffice.

@jcbritobr
Copy link

A button to clear recent notebooks in interface would be nice.

@gganapat
Copy link

If someone really, truly wants to clear the list (like I did), one way is to access console (through Tools/Browser Tools/Web Developer Tools) and type "localStorage.clear()" in console, press"return" and that will remove all the files in the "My work". I assume you folks know it, but this could help other people who are not fully aware of this technique.

Gani --

@ghost
Copy link

ghost commented Feb 11, 2024

gganapat - Dec 11, 2023 wrote:

  • Access console through Dev Tools and type "localStorage.clear()" in console at blinking cursor
  • press "return" and that will remove all the files in the "My work"

This worked for me - thanks.

(comment formatted by @pankgeorg)

@s-celles
Copy link

Hello,

Thanks for Pluto.jl. That's a great software.

When clicking on a recent file I'm getting

Can't find a file here
Please check whether C:\Users\scell\live_plot_sin.jl exists.

[Go back](http://localhost:1234/open?path=C%3A%5CUsers%5Cscell%5Clive_plot_sin.jl#)

Maybe in such a case you could ask user if he want to remove this entry from Recent notebooks list.

Any opinion ?

@efaulhaber
Copy link

We use Pluto in a large programming basics lecture, and we have a lot of students asking how to remove notebooks from "my work".

"Open the console of your web browser and execute localStorage.clear()" is not something that we can tell students who are learning basics and struggle with finding the terminal, so this feature would be highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

9 participants