The selectPatternValidation selector doesn't work well with Zustand because:
1. It requires machineInfo parameter from a different store
2. Passing machineInfo creates new object references on every render
3. This breaks Zustand's memoization and causes infinite loops
Solution:
- Reverted usePatternValidation.ts to original implementation with useMemo
- Removed selectPatternValidation and usePatternValidationFromStore
- Removed PatternValidationResult type (not needed)
- Updated tests to remove validation selector tests (12 tests remain)
The store selectors (selectPatternCenter, selectRotatedBounds, etc) are
still useful for components that only need those specific values, but
validation logic that depends on external state should stay local.
Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>
- Add selectPatternCenter for pattern center calculation
- Add selectRotatedBounds for rotated bounds with memoization
- Add selectRotationCenterShift for center shift calculation
- Add selectPatternValidation for bounds checking against hoop
- Add comprehensive tests for all selectors
- Update usePatternValidation to use store selectors
- All tests passing and linter clean
Co-authored-by: jhbruhn <1036566+jhbruhn@users.noreply.github.com>