- Audited undoRedo utility: completely unused (no imports found) - Only type exports remain (WithUndoRedo) but also unused - Previously removed from Library Store in Action 4.1.2.5 - Safe to remove (Action 4.6.1.10) - Audited stateNormalization utility: only used in outdated test - Only createEmptyNormalized used in stores.test.ts - Tests check obsolete Library Store structure (items/favorites) - Library Store migrated to React Query in Action 4.1.2.6 - Safe to remove after updating test file (Action 4.6.1.12) - Created audit documentation: - apps/web/src/docs/UNDOREDO_UTILITY_AUDIT.md - apps/web/src/docs/STATENORMALIZATION_UTILITY_AUDIT.md - Actions 4.6.1.9 and 4.6.1.11 complete
1.6 KiB
1.6 KiB
UndoRedo Utility Audit
Date: 2025-01-27
Action: 4.6.1.9
Status: ✅ Complete
Summary
The undoRedo utility (apps/web/src/utils/undoRedo.ts) is completely unused in the codebase. It was previously used by the Library Store but was removed when domain data was migrated to React Query (Action 4.1.2.5).
Usage Analysis
Imports
- ❌ No imports found in production code
- ❌ No imports found in test files
- ✅ Only mentioned in comments/docs indicating it was removed
Type Exports
WithUndoRedo<T>type exported in:apps/web/src/stores/types.ts(line 14)apps/web/src/stores/index.ts(line 28)
- These type exports are not used anywhere
Functions Exported
undoRedo()- Zustand middleware for undo/redo functionalityuseUndoRedo()- React hook for undo/redoUndoRedoManager- Global undo/redo manager classundoRedoManager- Singleton instance
All functions are unused.
Historical Context
- Previously used by Library Store for undo/redo functionality on domain data
- Removed in Action 4.1.2.5 when Library Store domain data was migrated to React Query
- React Query handles state management, making undo/redo middleware unnecessary
Recommendation
✅ Safe to remove - The utility is completely unused and can be deleted along with:
apps/web/src/utils/undoRedo.ts(278 lines)WithUndoRedo<T>type fromapps/web/src/stores/types.tsWithUndoRedoexport fromapps/web/src/stores/index.ts
Next Steps
- Action 4.6.1.10: Remove undoRedo if unused ✅ (confirmed unused)