Pluto.jl
Pluto.jl copied to clipboard
Remove stale 'recent' notebooks
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 patientlyawait
s 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
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.
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).
Why is this closed?
It's a duplicate of this https://github.com/fonsp/Pluto.jl/issues/877 right?
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.
@pankgeorg Yes #877 expresses my needs - thankyou.
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.
A button to clear recent notebooks in interface would be nice.
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 --
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)
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 ?