Improve PCB overlap error messages and add sample-style repro test#106
Merged
Improve PCB overlap error messages and add sample-style repro test#106
Conversation
Contributor
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
pcb_smtpad element overlaps with pcb_smtpad element.Description
formatOverlapElementDescriptionhelper that produces a descriptive string for an overlapped element including readable name + element id, owning component (when present), port (when present), and center coordinates in millimeters, and wired it into the overlap errormessagecreation incheckPcbComponentOverlap.getReadableNameForComponentandgetReadableNameForPortand replaced the terse overlap message with the new detailed format.tests/lib/check-pcb-component-overlap/test.tsxthat renders a small board/chip footprint (sample003-style) to reproduce apcb_smtpadoverlap and added/updated SVG snapshots to assert the error is drawn.Testing
BUN_UPDATE_SNAPSHOTS=1 bun test tests/lib/check-pcb-component-overlapand the suite passed (4 tests, snapshots refreshed for overlap cases).BUN_UPDATE_SNAPSHOTS=1 bun test ./tests/lib/check-pcb-component-overlap/test.tsxand the new repro test passed and wrote the snapshot (1 pass).bunx tsc --noEmitfor type-checking and it completed successfully with no errors.bun run format, which completed successfully but reported Biome size warnings for large fixture JSON files while formatting the repository.Codex Task