Skip to content

Make extending the schematic by clicking pins discoverable and reliable - #10

Merged
xtofalex merged 1 commit into
mainfrom
pin-extension
Sep 28, 2026
Merged

xtofalex merged 1 commit into
mainfrom
pin-extension

Conversation

@xtofalex

Copy link
Copy Markdown
Member

Extending the view from an instance's pins was hard to discover and to use:

  • no hover feedback, and on a partial-interface box every visible pin's net was already shown, so double-clicking one did nothing useful;
  • the hit test took the first pin within 18px instead of the nearest, so zoomed out a click often landed on the neighbouring pin;
  • re-requesting a shown net (or a trace re-listing it) added it twice, and the duplicate wires were then drawn as a fake bus;
  • with hierarchy frames on, each added net re-laid out the drawing and the box the user was working on jumped away.

Changes:

  • Pins whose net isn't in the view are "open" (hollow-circle stub). A single click adds their net, and the stub fills while it loads. A click on a merged bus pin shows its bits. Box-body double-click still reveals the full interface, and after a short rest a tooltip says so.
  • Hovering a pin highlights it, shows a hand cursor when clicking does something, and shows a tooltip naming the action.
  • Nearest-pin hit testing (SchematicInteraction::pickPin), with the radius capped in world units so pins don't swallow box-body clicks at low zoom.
  • In-flight pin requests are tracked (PendingRequests, 5 s expiry), and only the first press of a double-click acts.
  • When the net arrives, the view pans so the clicked box stays put on screen.
  • GUIData::addEquipotential() skips nets whose endpoints are all shown, and identical wires are only drawn as a bus between real bus pins.

Tests: SchematicInteractionTest (hit testing, pending requests), GUIDataTest (net dedupe), and EquipotentialViewTest, which drives the real renderSchematic() in a headless ImGui context with simulated mouse input.

Extending the view from an instance's pins was hard to discover and to use:
- no hover feedback, and on a partial-interface box every visible pin's net
  was already shown, so double-clicking one did nothing useful;
- the hit test took the first pin within 18px instead of the nearest, so
  zoomed out a click often landed on the neighbouring pin;
- re-requesting a shown net (or a trace re-listing it) added it twice, and
  the duplicate wires were then drawn as a fake bus;
- with hierarchy frames on, each added net re-laid out the drawing and the
  box the user was working on jumped away.

Changes:
- Pins whose net isn't in the view are "open" (hollow-circle stub). A single
  click adds their net, and the stub fills while it loads. A click on a
  merged bus pin shows its bits. Box-body double-click still reveals the
  full interface, and after a short rest a tooltip says so.
- Hovering a pin highlights it, shows a hand cursor when clicking does
  something, and shows a tooltip naming the action.
- Nearest-pin hit testing (SchematicInteraction::pickPin), with the radius
  capped in world units so pins don't swallow box-body clicks at low zoom.
- In-flight pin requests are tracked (PendingRequests, 5 s expiry), and only
  the first press of a double-click acts.
- When the net arrives, the view pans so the clicked box stays put on screen.
- GUIData::addEquipotential() skips nets whose endpoints are all shown, and
  identical wires are only drawn as a bus between real bus pins.

Tests: SchematicInteractionTest (hit testing, pending requests),
GUIDataTest (net dedupe), and EquipotentialViewTest, which drives the real
renderSchematic() in a headless ImGui context with simulated mouse input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xtofalex
xtofalex merged commit 73d423e into main Sep 28, 2026
14 checks passed
@xtofalex
xtofalex deleted the pin-extension branch September 28, 2026 08:37
xtofalex added a commit that referenced this pull request Sep 29, 2026
Make extending the schematic by clicking pins discoverable and reliable
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