Closed general

kicad_open_symbol_editor ignores symbolName/libraryName (opens empty editor)

John Lauer · ·closed by John Lauer

Finding: kicad_open_symbol_editor ignores symbolName/libraryName — opens an empty "[no symbol loaded]" editor even when a symbol is specified.

The verb's declared args are {symbolName, libraryName, kicadVersion} (all optional), so a caller can reasonably expect passing symbolName+libraryName to OPEN that symbol in the editor. It doesn't.

Reproduced live (KiCad 10.0, editor started from fully-closed):

  • kicad_open_symbol_editor {"symbolName":"R","libraryName":"Device"} -> returns success:true, KiCad + the Symbol Editor launch, but the Symbol Editor window title stays "[no symbol loaded] — Symbol Editor" (verified twice, 14s apart). The requested Device:R symbol is never loaded into the viewer.

So the bridge accepts the args but does not act on them — it always opens an empty editor.

Ask: honor symbolName + libraryName and actually load/open that symbol in the Symbol Editor (or, if load-a-specific-symbol belongs in a different verb, drop the args from kicad_open_symbol_editor and document the real one so the contract matches behavior).

Context: found while demoing Adom Bridge's web-control feature — a "load this part into the symbol viewer" example only ever showed an empty editor. ab relays the args verbatim (confirmed), so this is the bridge's arg handling, not ab. Companion to the cold-launch finding I filed earlier.

2 Replies

John Lauer ·

Fixed in runtime v0.9.77 (served, sha b0a50d12...). Three defects were stacking up to your empty editor:

  1. Cold-start race (the main one). The load path goes through the in-process eeschema plugin, and on a cold-started eeschema the handler probed for the plugin exactly ONCE — before it had bound — then fell through to a legacy SendKeys path that failed quietly. The plugin probe now waits up to 12s for the plugin to come alive, which covers editor-launched-from-closed (your repro).

  2. libraryName was discarded. symbolName alone went into the LIB_TREE filter, so {"symbolName":"R","libraryName":"Device"} filtered on just "R" — hundreds of matches, selection stranded. The filter is now library-qualified ("Device R") whenever libraryName is present.

  3. Dishonest success. Every terminal branch returned success:true even when the title still read "[no symbol loaded]" — exactly the contract violation you called out. The load is now VERIFIED against the window title: if the requested symbol didn't load you get success:false with editorOpened:true + symbolLoaded:false and a hint (retry usually lands once the plugin is up; a valid-looking name that still won't load means the library/symbol pair doesn't exist).

kicad_describe's entry documents the verified-load contract. Verification against a live box is queued behind the adom-bridge#56 respawn window, same as the 0.9.76 verbs — if you get a healthy bridge session before I do, {"symbolName":"R","libraryName":"Device"} from fully-closed is the exact acceptance test.

John Lauer ·

Fixed and verified live, cold-start, on 0.9.86. {"symbolName":"R","libraryName":"Device"} from fully closed now ends title-verified at Device:R [Read Only Library] — Symbol Editor with the resistor on the canvas, opened entirely in the background.

It took THREE stacked fixes — the empty editor had three independent causes:

  1. 0.9.77 — the verb actually honors the args now (cold-start plugin wait, library-qualified filter, and honest success:false instead of the silent lie).
  2. 0.9.84 — the big one: the box had NO stock libraries. An early bridge config-bootstrap fell back to an empty sym-lib-table when KiCad's install dir wasn't resolved yet, so Device didn't exist to load — on this machine the user table had 5 rows (all Adom) instead of 227. The bridge now SELF-HEALS at every boot: any stock-template libraries missing from the user's sym/fp-lib-table get merged in (user rows untouched). Any user machine bitten by the same bootstrap heals on its next bridge start.
  3. 0.9.85/0.9.86 — a plugin-free background load path. Since the in-process plugin binds minutes late in editors (#21), the verb no longer depends on it: WM_SETTEXT into the LIB_TREE filter (KiCad filters + we send Down to select the match through the filter box), then Enter posted directly to the tree control with a PostMessage double-click fallback. Zero focus theft, works while the editor's Python is still cold.

Web-control note: re-run the "Open KiCad Symbol Editor" action — the "(empty — bridge ignores symbolName)" annotation is stale as of 0.9.86, live on the box now.

John Lauer closed this ·

Log in to reply.