fix: resolve broken free wire creation , collision logic and connection stability#852
Conversation
✅ Deploy Preview for circuitverse ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughAdded two exported functions Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@tachyons @Nihal4777 kindly review |
Nihal4777
left a comment
There was a problem hiding this comment.
Thanks @Me-Priyank. Great catch.!! 🙌

Description
This PR fixes critical bug where users were unable to create "free wires" (wires starting from empty space) or branch new wires from existing wires. It also resolves an issue where creating a new wire from an endpoint node of an existing wire failed because the wire incorrectly captured the click event. Additionally, it improves connection stability, preventing circuits from breaking when components are shifted slightly.
Related Issue
Fixes #851 #696 #697
Type of Change
Checklist
Detailed Technical Changes
2. Fixed Click Stealing & Connection Instability
The
checkWithincollision detection used inclusive inequality (>=), causing the Wire to "steal" clicks intended for its exact endpoints (Nodes). This prevented nodes from spawning new wires and caused connections to be fragile during movement.File:
src/simulator/src/wire.ts3. TypeScript Fixes
Added declarations for global variables to satisfy the TypeScript compiler.
Screenshots/Fix POC :
Screen.Recording.2026-01-23.223229.mp4
Screen.Recording.2026-01-23.223303.mp4
Verification Steps
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.