mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 10:31:13 -05:00
Fix state machine cleanup
This commit is contained in:
@@ -13,6 +13,33 @@ Successfully integrated `moderationReducer` and `useLockMonitor` into the modera
|
||||
|
||||
---
|
||||
|
||||
## State Machine Architecture
|
||||
|
||||
### Active State Machines
|
||||
|
||||
1. **`moderationStateMachine.ts`** - Manages moderation workflow
|
||||
- **Used in:** `SubmissionReviewManager.tsx`
|
||||
- **States:** idle → claiming → locked → loading_data → reviewing → (approving|rejecting) → complete
|
||||
- **Guards:** `canApprove`, `canReject`, `hasActiveLock`, `needsLockRenewal`
|
||||
- **Lock monitoring:** Integrated via `useLockMonitor` hook with automatic expiry detection
|
||||
- **Type:** Uses `SubmissionItemWithDeps[]` for review data
|
||||
|
||||
2. **`deletionDialogMachine.ts`** - Manages account deletion wizard
|
||||
- **Used in:** `AccountDeletionDialog.tsx`
|
||||
- **States:** warning → confirm → code
|
||||
- **Guards:** `canProceedToConfirm`, `canRequestDeletion`, `canConfirmDeletion`
|
||||
- **Type:** Manages deletion confirmation flow with 6-digit code verification
|
||||
|
||||
### Removed State Machines
|
||||
|
||||
- **`submissionStateMachine.ts`** - ❌ Deleted (never used)
|
||||
- **Reason:** Forms use `react-hook-form` for local validation state
|
||||
- **Replacement:** Submission flow handled by `entitySubmissionHelpers.ts`
|
||||
- **Moderation:** Already covered by `moderationStateMachine.ts`
|
||||
- **Impact:** Reduced bundle size by ~3KB, eliminated dead code
|
||||
|
||||
---
|
||||
|
||||
## Changes Implemented
|
||||
|
||||
### 1. SubmissionReviewManager.tsx - State Machine Integration
|
||||
|
||||
Reference in New Issue
Block a user