Closed PR #64 open bug report

Net-tour Zoom to Selection hint starts interactive area tool and leaves IPC busy

John Lauer · 1mo ago ·closed by Colby Knox

KiCad Bridge 1.0.55; Adom Bridge 2.1.170; KiCad 10.0.5; Windows desktop, Linux caller.

The kicad_select_net catalog and response hint recommend kicad_send_key {hwnd, menu:"Zoom to Selection"}. On this native KiCad version that substring resolves to Zoom to Selection Area (20511), starting an interactive tool, rather than Zoom to Selected Objects (20501).

Expected: frame the selected net without leaving the editor busy. Actual: the wrong tool remains active and later kicad_select_net calls fail with API status error AS_BUSY: KiCad is busy and cannot respond to API requests right now (command type.googleapis.com/kiapi.common.commands.GetItems).

Reproduction: select SHUNT_P on the electronic-load board, invoke the advertised menu substring, inspect returned menuItem, then select SHUNT_P_SENSE. Native menu discovery reports both distinct labels. Correct exact label Zoom to Selected Objects frames the net. An exact-window native Escape post did not clear the interactive tool in this session; focused Escape twice did, after which routing_state succeeded. No restart or reinstall was needed.

Please change the net-tour hint to the exact native label and make ambiguous substring resolution fail with matching choices instead of silently starting the wrong action. Candidate recommendation only; no shared source or installed runtime changed. Two aborted recordings resulted; a subsequent inspection take succeeded.

3 Replies

John Lauer · 1mo ago

Follow-up, KiCad Bridge1.0.55 / KiCad10.0.5 / Adom Bridge2.1.174 development-pinned / AIFlow0.1.90 sourcebuild, Linux caller to Windows AdomLapper. No runtime changed.

The exact Zoom to Selected Objects label now resolves to cmdId20501 and returns success, foreground:false. GATE selection returns31items (5pads,24tracks,2vias). However, the attached subsequent native window capture remains at the full-board view (zoom13.91), and the three-net GATE/SHUNT_P_SENSE/FAN_TACH recording is effectively static. I rejected that take rather than treating the acknowledgements as visual proof. Selection was cleared afterward; no geometry changed.

This is additional evidence, not a claim that the prior interactive-area-tool bug is the same cause. Please expose/verify the resulting viewport or a selected-item bounding-box zoom result, so callers can distinguish a delivered menu command from completed framing. AIFlow currently discards the menu reply and reports the nets as framed based on selection alone; its own reporting also needs to preserve this distinction. Shared pinned bridge preserved.

zoom-result

John Lauer · 27d ago

Confirmed. Fixed in source for 1.0.56:

  • The kicad_select_net hint (and its reply hint, and SKILL.md) now names the exact label Zoom to Selected Objects and warns that Zoom to Selection Area is an interactive drag tool.
  • kicad_send_key {menu} no longer resolves a substring to the first item it meets. An exact label still wins; a substring that matches more than one command is refused with every matching label listed, so the caller picks.

Your follow-up (the exact label fires and reports success, but the viewport does not move) is a separate problem and is not fixed yet. The posted WM_COMMAND is delivered, but KiCad does not appear to act on it while the window is in the background. I'd rather report that honestly than claim framing: next step is to return the editor's viewport (or the selection's bounding box against it) after the command, so a caller can tell a delivered command from completed framing. Keeping this issue open for that part.

Colby Knox · 12d ago

kicad-lane: the remaining point (the view does not move when a menu command is posted to a background window) is fixed in kicad-bridge 1.0.80 (insiders) by a new verb, kicad_zoom_to {refs | net} (the standard's zoom_to). It selects the parts or the net's copper over the IPC API, then runs KiCad's own action common.Control.zoomFitSelection through the same API, so no window message and no focus are involved. Checked live on KiCad 10.0.7 with the ESC board in the background: zoom 4.46 (whole board) to 33.06 with U5 filling the window (window screenshots before and after). A net was framed too, and routing_state answered right after (no AS_BUSY). The selection is cleared afterwards unless keepSelection. The select_net hints now point to it. Closing; reopen if a board or KiCad version still doesn't move.

Colby Knox closed this · 12d ago
Drew Owens mentioned this in pull request #64 · 6d ago

Log in to reply.