[TASK-008] Enchanting system stabilization — store as single source of truth (Phase 2) #11

Closed
opened 2026-05-13 10:45:00 +02:00 by Anexim · 0 comments
Owner

Objective

Make the 3-step enchantment flow (Design → Prepare → Apply) fully driven by the crafting store as the single source of truth. Remove all local component state that duplicates store state.

Blockers (must be resolved first)

  • #7 — EquipmentCategory type missing (breaks EnchantmentDesigner)
  • #8 — EquipmentSlot type missing (breaks EnchantmentPreparer, crafting-actions)

Current Problems

  1. EnchantmentDesigner.tsx uses local useState for selectedEffects, selectedEquipmentType, designName — these should all come from the crafting store (enchantmentSelection slice already exists there).
  2. The component imports both useCraftingStore and its own local state, creating a dual-source-of-truth problem.
  3. The crafting store already has enchantmentSelection state with setSelectedEquipmentType, setSelectedEffects, setDesignName, etc. — but the component doesn't use them.

Work Items

  • Refactor EnchantmentDesigner.tsx to eliminate all local useState for selection/design fields
  • Ensure EnchantmentPreparer.tsx uses store for equipment selection (blocked by #8)
  • Ensure EnchantmentApplier.tsx uses store for design + equipment selection
  • Verify useCraftingStore enchantment selection actions work correctly end-to-end
  • Add E2E test: "can select enchantment effect from unlocked pool" (in plan, not yet written)
  • Add E2E test: "cannot select locked enchantment effects" (in plan, not yet written)
  • Add E2E test: "can complete full 3-step enchant flow" with assertions on Enchanter XP gain
  • Run npx tsc --noEmit — zero errors related to EnchantmentDesigner/EnchantmentPreparer

Acceptance Criteria

  • The enchanting 3-step flow works entirely through the crafting store
  • No local component state shadows store state for enchantment selection
  • All existing E2E tests pass + new E2E tests from the plan pass
  • TypeScript compilation succeeds with no related errors

Reference

  • Remediation Plan: Part 3 — Enchanting System (Stable)
  • Store already has enchantmentSelection shape: { selectedEquipmentType, selectedEffects, designName, selectedDesign, selectedEquipmentInstance }
## Objective Make the 3-step enchantment flow (Design → Prepare → Apply) fully driven by the crafting store as the single source of truth. Remove all local component state that duplicates store state. ## Blockers (must be resolved first) - #7 — EquipmentCategory type missing (breaks EnchantmentDesigner) - #8 — EquipmentSlot type missing (breaks EnchantmentPreparer, crafting-actions) ## Current Problems 1. `EnchantmentDesigner.tsx` uses local `useState` for `selectedEffects`, `selectedEquipmentType`, `designName` — these should all come from the crafting store (`enchantmentSelection` slice already exists there). 2. The component imports both `useCraftingStore` and its own local state, creating a dual-source-of-truth problem. 3. The crafting store already has `enchantmentSelection` state with `setSelectedEquipmentType`, `setSelectedEffects`, `setDesignName`, etc. — but the component doesn't use them. ## Work Items - [ ] Refactor `EnchantmentDesigner.tsx` to eliminate all local `useState` for selection/design fields - [ ] Ensure `EnchantmentPreparer.tsx` uses store for equipment selection (blocked by #8) - [ ] Ensure `EnchantmentApplier.tsx` uses store for design + equipment selection - [ ] Verify `useCraftingStore` enchantment selection actions work correctly end-to-end - [ ] Add E2E test: "can select enchantment effect from unlocked pool" (in plan, not yet written) - [ ] Add E2E test: "cannot select locked enchantment effects" (in plan, not yet written) - [ ] Add E2E test: "can complete full 3-step enchant flow" with assertions on Enchanter XP gain - [ ] Run `npx tsc --noEmit` — zero errors related to EnchantmentDesigner/EnchantmentPreparer ## Acceptance Criteria - The enchanting 3-step flow works entirely through the crafting store - No local component state shadows store state for enchantment selection - All existing E2E tests pass + new E2E tests from the plan pass - TypeScript compilation succeeds with no related errors ## Reference - Remediation Plan: Part 3 — Enchanting System (Stable) - Store already has `enchantmentSelection` shape: `{ selectedEquipmentType, selectedEffects, designName, selectedDesign, selectedEquipmentInstance }`
Anexim added the ai:todo label 2026-05-13 10:45:00 +02:00
n8n-gitea was assigned by Anexim 2026-05-13 10:45:00 +02:00
Anexim added the ai:blocked label 2026-05-16 13:34:02 +02:00
Anexim added ai:done and removed ai:todoai:blocked labels 2026-05-18 10:19:01 +02:00
Anexim removed the ai:done label 2026-05-18 10:19:27 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#11