From 68fd4509b9ebbf8fe0d5fd80df569d63114c2de1 Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 6 Mar 2026 09:59:54 +0100 Subject: [PATCH] chore: update changelog and schematic template --- CHANGELOG.md | 15 ++ .../template_with_symbols_expanded.kicad_sch | 242 ------------------ 2 files changed, 15 insertions(+), 242 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ddfc60..17ca4ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,21 @@ All notable changes to the KiCAD MCP Server project are documented here. **Action required for existing projects:** delete every line beginning with `;;` from any `.kicad_sch` file created between upstream commit `b98c94b` and this fix. +- `add_schematic_component` / `inject_symbol_into_schematic`: symbol definition in + `lib_symbols` was never refreshed after editing via `create_symbol` / `edit_symbol`. + If the symbol was already present in the schematic's embedded `lib_symbols` section, + the function returned immediately — `delete + re-add` still pulled in the stale cached + definition. Fix: always read the current definition from the `.kicad_sym` file; if a + stale entry exists in `lib_symbols`, remove it first, then inject the fresh one. + Verified live. ✅ + +- `template_with_symbols_expanded.kicad_sch`: removed 13 legacy `_TEMPLATE_*` offscreen + instances (`_TEMPLATE_R`, `_TEMPLATE_C`, `_TEMPLATE_U`, etc.) that were placed at + `x=-100` as clone-sources for the old `ComponentManager` approach. `DynamicSymbolLoader` + (the current implementation) injects symbols directly and never needs these placeholders. + They appeared as dangling reference designators in KiCAD's component navigator and in + the schematic canvas when zoomed far out. + ### Maintenance - `.gitignore`: added `*.kicad_pcb.bak`, `*.kicad_pro.bak` alongside existing `-bak` variants; diff --git a/python/templates/template_with_symbols_expanded.kicad_sch b/python/templates/template_with_symbols_expanded.kicad_sch index 157e346..d2a7403 100644 --- a/python/templates/template_with_symbols_expanded.kicad_sch +++ b/python/templates/template_with_symbols_expanded.kicad_sch @@ -715,260 +715,18 @@ ) ) - (symbol (lib_id "Device:R") (at -100 -100 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000001) - (property "Reference" "_TEMPLATE_R" (at -100 -102.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "R" (at -100 -100 90) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -100 90) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -100 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 10000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 10000000-0000-0000-0000-000000000002)) - ) - (symbol (lib_id "Device:C") (at -100 -110 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000002) - (property "Reference" "_TEMPLATE_C" (at -100 -107.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "C" (at -100 -112.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -110 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -110 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 20000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 20000000-0000-0000-0000-000000000002)) - ) - (symbol (lib_id "Device:L") (at -100 -120 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000003) - (property "Reference" "_TEMPLATE_L" (at -100 -117.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "L" (at -100 -122.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -120 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -120 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 30000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 30000000-0000-0000-0000-000000000002)) - ) - (symbol (lib_id "Device:Crystal") (at -100 -130 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000004) - (property "Reference" "_TEMPLATE_Y" (at -100 -127.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "Crystal" (at -100 -132.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -130 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -130 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 40000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 40000000-0000-0000-0000-000000000002)) - ) - (symbol (lib_id "Device:D") (at -100 -140 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000005) - (property "Reference" "_TEMPLATE_D" (at -100 -137.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "D" (at -100 -142.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -140 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -140 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 50000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 50000000-0000-0000-0000-000000000002)) - ) - (symbol (lib_id "Device:LED") (at -100 -150 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000006) - (property "Reference" "_TEMPLATE_LED" (at -100 -147.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "LED" (at -100 -152.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -150 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -150 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 60000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 60000000-0000-0000-0000-000000000002)) - ) - (symbol (lib_id "Device:Q_NPN_BCE") (at -100 -160 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000007) - (property "Reference" "_TEMPLATE_Q_NPN" (at -100 -157.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "Q_NPN" (at -100 -162.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -160 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -160 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 70000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 70000000-0000-0000-0000-000000000002)) - (pin "3" (uuid 70000000-0000-0000-0000-000000000003)) - ) - (symbol (lib_id "Device:Q_NMOS_GSD") (at -100 -170 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000008) - (property "Reference" "_TEMPLATE_Q_NMOS" (at -100 -167.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "Q_NMOS" (at -100 -172.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -170 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -170 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 80000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 80000000-0000-0000-0000-000000000002)) - (pin "3" (uuid 80000000-0000-0000-0000-000000000003)) - ) - (symbol (lib_id "Amplifier_Operational:LM358") (at -100 -180 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-000000000009) - (property "Reference" "_TEMPLATE_U_OPAMP" (at -100 -177.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "OpAmp" (at -100 -182.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -180 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "" (at -100 -180 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid 90000000-0000-0000-0000-000000000001)) - (pin "2" (uuid 90000000-0000-0000-0000-000000000002)) - (pin "3" (uuid 90000000-0000-0000-0000-000000000003)) - (pin "4" (uuid 90000000-0000-0000-0000-000000000004)) - (pin "8" (uuid 90000000-0000-0000-0000-000000000005)) - ) - (symbol (lib_id "Connector_Generic:Conn_01x02") (at -100 -190 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-00000000000A) - (property "Reference" "_TEMPLATE_J2" (at -100 -187.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "Conn_2" (at -100 -192.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -190 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -190 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid A0000000-0000-0000-0000-000000000001)) - (pin "2" (uuid A0000000-0000-0000-0000-000000000002)) - ) - (symbol (lib_id "Connector_Generic:Conn_01x04") (at -100 -200 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-00000000000B) - (property "Reference" "_TEMPLATE_J4" (at -100 -197.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "Conn_4" (at -100 -202.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -200 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -200 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid B0000000-0000-0000-0000-000000000001)) - (pin "2" (uuid B0000000-0000-0000-0000-000000000002)) - (pin "3" (uuid B0000000-0000-0000-0000-000000000003)) - (pin "4" (uuid B0000000-0000-0000-0000-000000000004)) - ) - (symbol (lib_id "Regulator_Linear:AMS1117-3.3") (at -100 -210 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-00000000000C) - (property "Reference" "_TEMPLATE_U_REG" (at -100 -207.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "Regulator" (at -100 -212.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -210 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "" (at -100 -210 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid C0000000-0000-0000-0000-000000000001)) - (pin "2" (uuid C0000000-0000-0000-0000-000000000002)) - (pin "3" (uuid C0000000-0000-0000-0000-000000000003)) - ) - (symbol (lib_id "Switch:SW_Push") (at -100 -220 0) (unit 1) - (in_bom no) (on_board no) (dnp yes) - (uuid 00000000-0000-0000-0000-00000000000D) - (property "Reference" "_TEMPLATE_SW" (at -100 -217.46 0) - (effects (font (size 1.27 1.27))) - ) - (property "Value" "Switch" (at -100 -222.54 0) - (effects (font (size 1.27 1.27))) - ) - (property "Footprint" "" (at -100 -220 0) - (effects (font (size 1.27 1.27)) hide) - ) - (property "Datasheet" "~" (at -100 -220 0) - (effects (font (size 1.27 1.27)) hide) - ) - (pin "1" (uuid D0000000-0000-0000-0000-000000000001)) - (pin "2" (uuid D0000000-0000-0000-0000-000000000002)) - ) (sheet_instances (path "/" (page "1"))