# Code folding broken in 4.0.0a28+?

**URL:** <https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360>\
**Category:** JupyterLab\
**Created:** [October 15, 2022, 1:43pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360 "2022-10-15T13:43:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![schmidi314](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/schmidi314/32/5758_2.png) [@schmidi314](https://discourse.jupyter.org/u/schmidi314)\
**Post date:** [October 15, 2022, 1:43pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/1 "2022-10-15T13:43:01Z")

</div>

Hi, is that only me or is code folding broken in the recent jupyter lab pre-releases? I didn’t find an issue, though.

If I activate code folding in the new settings editor (Notebook-\>Code Cell Configuration-\>Code Folding), the extra bar left of the code cell (where the triangles are supposed to appear) is there, but no triangles to let me collapse functions.  
 ![Peek 2022-10-15 15-42](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/7/7bd8efe3bf2aba828a8abcadd5fa9257098bce89.gif)

---

<div class="post-metadata">

**Author:** ![juhuebner](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/juhuebner/32/11566_2.png) [@juhuebner](https://discourse.jupyter.org/u/juhuebner)\
**Post date:** [November 10, 2023, 1:32pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/2 "2023-11-10T13:32:41Z")

</div>

Hi there,  
is there any advance on this topic. It does not seem to work on v4.0.8 still?

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [November 10, 2023, 1:51pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/3 "2023-11-10T13:51:04Z")

</div>

This issue was reported on GitHub in [Code folding is broken · Issue #13362 · jupyterlab/jupyterlab · GitHub](https://github.com/jupyterlab/jupyterlab/issues/13362) and fixed by [Use tokens to extend CodeMirror editors by fcollonval · Pull Request #13639 · jupyterlab/jupyterlab · GitHub](https://github.com/jupyterlab/jupyterlab/pull/13639). It works for me in v4.0.8.

@juhuebner can you please double check that you tick the Code Folding in Notebook rather than in Text Editor section? If so, can you post a screecast/gif?

---

<div class="post-metadata">

**Author:** ![juhuebner](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/juhuebner/32/11566_2.png) [@juhuebner](https://discourse.jupyter.org/u/juhuebner)\
**Post date:** [November 13, 2023, 3:03pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/4 "2023-11-13T15:03:30Z")

</div>

The Code Folding is ticked in the Notebook section:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/2/29f9edf6c5da1729fd0d622c06ddf6e68f3e3154.png)

I use Notebook v7.0.6 the same happens in jupyterlab 4.0.6

---

<div class="post-metadata">

**Author:** ![juhuebner](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/juhuebner/32/11566_2.png) [@juhuebner](https://discourse.jupyter.org/u/juhuebner)\
**Post date:** [November 13, 2023, 3:04pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/5 "2023-11-13T15:04:14Z")

</div>

The banner appears but no triangle or anything else clickable  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/5/5b33bf3be181e9eec7f99b34b7aeff064fd9cccf.png)

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [November 13, 2023, 3:14pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/6 "2023-11-13T15:14:27Z")

</div>

Does it still happen in jupyterlab 4.0.8?If so, can you open a new issue with as many details as possible (see the issue template in jupyterlab github repository).

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [November 13, 2023, 3:15pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/7 "2023-11-13T15:15:08Z")

</div>

Your screenshot does not show a function or class to be folded. Is there a triangle when you try:

```python
def test():
     pass

```

---

<div class="post-metadata">

**Author:** ![juhuebner](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/juhuebner/32/11566_2.png) [@juhuebner](https://discourse.jupyter.org/u/juhuebner)\
**Post date:** [November 15, 2023, 11:19am UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/8 "2023-11-15T11:19:10Z")

</div>

Yes, indeed there is now. I was looking for a button or similar which could collapse the whole cell - like it works for Markdown cells.

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [November 15, 2023, 11:19am UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/9 "2023-11-15T11:19:52Z")

</div>

Did you try pressing the blue strip to the left of the cell?

---

<div class="post-metadata">

**Author:** ![juhuebner](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/juhuebner/32/11566_2.png) [@juhuebner](https://discourse.jupyter.org/u/juhuebner)\
**Post date:** [November 16, 2023, 11:53am UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/10 "2023-11-16T11:53:29Z")

</div>

Yes, indeed this works.  
Is there actually a way in (nearly) completely supressing the display of any code input, i.e., for getting a nice presentation direct from within jupylab (e.g., via [deathbeds/jupyterlab-deck: Lightweight presentations for JupyterLab (github.com)](https://github.com/deathbeds/jupyterlab-deck))?

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [November 16, 2023, 1:43pm UTC](https://discourse.jupyter.org/t/code-folding-broken-in-4-0-0a28/16360/11 "2023-11-16T13:43:50Z")

</div>

> [@juhuebner](#):
>
> Is there actually a way in (nearly) completely supressing the display of any code input

Yes, [the Voila](https://github.com/voila-dashboards/voila) renderig of a Jupyter notebook doesn’t display the underlying code. Be sure to check out [the Voila Gallery](https://voila-gallery.org/) and the underlying `.ipynb` file for each.

For the older Jupyter Notebook, now NbClassic, there was [Appmode](https://github.com/oschuett/appmode#appmode) before Voila came along.
