Skip to content

Make pcb footprint overlap message stable - #193

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixcheck-pcb-components-overlap-stop-b0abb7
Draft

Make pcb footprint overlap message stable#193
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixcheck-pcb-components-overlap-stop-b0abb7

Conversation

@posthog

@posthog posthog Bot commented Aug 10, 2026

Copy link
Copy Markdown

Problem

  • Board layout DRC violations reached error tracking as a new, ungroupable issue for almost every user circuit — one defect fragmented across thousands of distinct message strings, which buries real regressions in the inbox.
  • checkPcbComponentOverlap built the message from user component designators: `${elem1.type} ${elem1Description} overlaps with ${elem2.type} ${elem2Description}` — so R1.pin2 / C1.pin1 and every other designator pair minted a new string.
  • The identifying data was already available in structured fields (pcb_smtpad_ids, pcb_plated_hole_ids, pcb_hole_ids), so the designators added nothing the error object did not already carry.

Changes

  • Build the message from the two element types only, sorted for order stability: pcb_smtpad overlaps with pcb_smtpad. The template is now stable, so all overlaps of the same type pair collapse into one issue.
  • The specific overlapping elements stay in the structured *_ids fields on the error object — no information is lost.
  • Remove the now-unused formatOverlapElementDescription helper and its get-readable-names imports.
- message: `${elem1.type} ${elem1Description} overlaps with ${elem2.type} ${elem2Description}`,
+ const [firstType, secondType] = [elem1.type, elem2.type].sort()
+ message: `${firstType} overlaps with ${secondType}`,

Scope

  • This repo change stops the fingerprint explosion at the source (the message).
  • The second, independent half — routing DRC findings away from the throwing Renderable.renderError path so a bad board reports a diagnostic instead of an uncaught exception — lives in tscircuit/core and is not part of this PR.

Tests

  • Updated the affected SVG snapshots (the message is rendered when shouldDrawErrors is on) and the repro01 inline assertion; added a check that the structured pcb_smtpad_ids still carry both elements.
  • Full suite passes: 142 tests.

Agent context

  • Checked open PRs and issues on tscircuit/checks; none touch this message or the overlap fingerprinting.

Created with PostHog Desktop from this inbox report.

The pcb_footprint_overlap_error message embedded user component
designators (for example "pcb_smtpad R1.pin2 overlaps with pcb_smtpad
C1.pin1"), so every board produced a new message string. Downstream
error tracking could not group these findings, and one design rule
violation opened thousands of distinct issues.

Build the message from the two element types only ("pcb_smtpad overlaps
with pcb_smtpad") and sort the types so the order is stable. The specific
overlapping elements stay available in the structured pcb_smtpad_ids,
pcb_plated_hole_ids, and pcb_hole_ids fields on the error object.

Update the affected SVG snapshots and the repro01 assertion.

Generated-By: PostHog Code
Task-Id: 6b16945d-40fb-49de-a51e-2ed868ba641c
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.

0 participants