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
Support dynamic toolbar definition #11963
Conversation
Thanks for making a pull request to jupyterlab! |
I'ld like to target 3.3.x for this one as the toolbar definition from settings has been backported there. |
cc @jtpio |
Sounds good, thanks! |
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.
Changing ranks works beautifully but I could not get the disabled
option to work - the item did not disappear neither after saving settings nor after reloading. I see that a filter on item.disabled
was removed - was this intentional, or just an oversight when refactoring?
Thanks for the review @krassowski |
@echarles would you mind reviewing this one? This is the one missing before releasing the 3.3 beta. |
... but I may be misunderstanding the feature. Maybe the settings aims to mutate (rank, disable) the existing toolbar, but is not there to remove any of the existing items? |
The settings for the toolbar is taking a similar approach as for the menus and the shortcuts; aka user settings is merged with the default one. Hence the behavior when the user setting is empty. |
@meeseeksdev please backport to 3.3.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
@fcollonval I have merged this PR in master. Backporting to 3.3.x is giving conflict. |
Thanks I'll do the backport |
Benchmark reportThe execution time (in milliseconds) are grouped by test file, test type and browser. The mean relative comparison is computed with 95% confidence. Results table
Changes are computed with expected as reference. |
Co-authored-by: Eric Charles <eric@datalayer.io>
This still seems to be an issue with |
We still have the workaround in the test on master too: jupyterlab/packages/apputils/test/toolbar.spec.ts Lines 310 to 314 in c7b14ee
|
I tested locally without the workaround. And it worked. But I presume the trouble is on the CI, isn't it? |
The tests seem to be passing on the JupyterLab CI without the workaround: #12096 |
But normally this is reproducible locally with retro with jupyterlab/retrolab#351 and without the workaround (jupyterlab/retrolab@dd750da) |
References
This addresses mainly the error seen in
jupyterlab/retrolab#319 (comment)
it also allows to change the toolbar definitions from the settings without reloading
Code changes
The toolbar factory for document widget factory can return either a list of toolbar items or an observable list. When an observable list is returned, the toolbar is updated accordingly.
The toolbar definition built using the settings are returning an observable list.
User-facing changes
Toolbar definitions can be changed without reloading.
Backwards-incompatible changes
N/A