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

[wip] Use appUrl and file name for shareable link #457

Closed

Conversation

bollwyvl
Copy link
Collaborator

@bollwyvl bollwyvl commented Jan 20, 2022

References

Code changes

  • uses {appUrl}/index.html (where appUrl is usually lab) for the full link

User-facing changes

  • the back button should work after redirecting (should be able to test from the rtd preview)

Backwards-incompatible changes

  • n/a

Future work

We might want to open up the API to support making the shareable params configurable. For example, jupyter-video chat offers the ?jvc=room feature, and it would make sense to be able to share that room state as well.

This also initially supported the command palette, but I've rolled this back, as I didn't realize it only applied to the selection from the file tree, not the main area. This would probably be a useful feature in its own right, but would have a different name, e.g. Copy Workspace Link or something along those lines, and is probably out of scope

@github-actions
Copy link
Contributor

lite-badge 👈 Try it on ReadTheDocs

@bollwyvl bollwyvl changed the title Use appUrl and file name for shareable link [wip] Use appUrl and file name for shareable link Jan 20, 2022
@bollwyvl bollwyvl added the enhancement New feature or request label Jan 20, 2022
@bollwyvl
Copy link
Collaborator Author

Hmmm... it looks like this is enabled in the retro tree, but points back to /lab/. It appears to work the same way in bog-standard retrolab.

@jtpio any thoughts on what the correct behavior should be here? I don't think it would block this, especially if it needs to be fixed upstream. I could imagine a few options (non-exclusive):

  • disable the command altogether
  • add a button (classic didn't use much right click, so I'm wagering folk won't expect stuff there)
  • disable the command if multiple items are picked
  • allow picking multiple items, open the tree, and then open all the tabs... weird, but seems like it would logically fit the idea

Anyhow, seems like RTD is having A Day... will take another look tomorrow.

@bollwyvl
Copy link
Collaborator Author

bollwyvl commented Jan 20, 2022

Ok, one should be able to back-button from this link:

https://jupyterlite--457.org.readthedocs.build/en/457/_static/lab/index.html?path=javascript.ipynb

No dice: it still gets consumed by the redirect. Will consider some other approaches...

@leukipp
Copy link

leukipp commented Jan 21, 2022

Related to #450 I found that router.navigate(...); is used

router.navigate(`${pathname}${search}`, { skipRouting: true });

which does a history.pushState({}, '', url);.

The history stack contains then the old url (with path parameter) and the new url (without path parameter). Going back leads to the loop behavior.

Some options involving history manipulation:

@jtpio
Copy link
Member

jtpio commented Dec 22, 2022

Planning to take a look later when we start updating to the JupyterLab 4 and Notebook 7 packages: #826

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.

"Copy Shareable Link" issue with browser go-back function
3 participants