jupyter / jupyter/notebook

Output cells should not auto-collapse more than once per execution

Open
#7,003 5 comments 1 reaction 0 assignees View on GitHub
bug regression
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

## Description

I just upgraded to jupyter notebook 7.0, thus migrating from the "classic" experience to the "jupyterlab" based version. With that migration, my user-experience has degraded significantly. I have a notebook that hosts a number of weakly related interactive tasks that I run sporadically while exploring a problem. The output from some of these cells can sometimes be 100s of lines long. In general, that output being collapsed is great, but while a specific task is running, I want to be able to use the full screen real-estate to monitor the (long-running) task as it goes. Previously, I would un-collapse the output after it started, and then be able to just follow the output, as it is generated. Now, if I attempt to do that, after a several seconds and potentially hundreds of lines of output later, it auto-collapses again. All of a sudden, this leaves me (who followed the output in the uncollapsed state) in the middle of nowhere far away in that document. It appears, previously (Notebook v 6.x), it would only auto-collapse once per execution, but now it does it repeatedly.

(I have been directed here from the JupyterLab repo, where I reported the same issue: https://github.com/jupyterlab/jupyterlab/issues/11760 )

## Reproduce

1. Execute a cell containing long-running code that continuously produces output, such as the following:
```python
import time

for k in range(10):
print("\n".join(f"- {k}.{v}" for v in range(100 if not k else 20)))
time.sleep(5)
```
2. Try keep the output area expanded and follow the output at it generates. It will constantly collapse away under your nose. If there is a lot of cells/output following the currently executing cell, you'll have a hard time getting back to that output.

## Expected behavior

The output area should stay uncollapsed while I'm following the output.

## Context

- Operating System and version: macOS 13.4
- Browser and version: Chome Version 115.0.5790.114 (Official Build) (arm64)
- Jupyter Notebook version: 7.0.2

## Screencast
Both examples show the same notebook executed in two different versions of jupyter notebook.
I have added one cell above and below each containing dummy output (`(pre-fill)` and `(post-fill)`) to highlight the user experience if that happens in the middle of a long notebook.

### Version 7.0.2
https://github.com/jupyter/notebook/assets/1310437/c1efb6d1-bff0-4991-b353-bad2a1bda4f5
### Version 6.5.5
https://github.com/jupyter/notebook/assets/1310437/9ea55510-e027-4681-aa38-d492b854c3db

Contributor guide

Open the contributing guide

Research direction

Reproduce the problem with the supplied long-running Python cell in Jupyter Notebook 7.0.2, comparing the behavior shown for version 6.5.5. Done means an output area that the user expands stays expanded while that execution continues, rather than repeatedly collapsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.