Skip to content

Fix Output capture from background threads#4021

Open
MUFFANUJ wants to merge 5 commits into
jupyter-widgets:mainfrom
MUFFANUJ:outputCapture
Open

Fix Output capture from background threads#4021
MUFFANUJ wants to merge 5 commits into
jupyter-widgets:mainfrom
MUFFANUJ:outputCapture

Conversation

@MUFFANUJ

@MUFFANUJ MUFFANUJ commented Jun 8, 2026

Copy link
Copy Markdown

Fixes #4020

Set the current IPython parent when entering an Output context so output generated in background threads is routed to the widget with ipykernel 7.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch MUFFANUJ/ipywidgets/outputCapture

Comment thread python/ipywidgets/ipywidgets/widgets/widget_output.py Outdated
@krassowski

Copy link
Copy Markdown
Contributor

@MUFFANUJ maybe you could also add an end-to-end playwright test demonstrating that the capture from background threads works as intended?

@Carreau

Carreau commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

re-approved workflows.

@krassowski krassowski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks

Comment thread ui-tests/tests/widgets.test.ts
Comment thread ui-tests/tests/notebooks/output-background-thread.ipynb
@Carreau

Carreau commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Approved runner again.

@krassowski krassowski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@krassowski

Copy link
Copy Markdown
Contributor

@MUFFANUJ it looks like the test failed?

@martinRenou

Copy link
Copy Markdown
Member

The CI failure may be related to the new jupyterlab release. Can you try pinning jupyterlab in the ui-tests for now here https://github.com/jupyter-widgets/ipywidgets/blob/main/.github/workflows/tests.yml#L147?

jupyterlab==4.5.8

@krassowski

krassowski commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Oh, right it is related. The giveaway is waiting for getByRole('switch', { name: 'Simple' }) because simple mode was removed from status bar (jupyterlab/jupyterlab#18757)

@krassowski

Copy link
Copy Markdown
Contributor

What do you think @martinRenou?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outputs sometimes dropped from Output widget when updated in subthreads

4 participants