Skip to content

fix: preserve source pin labels in custom symbols - #557

Open
techmannih wants to merge 5 commits into
tscircuit:mainfrom
techmannih:fix/c20526-pin-label-overlap
Open

fix: preserve source pin labels in custom symbols#557
techmannih wants to merge 5 commits into
tscircuit:mainfrom
techmannih:fix/c20526-pin-label-overlap

Conversation

@techmannih

@techmannih techmannih commented Sep 9, 2026

Copy link
Copy Markdown
Member

Custom symbols were using automatically positioned pin names instead of EasyEDA's source label metadata. For C20526, that introduced overlapping B/C/E labels even though those names are hidden in the source.

Import pin-name text, visibility, position, rotation, alignment, color, and font size without overlap detection, symbol-size limits, or mixed-direction conditions. Omitted pin-label font sizes use EasyEDA's documented 7pt default. Preserve normalized electrical aliases separately, and retain automatic stems for older inputs without usable label metadata.

The explicit <schematicpath> elements preserve the original EasyEDA pin lines and their source colors, including shorthand values such as #800. A nonzero schStemLength also generates an automatic label in circuit-to-svg, so the electrical port uses schStemLength={0} while its source path supplies the visible line. Any existing requested port alignment also moves the source path and label together.

Updates affected TSX and schematic snapshots. Regression coverage includes hidden and visible source labels, uncapped sizes, source colors and text, numeric names, large symbols with horizontal pins, missing or malformed metadata, electrical pin positions, and aligned capacitor-array stems.

Validation:

  • 65 focused parser, symbol-generation, and conversion tests passed, including 15 snapshots.
  • TypeScript type-check, build, and format-check passed.
  • Inspected rendered schematic snapshots for source visibility, label styling, and connected pin artwork.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

aliases: string[]
}

const hasOverlappingDefaultPinLabels = (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need of this method, you just need to import the symbol and label as it is. No judgement of overlap is needed on import

<port name="pin1" pinNumber={1} aliases={["B"]} direction="left" schX={-0.2} schY={0} schStemLength={0.2} />
<port name="pin2" pinNumber={2} aliases={["E"]} direction="down" schX={0.2} schY={-0.4} schStemLength={0.2} />
<port name="pin3" pinNumber={3} aliases={["C"]} direction="up" schX={0.2} schY={0.4} schStemLength={0} />
<schematicpath svgPath="M 0.2 0.4 L 0.2 0.2" strokeColor="#880000" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why these new <schematicpath /> being added?

@techmannih techmannih changed the title fix: preserve pin label positions in compact custom symbols fix: preserve source pin labels in custom symbols Sep 11, 2026
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.

2 participants