Skip to content

fix(schSize): parse named tokens before distance - #834

Open
Flame119052 wants to merge 2 commits into
tscircuit:mainfrom
Flame119052:cursor/schsize-named-tokens-73fd
Open

fix(schSize): parse named tokens before distance#834
Flame119052 wants to merge 2 commits into
tscircuit:mainfrom
Flame119052:cursor/schsize-named-tokens-73fd

Conversation

@Flame119052

Copy link
Copy Markdown

Summary

schematicSymbolSize tried distance first. circuit-json distance accepts unknown strings as NaN, so "xs", "sm", "small", and "md" never reached the enum.

Named sizes are now parsed first. "small" and "normal" are accepted aliases. Numeric distances such as "0.5mm" still parse to millimeters.

This is the props-side contract for tscircuit/core#3108. Runtime compact-symbol selection still lives in core (companion PR).

Test plan

  • bun test tests/schematic-size.test.ts tests/capacitor.test.ts tests/resistor.test.ts
  • bunx tsc --noEmit

distance currently swallows xs/sm/small as NaN before the enum is tried.
circuit-json distance accepts unknown strings as NaN, so the enum never
ran. Put the named sizes first so xs/sm/small/md stay tokens.
@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants