A JupyterLab extension to hide/show notebook inputs (permanently, without accidental uncollapse) with a Colab-like play button.
Allows you to hide the code so it cannot be accidentally uncollapsed by clicking into the cell. You can do this by clicking the notebook toolbar button 'Show/Hide Code' or using the keyboard shortcut Ctrl+Shift+H (Windows/Linux) or Cmd+Shift+H (Mac).
Hidden cells stay locked even if you click into them—only the JupyterLab Hide Code shortcut/button changes their visibility, preventing accidental uncollapse while reading.
When a cell is hidden/locked, a small "play" button appears next to the cell's collapser. Clicking this button runs the cell in place without expanding it.
This feature is inspired by Google Colab's behavior, allowing users to execute code without revealing it. The regular cell execution methods (Shift+Enter, Run button) will still work as usual without expanding the cell.
- JupyterLab >= 4.0.0
To install the extension, execute:
pip install jl-hidecodeTo remove the extension, execute:
pip uninstall jl-hidecode
