Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data menu broken in Imviz extra viewer on Lab #2581

Closed
pllim opened this issue Nov 28, 2023 · 3 comments · Fixed by #2670
Closed

Data menu broken in Imviz extra viewer on Lab #2581

pllim opened this issue Nov 28, 2023 · 3 comments · Fixed by #2670
Labels
bug Something isn't working embed Regarding issues with front-end embedding imviz Upstream fix required

Comments

@pllim
Copy link
Contributor

pllim commented Nov 28, 2023

I see this on main currently so it was not caused by whatever the rotation PR is doing. Only see it on Lab. Works fine on Notebook in the same env. Using WSL2 (Debian/Ubuntu) on Windows 10/11, with Chrome browser (but @kecnry could reproduce it in OSX). cc @mariobuikhuizen

Workflow to reproduce:

  1. Run Imviz example notebook and load both images.
  2. Go to the cell that says imviz.show() but do not run it yet. Right click on it and select "Create New View for Cell Output".
  3. Now run imviz.show().
  4. Use the "popped out" version of the Imviz viewer.
  5. Make a new viewer. Load either image A or B. See that Data menu in imviz-1 misbehaves.
  6. See screenshots. The screenshots also have markers loaded but you don't need those to reproduce the bug.
Screenshot 2024-01-17 112025

imviz-0 is okay:

Screenshot 2023-11-28 145235

but imviz-1 is broken in Lab but not Notebook:

Screenshot 2023-11-28 145326

🐱

@pllim pllim added bug Something isn't working imviz labels Nov 28, 2023
@pllim pllim added the embed Regarding issues with front-end embedding label Jan 17, 2024
@pllim
Copy link
Contributor Author

pllim commented Jan 18, 2024

Mario found a workaround and I confirmed that doing this before starting the notebook/lab server fixes my use case:

export JUPYTER_WIDGETS_ECHO=False

❗ The catch: ipypopout is disabled when this is used.

Mario's comments as follows.


I’ve narrowed the issue down to having 2 views in the notebook (which is the case with using sidecar in lab, but can also be achieved with have two cells with imviz.show()) and the echo-comm-message functionality (introduced for ipypopout).

I can also reproduce it in classic notebook with two cells with imviz.show().

Running Lab with it disabled, fixes the issue: JUPYTER_WIDGETS_ECHO=False jupyter lab

(but then ipypopout won’t work)

I think it should be fixed in ipywidgets. Turning it off validated my theory.

@mariobuikhuizen
Copy link
Collaborator

After looking further into it, the echo issue is not the only problem.

Having two views with a <v-menu :close-on-content-click="false" ...> (line), makes them close anyway when content is clicked, because for one of the menu's this is a "click outside", which closes the menu and updates the the shared model. This also causes an update of the app.state in the kernel.
This happens after the method data_item_visibility (line) is called, so the state change that happened with that is overwritten with the old state.

@mariobuikhuizen
Copy link
Collaborator

mariobuikhuizen commented Jan 23, 2024

A fix would be to use :close-on-click="false" on the menu. This way the menu won't close when there are two views (but the menu only closes when clicking the menu button again).

This works also without a fix for the potential echo-issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working embed Regarding issues with front-end embedding imviz Upstream fix required
Projects
None yet
2 participants