Skip to content

use C_Small/R_Small#720

Draft
LK wants to merge 1 commit into
mainfrom
lenny/small
Draft

use C_Small/R_Small#720
LK wants to merge 1 commit into
mainfrom
lenny/small

Conversation

@LK

@LK LK commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Symbol-only change for passives and import placement; netlist hashes shift but connectivity is unchanged.

Overview
Stdlib generic Resistor and Capacitor now use KiCad R_Small and C_Small instead of R / C, which changes schematic appearance and netlist output (release snapshots updated).

KiCad import promotion and # pcb:sch placement math now target Device:R_Small / Device:C_Small for bbox and axis compensation; related unit tests were adjusted accordingly.

Test sandbox: low-level run_git disables global/system git config and interactive credential prompts so fixture git stays hermetic in CI.

IPC-2581 HTML export: template/CSS include_str! constants were moved above the test module (no behavior change).

Reviewed by Cursor Bugbot for commit a5d54e6. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: US resistor symbol not updated to small variant
    • Updated stdlib/generics/Resistor.zen so the use_us_symbol branch now selects R_Small_US instead of R_US for symbol-size consistency.
  • ✅ Fixed: Test fixtures reference stale Device:R target symbol key
    • Updated the resistor promotion fixtures in crates/pcb/src/import/generate.rs to use Device:R_Small/R_Small_0_1 so geometry lookup matches the new promoted target lib id.

Create PR

Or push these changes by commenting:

@cursor push e8ce129b05
Preview (e8ce129b05)
diff --git a/crates/pcb/src/import/generate.rs b/crates/pcb/src/import/generate.rs
--- a/crates/pcb/src/import/generate.rs
+++ b/crates/pcb/src/import/generate.rs
@@ -2861,9 +2861,9 @@
                 .to_string(),
             ),
             (
-                KiCadLibId::from("Device:R".to_string()),
-                r#"(symbol "Device:R"
-  (symbol "R_0_1"
+                KiCadLibId::from("Device:R_Small".to_string()),
+                r#"(symbol "Device:R_Small"
+  (symbol "R_Small_0_1"
     (rectangle (start -1 -2) (end 3 4))
   )
 )"#
@@ -2933,9 +2933,9 @@
                 .to_string(),
             ),
             (
-                KiCadLibId::from("Device:R".to_string()),
-                r#"(symbol "Device:R"
-  (symbol "R_0_1"
+                KiCadLibId::from("Device:R_Small".to_string()),
+                r#"(symbol "Device:R_Small"
+  (symbol "R_Small_0_1"
     (rectangle (start -1 -2) (end 3 4))
   )
 )"#
@@ -2974,9 +2974,9 @@
                 .to_string(),
             ),
             (
-                KiCadLibId::from("Device:R".to_string()),
-                r#"(symbol "Device:R"
-  (symbol "R_0_1"
+                KiCadLibId::from("Device:R_Small".to_string()),
+                r#"(symbol "Device:R_Small"
+  (symbol "R_Small_0_1"
     (rectangle (start -1 -2) (end 3 4))
   )
 )"#

diff --git a/stdlib/generics/Resistor.zen b/stdlib/generics/Resistor.zen
--- a/stdlib/generics/Resistor.zen
+++ b/stdlib/generics/Resistor.zen
@@ -43,7 +43,7 @@
 
 def _symbol(mount: Mount, package: Package, use_us_symbol: bool):
     if use_us_symbol:
-        name = "R_US"
+        name = "R_Small_US"
     else:
         name = "R_Small"

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit d037922. Configure here.

@@ -45,7 +45,7 @@ def _symbol(mount: Mount, package: Package, use_us_symbol: bool):
if use_us_symbol:
name = "R_US"
else:
name = "R"
name = "R_Small"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

US resistor symbol not updated to small variant

Medium Severity

The use_us_symbol branch still uses "R_US" instead of the small variant "R_Small_US" (which exists in KiCad's Device library). The non-US path was updated from "R" to "R_Small", but the US path was missed. This means users with use_us_symbol=True get a full-size symbol while everyone else gets a small one, creating an inconsistency.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d037922. Configure here.

Comment thread crates/pcbc/src/import/generate/schematic_types.rs
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