Skip to content

Conversation

@agriyakhetarpal
Copy link
Member

This PR introduces the shareable URL as a URL parameter to the notebook URL when it first connects to the sharing service (on manual shares). As with other instances, we use window.history.replaceState to modify the URL without reloading the page. This guarantees that if an authored notebook is reloaded, the shareable link in the URL will still enable users to access a view-only version, from which they can create another copy and retain their work. To generate a new notebook, students will need manually remove the URL parameter themselves. As discussed, since the save interval is thirty seconds, there is a slight chance that changes made between these intervals might not be saved, but I would emphasise that we are already doing our best to prevent data loss through other methods (toast notifications, handling beforeUnload events, etc.).

Currently, this cannot be reliably tested until I complete #73, so I've skipped adding a test. However, I have tested this locally.

As discussed internally, this is slightly orthogonal to the sharing token being persisted using a cookie or the notebook content being saved to a cookie with an extremely short expiration time.

Closes #104.

@agriyakhetarpal agriyakhetarpal added the enhancement New feature or request label Sep 29, 2025
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Copy link
Collaborator

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@agriyakhetarpal agriyakhetarpal merged commit 87bdde8 into JupyterEverywhere:main Sep 29, 2025
10 checks passed
@agriyakhetarpal agriyakhetarpal deleted the sharing-url-for-first-share branch September 29, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When a notebook is saved/shared for the first time, add the shared ID as a URL parameter on the same page

2 participants