Description
When using IPyWidgets (specifically tqdm.notebook) in a Jupyter notebook, refreshing the browser page while a progress bar is running causes the widget to display only "Loading widget..." instead of the proper progress bar. The widget only renders correctly after the operation completes.

Reproduce
- Install the required packages:
pip install jupyter_server_nbmodel[lab] tqdm ipywidgets
- Start JupyterLab and create a new notebook
- Execute the following code in a cell:
from tqdm.notebook import tqdm
import time
for i in tqdm(range(100)):
time.sleep(0.5) # Simulate long-running process
- While the progress bar is still running, reload the browser page
- Observe that the progress widget shows "Loading widget..." text instead of the actual progress bar
Expected behavior
After reloading the page, the IPyWidget should maintain its state and continue displaying the proper progress bar without showing "Loading widget..." text.
Description
When using IPyWidgets (specifically tqdm.notebook) in a Jupyter notebook, refreshing the browser page while a progress bar is running causes the widget to display only "Loading widget..." instead of the proper progress bar. The widget only renders correctly after the operation completes.
Reproduce
Expected behavior
After reloading the page, the IPyWidget should maintain its state and continue displaying the proper progress bar without showing "Loading widget..." text.