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
Running Sidebar Extension API #6895
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
Does anyone know why that windows test is failing? It doesn't look like something I changed but I'm not sure how to interpret it |
There's ongoing issues with the JS CI tests. Don't worry about it. I restarted the failed test |
Ok, in the future is there a way for me to restart it from here so I don't have to bother you guys? |
You can close and then immediately reopen the PR. You may also be able to directly restart the test by clicking on |
OK thanks it looks like all the checks are passing now |
I think this is good to go if we can get a review |
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.
This looks really nice to me. Thanks @recamshak and @Queuecumber!
I've added a few inline notes for some small changes.
packages/running/src/index.tsx
Outdated
*/ | ||
name: string; | ||
|
||
add(manager: IRunningSessions.IManager): void; |
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.
How do we remove things we've added? One common pattern we have in the code is to return a disposable, and when you dispose it, it removes the item from the registry. A simpler way might be to just have a remove method.
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.
Disposable sounds like the right way, if not the easy way, can you point me at an example?
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.
Although its possible that the intention was that this would be add-only
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.
Sorry for the delayed reply. A good example of this pattern is
jupyterlab/packages/apputils-extension/src/palette.ts
Lines 63 to 68 in 1f59d9c
addItem(options: IPaletteItem): IDisposable { | |
let item = this._palette.addItem(options as CommandPalette.IItemOptions); | |
return new DisposableDelegate(() => { | |
this._palette.removeItem(item); | |
}); | |
} |
Not sure what just happened to the build but I'm unable to reproduce the error locally |
This failure seems relevant: ./terminal-extension/src/index.ts(26,10): error TS2305: Module '"../node_modules/@jupyterlab/running/lib"' has no exported member 'IRunningSessionManagers'.
../terminal-extension/src/index.ts(26,35): error TS2724: Module '"../node_modules/@jupyterlab/running/lib"' has no exported member 'IRunningSessions'. Did you mean 'RunningSessions'? You need to update the version dependencies in the jlpm run integrity in the repo folder. |
Sorry, that was confusing. I would say make whatever changes are needed to bring it in line with what is in master now, which I think would be accepting the change. |
Oh, never mind. I didn't catch it was the linter adding an extra line. I would accept the change from the linter. |
OK I pushed the lint changes |
@jasongrout How are we doing with this? |
Thanks for the ping. I've added it back to my review queue. |
packages/running/src/index.tsx
Outdated
Dialog.warnButton({ label: 'Shut Down All' }) | ||
] | ||
title: `Shut Down All ${props.manager.name} Sessions?`, | ||
buttons: [Dialog.cancelButton(), Dialog.warnButton({ label: 'SHUTDOWN' })] |
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.
Sorry, I meant to suggest adding a space: "SHUT DOWN"
buttons: [Dialog.cancelButton(), Dialog.warnButton({ label: 'SHUTDOWN' })] | |
buttons: [Dialog.cancelButton(), Dialog.warnButton({ label: 'SHUT DOWN' })] |
Sorry for the late reply. The only two outstanding things for me are #6895 (comment) and #6895 (review) |
FYI, I merged master in and resolved the conflicts. |
@jasongrout thanks for the help there, I've actually never had that happen before, how do I incorporate your merge into my repository to continue development? |
OK this should take care of the outstanding requests. I strongly suggest taking a close look at the packaging and things because I've never worked with yarn or typescript before. And sorry for the delay we have a new baby in the house so spare time is very limited right now |
I understand! Congratulations! |
I noticed that the staging directory had some changes since the last published version, so I reverted it. It should only be changed at release time. This isn't anything you did, but we might as well take care of it here. |
Thank you again @recamshak and @Queuecumber for contributing! |
@@ -323,56 +228,54 @@ export class RunningSessions extends ReactWidget { | |||
/** | |||
* Construct a new running widget. | |||
*/ | |||
constructor(options: RunningSessions.IOptions) { | |||
constructor(managers: IRunningSessionManagers) { |
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.
Note: This change seems to require a major version bump of the owning package.
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.
I think you're right. I've opened #7219 to track this.
References
Fixes #6876 and #5728
Takeover of PR #6002
Code changes
This PR adds an API for extensions to add their own sessions into the running sidebar
Note
Please look this over carefully as the merge was rather messy and I am not familiar with all package versions. Additionally I am currently getting hit with bug #4619 so I'm unable to run the tests locally, I am going to try to work around that though