-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Improved URL scheme, state, interactions for single document mode #8715
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
Conversation
|
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
|
Anyone with experience with puppeteer and the |
|
Ahhh, I guess |
|
I dove into testing this with puppeteer and ran into a bunch of issues. @blink1073 and I believe that we should wait until we have the new browser testing framework that @mbektasbbg is proposing to merge into the org: |
|
A couple of follow up things:
|
Are you not seeing this on |
|
To try this out:
|
|
If you rebase, we already depend on the alpha version of |
|
For the default workspace, we could create a constant that we compare against and know could never be in a URL. One place we use a special string is in the setting registry: /**
* The ASCII record separator character.
*/
const RECORD_SEPARATOR = String.fromCharCode(30);Or in this case, we might consider using the null character: |
f1d17c5 to
9da881d
Compare
|
I rebased on master so this branch now depends on the preview of jupyterlab_server, so you won't need to separately install that as long as you do |
af6ba41 to
296d58c
Compare
|
The most recent commit requires this PR from |
|
I have addressed all feedback and made all changes that are needed. I am seeing tests pass locally, so this may be a hiesenbug in the test suite for kernels. |
|
apputils is passing but there are other failures |
|
I'm looking into the Python failures separately, I see them in another PR as well. |
|
Kicking CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ellisonbg! This looks ready to merge. Any UX decisions we make going forward should not modify these APIs so 👍
|
Everything looks good on this, ready to merge :-) |
…nterface This reverts part of f151ddd (see jupyterlab@f151ddd#diff-8c7e52adc72ce433f77a37e6418721fb38204c7bab00d78fc89e67bd49176044R263-R268, part of jupyterlab#8715 ), consistent with the decisions made in jupyterlab#9323 and jupyterlab#9334 Thanks to @krassowski for bringing this up at jupyterlab#9567 (comment)
This PR implements an improved single document mode, focusing on the URL scheme, state, and interactions across multiple browser tabs.
Todo:
IInfo.workspace, but not sure that makes sense - everything else is usingPageConfig. Have removed this fromIInfo, we will usePageConfigfor now.References
#8292
Code changes
PageConfignow contains a.modeattribute with a value of eithersingle-documentormultiple-document.PageConfignow hasworkspaceandtreePathvalues to contain the name of the workspace, and the tree path if any. Any mutations of the URL need to update the valued in thePageConfig.DocumentManagerhas amodeattribute that is kept in sync with theILabShell.modevalue. WhenDocumentManager.modeis set tosingle-documentdouble clicking on a file in the file browser will open it in a new browser tab and clicking on the+button in the file browser will open a new browser tab with the launcher open. The launcher creates widgets on the current page.ILabShellhas newmodeChangedandcurrentPathChangedsignals that fire on the document mode changing and the path of the current document changing respectively.IRouter.INavOptionsnow has an optionalskipRoutingattribute that will cause the router to skip all routing and just update the URL.PageConfig.getUrlfunction is provided to make it easy to build URLs that adhere to the master URL pattern for the application (given a mode, workspace, and tree path).IOpenOptionsnow has an optionalmaybeNewWorkspaceattribute that will cause document opens to be done in a new browser tab if theDocumentManageris in single document mode.User-facing changes
PageConfig.+button in the default file browser.Backwards-incompatible changes
ITreePathUpdaterinterface, which is a function that can be called to update the treePath encoding in the page URL.workspacesUrlandtreeUrlvalued have been removed fromPageConfigas they are no longer relevant./(lab|doc)(/workspaces/[a-zA-Z0-9\-\_]+)?(/tree/.*)?where the/labprefix maps ontomultiple-documentmode and/docmaps ontosingle-documentmode.ILabShell.restoreLayoutnow takes two arguments, the mode and the layout. This was needed because the mode has been removed from the layout and put into the URL.