Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Add ability to enable / disable collapsible notebook cells #132

Merged
merged 12 commits into from
May 12, 2020

Conversation

marthacryan
Copy link
Member

@marthacryan marthacryan commented May 6, 2020

Patch for #123 to allow users to disable the collapsing cells feature of ToC.
Adds a setting in the Jupyter lab setting registry to enable/disable the collapsing feature of ToC in notebooks. Removes the dropdown feature in Toc but leaves the blue side bar, so some collapse behavior is still present. I left the blue side bar to collapse individual cells because I wasn't sure if this part of the collapsing feature was bothering people - I can remove that as well if so.

To try out changing this configuration, open the settings menu of Jupyter lab (shortcut is ⌘ , ) and add the configuration under "User Preferences" like this:
image
Then, reload the page in your browser and the changes should be visible.

When collapsibleNotebooks is set to false, the extension looks like this:
image
After clicking the blue side bar:
image

Fixes #123

Adds a setting in the Jupyter lab setting registry to enable/disable
the collapsing feature of ToC in notebooks. Removes the dropdown
feature in Toc but leaves the blue side pane, so some collapse behavior
is still present.
@lresende lresende requested review from kgryte and lresende May 6, 2020 21:28
Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

@marthacryan Thanks for working on this! A few minor nits.

src/generators/notebook/options_manager.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
schema/plugin.json Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
Martha Cryan and others added 3 commits May 6, 2020 16:51
Co-authored-by: Athan <kgryte@gmail.com>
Co-authored-by: Athan <kgryte@gmail.com>
Makes the JSON for schema/plugin.json to be simpler. Changes the
way that settings are loaded to handle errors in loading.
@marthacryan
Copy link
Member Author

Thanks for getting those suggestions in so quickly @kgryte - do these changes look ok?

schema/plugin.json Outdated Show resolved Hide resolved
schema/plugin.json Outdated Show resolved Hide resolved
src/extension.ts Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Show resolved Hide resolved
src/generators/notebook/options_manager.ts Outdated Show resolved Hide resolved
Martha Cryan and others added 5 commits May 6, 2020 18:44
Co-authored-by: Athan <kgryte@gmail.com>
Co-authored-by: Athan <kgryte@gmail.com>
Co-authored-by: Athan <kgryte@gmail.com>
schema/plugin.json Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
Martha Cryan and others added 2 commits May 6, 2020 19:10
schema/plugin.json Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/registry.ts Outdated Show resolved Hide resolved
schema/plugin.json Outdated Show resolved Hide resolved
@lresende
Copy link
Member

@kgryte with your latest commit, are we still waiting for any updates to this pr?

@kgryte
Copy link
Member

kgryte commented May 11, 2020

@lresende Approved. Have you had a chance to confirm the intended behavior on your end?

@lresende
Copy link
Member

@kgryte Yes, working as expected on my end. Verified that activating configuration it switches back to the old style where sections can become hidden, but, by default that is not the case anymore. Thank you and @marthacryan for getting this resolved.

@lresende lresende merged commit c95bb3f into jupyterlab:master May 12, 2020
@kgryte
Copy link
Member

kgryte commented May 12, 2020

@lresende As this is a breaking change, we'll need to release a new semver major.

@lresende
Copy link
Member

OK, but please give me a couple of days as there seem to have an unrelated issue and I want to check tomorrow before a release.

@kgryte
Copy link
Member

kgryte commented May 12, 2020

@lresende No worries. Just wanted to make sure we were on the same page regarding the version bump. :)

@billgreenwald
Copy link

Hi all, I was following the post that this fixed; is there a way for me to set the default option to be disable so that everyone in my organization wont accidentally miss anything, or does each individual person need to update this user preference?

@kgryte
Copy link
Member

kgryte commented May 19, 2020

@billgreenwald If you are centrally managing JupyterLab, then you can set plugin configuration options at the command-line upon launching JupyterLab. All users will then have the setting set to your preferred setting on load.

@billgreenwald
Copy link

We have a shared conda environment/anaconda install that everyone uses to run jupyterLab, but it lives on an nfs drive that is network mounted to many VMs, each of which runs its own jupyter lab instance. These are accessed via environmentModules, so I can set shared JUPYTER_PATH variables and such to give common access to kernels or plugins.

So I do and i don't have a centrally managed JupyterLab. Is there a way I can configure the extension itself at the install level, or settings from an environment variable? Or set default jupyter command line args to get passed from an environment variable?

I understand this is a very targeted question at my use case and help may not be possible/too specific for this thread. I appreciate all help though :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TOC hides notebooks cells - extremely confusing
4 participants