-
Notifications
You must be signed in to change notification settings - Fork 14
feat: MVP Connection model with port-based references (#365) #392
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
Add simplified Connection type for port-to-port connections: - Connection interface with id, a_port_id, b_port_id, optional label/color - ConnectionSchema with self-connection validation (a != b) - Layout.connections array for persisting connections - 20 comprehensive tests for schema and layout integration Design follows YAGNI principle - no connection classes, statuses, roles, or nested cable properties. Users can distinguish cable types via color and label fields. Add structured fields when there's actual user demand. The deprecated Cable interface (device+interface references) is retained for backward compatibility but marked as deprecated. Closes #365 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughVelcome, velcome! Ze pull request introduces a sleek, minimal Connection model for port-to-port relationships, vith new type definitions in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧬 Code graph analysis (1)src/tests/connection.test.ts (2)
🔇 Additional comments (12)
Comment |
Summary
Add simplified Connection type for port-to-port connections using PlacedPort.id references:
id,a_port_id,b_port_id, optionallabel/colorDesign Philosophy
MVP follows YAGNI - no connection classes, statuses, roles, or nested cable properties. Users distinguish cable types via color + label. Structured fields added when there's actual demand.
The deprecated Cable interface (device+interface refs) retained for backward compatibility.
Files Changed
src/lib/types/index.ts: Connection interface, Layout.connectionssrc/lib/schemas/index.ts: ConnectionSchema with validationsrc/tests/connection.test.ts: 20 comprehensive testsTest Plan
Closes #365
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.