Skip to content

Fix right-click in notebook viewers; hint on empty schematic (0.1.1) - #8

Merged
xtofalex merged 1 commit into
mainfrom
fix-widget-context-menu
Sep 26, 2026
Merged

xtofalex merged 1 commit into
mainfrom
fix-widget-context-menu

Conversation

@xtofalex

Copy link
Copy Markdown
Member

Problem

In notebooks, the schematic stayed empty: right-clicking a pin in the viewer opened JupyterLab's own cell menu (Cut Cell, Copy Cell, ...) on top of the viewer's menu, so Show Equipotential / Trace to Driver — the only way to populate the schematic — were unreachable. Nothing on the empty canvas said how to fill it either.

Changes

  • python/naja_schematic/static/widget.js: the viewer container carries data-jp-suppress-context-menu (JupyterLab skips its menu inside it), and the canvas stops contextmenu propagation for other notebook hosts.
  • src/EquipotentialView.cpp: while no net is shown, the schematic displays a hint: Right-click a pin in the Netlist Hierarchy … and choose Show Equipotential or Trace to Driver. (all builds).
  • naja_schematic version → 0.1.1, to release with the v0.1.1 tag once merged.

Verified

In local JupyterLab 4.6 with the rebuilt bundle: hint shows on the empty schematic; right-click q opens the viewer's menu (JupyterLab's no longer appears); Show Equipotential draws r → q and fills the table. A dispatched contextmenu event confirms the JupyterLab menu opened before the fix and not after.

Not yet verified in Colab.

🤖 Generated with Claude Code

- widget.js: mark the viewer with data-jp-suppress-context-menu and stop
  contextmenu propagation, so JupyterLab (and other notebook hosts) no
  longer open their own cell menu over the viewer's -- which made Show
  Equipotential / Trace to Driver unreachable in notebooks.
- EquipotentialView: show how to populate the schematic while it is empty
  (right-click a pin > Show Equipotential / Trace to Driver).
- Bump naja_schematic to 0.1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xtofalex
xtofalex merged commit 986ea69 into main Sep 26, 2026
14 checks passed
@xtofalex
xtofalex deleted the fix-widget-context-menu branch September 26, 2026 14:56
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.

1 participant