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

What happens if demo files are updated and a user has already visited the site #11

Open
psychemedia opened this issue Jul 7, 2021 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@psychemedia
Copy link
Contributor

If a user has visited the site from a particular browser and then revisits the demo site at a later time, perhaps noticing from the repo that additional demo examples have been added, or original examples have been updated, how will their browser respond?

  • will new files be added to browser storage (which already has state associated with the demo URL)?
  • will updated files overwrite similarly named files in browser storage?

How could a user "update" their local state to reflect the current repo live demo state? (I guess one way might be to run the browser as a new private browser session, but how many folk would think to do that?)

@psychemedia psychemedia added the documentation Improvements or additions to documentation label Jul 7, 2021
@jtpio
Copy link
Member

jtpio commented Jul 15, 2021

Thanks @psychemedia.

The way it works for now if the jupyterlite is able to fetch the initial content (generated via jupyter lite build --files content) and show it in the file browser.

If new files are added to the repo and deployment, they should normally show up automatically.

If a user opens one of these files, modifies it and save it, it will persist in local storage. Next time the page is loaded it will still be the user's copy. If they delete the file (for example with right-click), the file will revert to the original (generated with --files).

@jtpio
Copy link
Member

jtpio commented Jul 15, 2021

Maybe we should have some docs about this to help clarify.

@psychemedia
Copy link
Contributor Author

"If they delete the file (for example with right-click), the file will revert to the original (generated with --files)."

So is this like some sort of "transparent mount", where a user can work in a "user layer" editing files etc but if they delete a file that was in edited user storage area it reappears from the provided/default files layer when they reload the environment.

To clarify: if I edit, save and delete a provided/shipped file in a browser session, if I hard refresh the browser, the deleted file will reappear? If I just delete a shipped file without changing it, will it reappear after a reload too?

Related are the semantics of the File menu options from an open notebook Reload Notebook from Disk and Revert Notebook to Checkpoint. The checkpoint is presumably in browser storage? Is just one checkpoint file supported? In what senses might the shipped file be regarded as "the original checkpoint" and in what senses might that be confusing/cause misunderstanding?

@jtpio
Copy link
Member

jtpio commented Jul 21, 2021

Normally it should be possible to test these scenarios and see what happens?

if I edit, save and delete a provided/shipped file in a browser session, if I hard refresh the browser, the deleted file will reappear?

Not the deleted files, but the original shipped file should appear.

If I just delete a shipped file without changing it, will it reappear after a reload too?

This should be like a no-op for now, and the file will still be visible in the file browser.

The checkpoint is presumably in browser storage? Is just one checkpoint file supported? In what senses might the shipped file be regarded as "the original checkpoint" and in what senses might that be confusing/cause misunderstanding?

It's in the browser storage yes. It was added in jupyterlite/jupyterlite#47 and keeps 5 versions.

@jmshea
Copy link

jmshea commented Jan 13, 2022

This already caused confusion for me, too. I put up a site for my grad class using Jupyter Lite and GitHub pages, and when I updated the notebook via git, I kept getting the old version. I think this is a place that some notifications would be really helpful like:

  • when a user first saves their notebook, alert them that the notebook will be saved to local browser storage on their machine, and future visits to this page will open their saved work
  • when the notebook in the repository is updated, offer users the option to load their previous version or load the latest version from the repository

It might also make sense to have a new menu item "Revert Notebook from Repository" or "Load Notebook from Repository" or similar; if it can specifically put "GitHub" instead of "Repository" when run from GitHub pages, that will be even more clear for users. It wasn't clear to me what disk that "Reload Notebook from Disk" referred to -- I thought it might get me the latest from the repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants