refactor: tighten selectionModel type and verify per-instance creation - #1078
Conversation
Type changes: - selectionModel: any | null -> GraphSelectionModel on AbstractGraph (matches the model/view/stylesheet convention of typing collaborators as non-null since they are always set in initializeCollaborators) - Drop the obsolete `cells: Cell[]` declaration that duplicated GraphSelectionModel.cells - Widen GraphSelectionModel.setCell parameter to `Cell | null` (potential breaking change for subclasses that override setCell with the narrower type; callers passing a non-null Cell are unaffected) Tests: - Add 'Expect no global state' test for selectionModel on both Graph and BaseGraph. Verifies that despite the prototype-level null, initializeCollaborators assigns a fresh GraphSelectionModel per instance.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughPR narrows ChangesSelection Model Instance Isolation and Type Clarification
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|



Type changes:
cells: Cell[]declaration that duplicated GraphSelectionModel.cellsCell | null(potential breaking change for subclasses that override setCell with the narrower type; callers passing a non-null Cell are unaffected)Tests:
Summary by CodeRabbit
Bug Fixes
New Features
nullto the selection API.Tests