🟡 GameContext: context provider never wired into the app #65

Closed
opened 2026-05-18 17:06:40 +02:00 by Anexim · 3 comments
Owner

File: src/components/game/GameContext.tsx

The GameContext system (provider + hooks) exists as a parallel architecture to the direct Zustand store hooks used in page.tsx. GameProvider is never wrapped around the app in page.tsx or any layout. Only MemorySlotPicker.tsx uses useGameContext, which would throw an error if rendered since the provider is missing.

Impact: The context-based architecture is non-functional. MemorySlotPicker would crash at runtime.

Fix: Either wrap the app with GameProvider in page.tsx or layout.tsx, or remove the context system entirely if the direct Zustand hook pattern is the preferred architecture.

**File:** `src/components/game/GameContext.tsx` The `GameContext` system (provider + hooks) exists as a parallel architecture to the direct Zustand store hooks used in `page.tsx`. `GameProvider` is **never wrapped around the app** in `page.tsx` or any layout. Only `MemorySlotPicker.tsx` uses `useGameContext`, which would throw an error if rendered since the provider is missing. **Impact:** The context-based architecture is non-functional. `MemorySlotPicker` would crash at runtime. **Fix:** Either wrap the app with `GameProvider` in `page.tsx` or `layout.tsx`, or remove the context system entirely if the direct Zustand hook pattern is the preferred architecture.
Anexim added the ai:todo label 2026-05-18 17:06:40 +02:00
n8n-gitea was assigned by Anexim 2026-05-18 17:06:40 +02:00
Author
Owner

[priority: 4] BROKEN FEATURE — GameContext provider never wired into the app, context unavailable everywhere.

[priority: 4] BROKEN FEATURE — GameContext provider never wired into the app, context unavailable everywhere.
Author
Owner

Starting work on #65. Analysis complete: GameContext system (Provider, hooks, context-create, types) is entirely dead code. MemorySlotPicker is the only consumer of useGameContext but is itself orphaned (never rendered). The app uses direct Zustand hooks throughout. Decision: remove the entire GameContext system to eliminate dead code and the confusing parallel architecture.

Starting work on #65. Analysis complete: GameContext system (Provider, hooks, context-create, types) is entirely dead code. MemorySlotPicker is the only consumer of useGameContext but is itself orphaned (never rendered). The app uses direct Zustand hooks throughout. Decision: remove the entire GameContext system to eliminate dead code and the confusing parallel architecture.
Author
Owner

Fixed. Removed the entire dead GameContext system:

  • Deleted src/components/game/GameContext.tsx (barrel re-export)
  • Deleted src/components/game/GameContext/Provider.tsx (256 lines)
  • Deleted src/components/game/GameContext/hooks.ts
  • Deleted src/components/game/GameContext/types.ts
  • Deleted src/components/game/GameContext/context-create.ts
  • Deleted src/components/game/shared/MemorySlotPicker.tsx (orphaned consumer)

Total: 625 lines of dead code removed across 6 files. No TS errors introduced. The app uses direct Zustand hooks throughout and never needed the context layer.

Fixed. Removed the entire dead GameContext system: - Deleted src/components/game/GameContext.tsx (barrel re-export) - Deleted src/components/game/GameContext/Provider.tsx (256 lines) - Deleted src/components/game/GameContext/hooks.ts - Deleted src/components/game/GameContext/types.ts - Deleted src/components/game/GameContext/context-create.ts - Deleted src/components/game/shared/MemorySlotPicker.tsx (orphaned consumer) Total: 625 lines of dead code removed across 6 files. No TS errors introduced. The app uses direct Zustand hooks throughout and never needed the context layer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#65