-
Couldn't load subscription status.
- Fork 88
feat: implement group constraints for relative layout mode (#1391) #1560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implements GitHub issue tscircuit#1391 - adds support for constraint components between groups with xDist, yDist, centerX, and centerY properties. Key features: - Group-to-group constraint detection in Board component - Kiwi solver integration for mathematical constraint solving - Support for distance and center positioning constraints - Comprehensive test suite with 5 test cases - Backward compatibility maintained Changes: - Enhanced Board.ts with doInitialPcbLayout override - Modified applyComponentConstraintClusters.ts for group selector support - Added comprehensive test suite in tests/features/group-constraints/ - Added documentation in GROUP_CONSTRAINTS_README.md Fixes tscircuit#1391
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| return selectors.some(selector => { | ||
| if (!selector.startsWith(".")) return false | ||
| const name = selector.slice(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a null/undefined check before calling startsWith() to prevent potential runtime errors:
if (!selector || !selector.startsWith(".")) return falseThis defensive check ensures the code handles cases where a selector might be undefined or null, which could happen with optional constraint properties.
| return selectors.some(selector => { | |
| if (!selector.startsWith(".")) return false | |
| const name = selector.slice(1) | |
| return selectors.some(selector => { | |
| if (!selector || !selector.startsWith(".")) return false | |
| const name = selector.slice(1) |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
- Fix TypeScript type narrowing error in Board.ts filter callback - Add null check for selector.startsWith() to prevent runtime errors - Add comprehensive ConstraintProps type extensions for centerX/centerY - Include all missing constraint properties in type declarations - Fix formatting issues with Biome formatter Resolves CI failures in type-check, format, and smoke-test jobs.
|
Hi sir @abimaelmartell , @seveibar , @ricohageman , @imrishabh18 .. ready for review .. |
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
This PR was closed because it has been inactive for 1 day since being marked as stale. |
|
OK |
Overview
This PR implements GitHub issue #1391 by adding support for constraint components between groups in relative layout mode.
Key Features
Implementation Details
Core Changes
Technical Approach
Fixes #1391