Skip to content

Exchange hierarchical instances between najaeda and the viewer - #11

Merged
xtofalex merged 1 commit into
mainfrom
instance-focus
Sep 28, 2026
Merged

xtofalex merged 1 commit into
mainfrom
instance-focus

Conversation

@xtofalex

Copy link
Copy Markdown
Member

najaeda -> viewer: Schematic.show_instance(inst | "u1/u2" | [names]) (and show(instance=...)) pushes focus_instance. The viewer resolves the path with a new resolve_instance request, implemented by both providers (protocol.py and LocalSNLProvider), and then:

  • reveals the instance in the tree, loading each level's Instances/ Primitives group on demand (NetlistTree::reveal/advanceReveal);
  • selects it and shows its properties;
  • clears the schematic and draws the instance alone with every pin open, ready to be extended pin by pin (EquipotentialView::showInstance).

viewer -> najaeda: the viewer now has one selected instance (SelectionStore). Clicking an instance row in the tree or a box/frame body in the schematic selects it, and both views draw it highlighted; a selection made in the schematic or by the host is revealed in the tree. Each change sends an instance_selected notification. The widget exposes it as Schematic.selected (a najaeda netlist.Instance) and through on_select().

Also: an instance's pins now carry the instance's own id path (MInst.pathIds) instead of copying the first shown pin's, so a box with no shown net yet still addresses its pins correctly.

Tests: SelectionTest (store, tree reveal driven by the load requests it sends, reveal-on-render), EquipotentialViewTest (start instance drawn with open pins, its pin requests, box-click selection), and Python protocol and widget tests for resolve_instance, focus_instance, show_instance, selected and on_select.

najaeda -> viewer: Schematic.show_instance(inst | "u1/u2" | [names]) (and
show(instance=...)) pushes focus_instance. The viewer resolves the path
with a new resolve_instance request, implemented by both providers
(protocol.py and LocalSNLProvider), and then:
- reveals the instance in the tree, loading each level's Instances/
  Primitives group on demand (NetlistTree::reveal/advanceReveal);
- selects it and shows its properties;
- clears the schematic and draws the instance alone with every pin open,
  ready to be extended pin by pin (EquipotentialView::showInstance).

viewer -> najaeda: the viewer now has one selected instance (SelectionStore).
Clicking an instance row in the tree or a box/frame body in the schematic
selects it, and both views draw it highlighted; a selection made in the
schematic or by the host is revealed in the tree. Each change sends an
instance_selected notification. The widget exposes it as
Schematic.selected (a najaeda netlist.Instance) and through on_select().

Also: an instance's pins now carry the instance's own id path (MInst.pathIds)
instead of copying the first shown pin's, so a box with no shown net yet
still addresses its pins correctly.

Tests: SelectionTest (store, tree reveal driven by the load requests it
sends, reveal-on-render), EquipotentialViewTest (start instance drawn with
open pins, its pin requests, box-click selection), and Python protocol and
widget tests for resolve_instance, focus_instance, show_instance,
selected and on_select.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xtofalex
xtofalex merged commit 1433135 into main Sep 28, 2026
14 checks passed
@xtofalex
xtofalex deleted the instance-focus branch September 28, 2026 08:56
xtofalex added a commit that referenced this pull request Sep 29, 2026
Exchange hierarchical instances between najaeda and the viewer
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