Fix right-click in notebook viewers; hint on empty schematic (0.1.1) - #8
Merged
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 carriesdata-jp-suppress-context-menu(JupyterLab skips its menu inside it), and the canvas stopscontextmenupropagation 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_schematicversion → 0.1.1, to release with thev0.1.1tag once merged.Verified
In local JupyterLab 4.6 with the rebuilt bundle: hint shows on the empty schematic; right-click
qopens the viewer's menu (JupyterLab's no longer appears); Show Equipotential drawsr→qand fills the table. A dispatchedcontextmenuevent confirms the JupyterLab menu opened before the fix and not after.Not yet verified in Colab.
🤖 Generated with Claude Code