jupyterlab/jupyterlab-toc

TOC hides notebooks cells - extremely confusing

stefansimik opened this issue ยท 20 comments

Hi, after upgrade of this plugin to 3.0.0
I found, that this very useful plugin
hides notebooks cells, based on the collapsed status in TOC widget.

While I can imagine, this can be very useful sometimes,
it is definitely very confusing, when you are looking for missing cell,
just to find out, it was hidden by TOC.

How to turn this feature off please?
I received ~50 questions in our company,
that people are missing cells, they are looking for?

(it is not intuitive at all, that to find the cell, they have to open TOC
and try to expand all headers, to find the cell, they are looking for...)

This behavior:

  • should be configurable (switchable)
  • with intuitive setting to not hide notebook cells by default and just collapse the TOC sections

Yes, this feature should be configurable (cc @kgryte, who was involved in these discussions). Also see #109, which describes the same issue.

One more insight, why the current behavior is very confusing.

If you let many sections collapsed (in TOC extension), then content of the notebook loook like empty / half empty when notebook is opened.

People are mostly browsing files in File Browser - and as they open new notebook,
they see empty / half empty document and do not understand what happens - why cells are missing or why the document is working (they do not see code for loading data), but see the loaded data.

No one found out, that they have to switch to TOC Browser and expand all sections.
(and these are developers and analyst, not expecting this).

I was trying to check for their problems for several hours, just to find out this very confusing and unintuitive behavior.

Even worse things happened today in our company - people are deleting notebooks, because they think these are just some temporary notebooks, which do not contain required code (but it was just hidden). Very destructive effect.

I had this same issue, with the upgrade to 3.0.0 I thought I had lost all the content of my notebooks, and I had to pulled older git version of the notebook, to then realize the content was hidden by the TOC.
Is there a way to no have this hiding happen, or I guess have the install jupyter labextension install @jupyterlab/toc revert to the previous version?

I got bitten by this too. I noticed the code was gone, but it was still present when inspecting the .ipynb in a text editor.

An improvement would be to signify code is collapsed by an ellipsis ...

I was confused by this too. I thought that the find function was broken as it displayed hits but I could not see them. I support adding an ellipsis to signal that some cells where hidden. Additional proposal:

  • expand the hidden cells if there is any match from the search function

Count me in. I was very excited about the content collapsing feature when TOC 3.0 was first rolled out. But then I increasingly found it brought me more confusion than convenient. For example, when I do some search in the notebook, matches in the collapsed cell wouldn't show up. For an extremely long notebook, it's almost infeasible to expand all cells just to find out where the match is.

Vote for a "configurable cell collapsing" feature. Thank you!

The collapsing makes sense, but it needs a visual indicator that presents itself to users that content has been hidden when viewing the notebook. Maybe some kind of bright colored triangle on the edge where the content has been collapsed? Even better if it is clickable to expand the content.

It seems like the first thing to do would be to create a configuration option in lab to disable the hiding feature. Then, we can work on some of the designs to make this more user friendly. Here are some ideas for making this more intuitive:

  • Show the first line of the section you're hiding followed by an ellipsis to indicate that this is a preview - either can be clicked to expand the hidden content.
  • Change the blue side bar to include a clickable triangle to indicate that content is hidden, and expand the content when clicked (changes from > to โ–ผ when expanded)
  • Automatically expand content if it contains matches for the current search.

Do those features seem sufficient to fix this? Thanks!

Some of the desired changes were discussed back in December at the JupyterLab dev sprint. However, changes need to happen upstream in core to make them possible. Notably, core would need to provide APIs for collapsing content independent of TOC. The current TOC collapse behavior is something of a hack to address the lack of upstream APIs. If my recollection serves me correctly, providing such APIs is not straightforward.

The easiest patch is to add a setting for disabling collapse behavior. This should be straightforward. PRs are welcome.

+1 for preferring a (visible in notebook, clickable to expand the section) indicator of folding if possible - rather than just a setting to disable the functionality altogether

Thanks to @marthacryan for looking into this, I have assigned the issue to her. And thank you @kgryte for bringing us up to speed on historic details.

I just added a PR to add configuration to enable/disable this collapsing behavior - does it seem like the dropdown feature is causing people the most confusion? I left in the blue side bar collapse behavior (with a clickable ellipses in the place of hidden cells) because it seemed less troublesome but I can disable that behavior in this PR as well.

@marthacryan The blue side bar collapse is a JupyterLab feature, not something originating from the ToC extension. Your PR should address the concerns in this issue.

I just installed TOC v4.0.0 and I don't have the arrows ( > or โ–ผ ) next to my cells in the TOC so I can't collapse/uncollapse. Am I missing a setting somewhere?

I have collapsed cells that as of now, I cannot uncollapse.

Thanks!

@billgreenwald Please look at #132 on details (screenshot) on how to re-enable it via jupyterlab settings.

Thanks for the link -- that worked. I think it should be added to the TOC Readme page on the git.

Also, it looks like the property gets set differently from whats in the screenshot; its now just

{
    "collapsibleNotebooks": true
}

instead of what is shown

{
    "tocConfig":{
        "collapsibleNotebooks": true
    }
}

A pr to the readme would be greatly appreciated

First of all thank you for this wonderful project, it is the most important extension in my usage of jupyter.

but can we make the default setting to be "collapsibleNotebooks": true, instead of having the user doing all the searching instead?

One data point, after switching computers and copying over a saved ipynb (happened to be folded using ToC plugins previously), on the new computer with latest ToC plugin, there is no visual sign any more (the sideway pointing and downward pointing triangles indicating folded/unfolded status). The folded cells completely disappeared. I have to use jupyter notebook to ensure they were actually there and not been deleted by accident.

I found my cells missing too. And what is worse, with the new jupyter lab and new toc, I can not even recover the cells on the toc. It would be nice to check this bug (the arrow that can re-show the cells is gone in the new version)

Update:

The actual reason for my cells are missing is that, I collapsed them before, and then the ToC collapse function is off. Then my cells are gone! I think it might be better to let it on...