Docs: Clean up docs folder - remove all old task/phase files
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m42s

This commit is contained in:
Refactoring Agent
2026-04-27 00:25:42 +02:00
parent 64b5e8578d
commit 5f1f72d892
16 changed files with 0 additions and 1017 deletions
-238
View File
@@ -1,238 +0,0 @@
# Mana-Loop Codebase Audit Report
**Date:** 2025-01-24
**Auditor:** Automated sub-agent analysis
## Executive Summary
The Mana-Loop codebase is a Next.js game application with a mixed architecture - partially refactored from a monolithic store (`store.ts`) to a modular store architecture (`stores/`). The codebase has significant technical debt in the form of dead code, unimplemented features, and files that have grown too large.
---
## Phase 1: Files Over 300 Lines
### Critical (Needs Immediate Refactoring)
| File | Lines | Purpose | Issue |
|------|-------|---------|-------|
| `src/lib/game/store.ts` | 2464 | Legacy monolithic game store | Monolith doing virtually all game logic |
| `src/lib/game/skill-evolution.ts` | 2312 | Skill talent trees | Single file with all skill trees; could split by category |
| `src/lib/game/constants.ts` | 1436 | Game constants & definitions | Mixes constants with content data (spells, skills, etc.) |
| `src/lib/game/types.ts` | 516 | TypeScript type definitions | Type definitions should be split by domain |
| `src/components/game/tabs/CraftingTab.tsx` | 965 | Crafting UI | Single component handling all crafting phases |
| `src/lib/game/crafting-slice.ts` | 847 | Old crafting store | Legacy file; newer version exists at `stores/craftingSlice.ts` |
| `src/lib/game/data/enchantment-effects.ts` | 846 | Enchantment effect definitions | Large but focused; acceptable as data file |
| `src/components/game/tabs/DebugTab.tsx` | 700 | Debug tools UI | Catch-all debug panel; could split by feature |
| `src/lib/game/store/craftingSlice.ts` | 644 | New crafting store | Cleaner but still combines state with business logic |
### Moderate (Should Refactor)
| File | Lines | Purpose | Issue |
|------|-------|---------|-------|
| `src/lib/game/attunements.ts` | 567 | Attunement system (OLD) | **DEAD CODE** - new version at `data/attunements.ts` |
| `src/components/game/tabs/GrimoireTab.tsx` | 567 | Pact system UI | Combines memory, pacts, boons |
| `src/components/game/StatsTab.tsx` | 551 | Stats display (OLD) | Too many unrelated stat categories |
| `src/components/game/tabs/StatsTab.tsx` | 545 | Stats display (NEW) | Same issues as above |
| `src/lib/game/stores/gameStore.ts` | 509 | Game coordinator store | Still coordinates too many systems |
| `src/lib/game/computed-stats.ts` | 492 | Computed statistics | Mixes utilities with stat calculations |
| `src/lib/game/data/golems.ts` | 471 | Golem definitions | Focused, acceptable size |
| `src/lib/game/data/equipment.ts` | 468 | Equipment definitions | Data file, acceptable size |
| `src/app/page.tsx` | 465 | Main game page | Should be thin shell; currently imports everything |
| `src/components/game/LootInventory.tsx` | 460 | Loot inventory UI | Handles multiple inventory types |
| `src/components/game/SkillsTab.tsx` | 418 | Skills UI (OLD) | Combines display with upgrade dialog |
| `src/components/game/GameContext.tsx` | 405 | Game context provider | Monolithic context combining all stores |
| `src/lib/game/upgrade-effects.ts` | 402 | Upgrade effect computation | Focused, acceptable |
| `src/components/game/tabs/EquipmentTab.tsx` | 393 | Equipment UI | Acceptable size |
| `src/lib/game/utils.ts` | 372 | Game utilities | Grown to include significant game logic |
| `src/components/game/tabs/SkillsTab.tsx` | 369 | Skills UI (NEW) | Same as old version |
| `src/lib/game/store/skillSlice.ts` | 346 | Skill store slice (OLD) | Legacy; newer version exists |
| `src/components/game/tabs/SpireTab.tsx` | 345 | Spire progression UI | Acceptable size |
| `src/components/game/tabs/GolemancyTab.tsx` | 338 | Golem management UI | Acceptable size |
| `src/lib/game/stores/skillStore.ts` | 332 | Skill store (NEW) | Acceptable size |
| `src/lib/game/store/computed.ts` | 322 | Computed values (OLD) | Legacy computed values |
| `src/components/game/SpireTab.tsx` | 320 | Spire UI (OLD) | Duplicate of tabs/ version |
### Test Files Over 300 Lines (Acceptable)
- `src/lib/game/store.test.ts` - 1042 lines
- `src/lib/game/__tests__/skills.test.ts` - 588 lines
- `src/lib/game/stores/__tests__/store-methods.test.ts` - 583 lines
- `src/lib/game/stores/index.test.ts` - 571 lines
- `src/lib/game/skills.test.ts` - 542 lines
- `src/lib/game/stores.test.ts` - 494 lines
- `src/lib/game/stores/__tests__/stores.test.ts` - 458 lines
- `src/lib/game/__tests__/skill-system.test.ts` - 347 lines
---
## Phase 1: TODO/FIXME and Unimplemented Features
### TODO/FIXME Comments
**No TODO or FIXME comments found in the codebase.**
### Unimplemented Special Effects
The following special effects are **registered but never applied** in game logic:
#### 1. `spellEcho10` (Enchantment Effect)
- **Location:** `src/lib/game/data/enchantment-effects.ts:530`
- **Definition:** 10% chance to cast a spell twice
- **Issue:** `hasSpecial(effects, 'spellEcho10')` is never checked in combat logic
- **Severity:** Medium - Equipment enchantment doesn't work
#### 2. `worldThread` and `worldWeb` (Skill Upgrades)
- **Location:** `src/lib/game/skill-evolution.ts:1662,1670`
- **Definitions:**
- `worldThread`: "Enchantments also apply 5% as world effects"
- `worldWeb`: "Enchantments also apply 10% as world effects"
- **Issue:** These specialIds are never checked with `hasSpecial()`
- **Severity:** High - Major feature gap ("world effects" mechanic unimplemented)
#### 3. Weapon Enchantment Specials
All defined but never checked:
| Special ID | Location | Purpose |
|------------|----------|---------|
| `fireBlade` | `constants.ts:864`, `enchantment-effects.ts:781` | Burn enemies |
| `frostBlade` | `constants.ts:877`, `enchantment-effects.ts:791` | Prevent enemy dodge |
| `lightningBlade` | `constants.ts:890`, `enchantment-effects.ts:801` | Pierce 30% armor |
| `voidBlade` | `constants.ts:903`, `enchantment-effects.ts:811` | +20% damage |
- **Severity:** High - Weapon enchantment system broken
#### 4. `comboMaster` (Special Effect)
- **Location:** `src/lib/game/upgrade-effects.ts:97,396`
- **Definition:** Every 5th attack deals 3x damage
- **Issue:** Hit counter tracking status unclear; combat handler may not check this
- **Severity:** Low - Implementation status unclear
### Effects Applied but Never Read
#### 1. `weaponManaMax` and `weaponManaRegen`
- **Location:** `src/lib/game/data/enchantment-effects.ts:566-616`
- **Issue:** Bonuses stored in `equipmentEffects.bonuses` but never read in `computeAllEffects()`
- **Severity:** Medium - Weapon mana system incomplete
#### 2. `insightGainMultiplier` from Equipment
- **Location:** `src/lib/game/effects.ts:127-129`
- **Issue:** Stored via type assertion but never read in `calcInsight()`
- **Severity:** Medium - Insight bonus from equipment doesn't work
#### 3. `guardianDamageMultiplier` from Equipment
- **Location:** `src/lib/game/effects.ts:131-132`
- **Issue:** Stored but unclear if ever read
- **Severity:** Low - Needs investigation
---
## Phase 1: Dead Code Analysis
### Confirmed Dead Code (Safe to Remove)
| File | Reason | Evidence |
|------|--------|----------|
| `src/lib/game/attunements.ts` | Old attunement system | No imports; new version at `data/attunements.ts` |
| `src/lib/game/navigation-slice.ts` | Old navigation system | No imports anywhere |
| `src/lib/db.ts` | Prisma client | No imports; possibly planned backend feature |
| `src/components/game/ComboMeter.tsx` | Unused component | No imports; references non-existent `ComboState` type |
| `src/components/game/layout/GameFooter.tsx` | Unused component | No imports |
| `src/components/game/shared/GameOverScreen.tsx` | Unused component | No imports |
| `src/components/game/shared/MemorySlotPicker.tsx` | Unused component | Only used by GameOverScreen |
### Duplicate Code to Clean
| Location | Issue | Action |
|----------|-------|--------|
| `src/components/game/types.ts` | Duplicate formatting functions | Remove; use `src/lib/game/formatting.ts` instead |
| `src/lib/game/store.ts` | Functions duplicated in `utils.ts` and `computed-stats.ts` | Consolidate during refactoring |
### Flagged for Review (String References/Dynamic Imports)
#### UI Components (Possibly Unused)
Many shadcn/ui components in `src/components/ui/` have no direct imports:
- `aspect-ratio.tsx`, `avatar.tsx`, `breadcrumb.tsx`, `calendar.tsx`, `carousel.tsx`, `chart.tsx`, `checkbox.tsx`, `collapsible.tsx`, `command.tsx`, `context-menu.tsx`, `drawer.tsx`, `dropdown-menu.tsx`, `form.tsx`, `hover-card.tsx`, `input-otp.tsx`, `label.tsx`, `menubar.tsx`, `navigation-menu.tsx`, `pagination.tsx`, `popover.tsx`, `radio-group.tsx`, `resizable.tsx`, `scroll-area.tsx` (USED), `select.tsx` (USED), `separator.tsx` (USED), `sheet.tsx`, `skeleton.tsx`, `slider.tsx`, `sonner.tsx`, `switch.tsx` (USED), `table.tsx`, `textarea.tsx`, `toggle.tsx`, `toggle-group.tsx`
**Note:** These might be used dynamically or via string references. Review before removing.
#### Test File Duplication
- `src/lib/game/skills.test.ts` (tests old store)
- `src/lib/game/store.test.ts` (tests old store)
- `src/lib/game/__tests__/skills.test.ts` (newer)
- `src/lib/game/stores/__tests__/store-methods.test.ts` (newer)
- `src/lib/game/stores/__tests__/stores.test.ts` (newer)
**Recommendation:** Old test files may be redundant if new tests provide adequate coverage.
---
## Architecture Notes
### Store Migration In Progress
The codebase shows an active migration from:
- **Old:** Monolithic `src/lib/game/store.ts` (2464 lines)
- **New:** Modular stores in `src/lib/game/stores/` (gameStore.ts, combatStore.ts, etc.)
Current status: Mixed usage - some components still import from old store.
### Data vs Logic Separation
Good separation in `src/lib/game/data/` for:
- `attunements.ts`
- `crafting-recipes.ts`
- `enchantment-effects.ts`
- `equipment.ts`
- `golems.ts`
- `loot-drops.ts`
- `achievements.ts`
---
## Recommended Action Plan
### Phase 2: Safe Deletions (High Priority)
1. Delete `src/lib/game/attunements.ts`
2. Delete `src/lib/game/navigation-slice.ts`
3. Delete `src/lib/db.ts`
4. Delete `src/components/game/ComboMeter.tsx`
5. Delete `src/components/game/layout/GameFooter.tsx`
6. Delete `src/components/game/shared/GameOverScreen.tsx`
7. Delete `src/components/game/shared/MemorySlotPicker.tsx`
8. Clean duplicate formatting functions from `src/components/game/types.ts`
### Phase 3: Refactor Large Files (Medium Priority)
1. **store.ts (2464 lines):** Complete migration to modular stores
2. **skill-evolution.ts (2312 lines):** Split by skill category
3. **constants.ts (1436 lines):** Split into domain-specific data files
4. **types.ts (516 lines):** Split by domain
5. **CraftingTab.tsx (965 lines):** Split by crafting phase
6. **page.tsx (465 lines):** Make thin shell
7. **GameContext.tsx (405 lines):** Simplify or remove need for monolithic context
### Phase 4: Implement Missing Effects (High Priority)
1. Implement weapon enchantment specials (`fireBlade`, `frostBlade`, `lightningBlade`, `voidBlade`)
2. Implement `worldThread`/`worldWeb` ("world effects" mechanic)
3. Wire up `spellEcho10` in combat logic
4. Apply `weaponManaMax`/`weaponManaRegen` or remove
5. Use `insightGainMultiplier` in `calcInsight()`
6. Verify `comboMaster` implementation
### Phase 5: Cleanup (Low Priority)
1. Review and remove unused UI components
2. Consolidate test files
3. Review relationship between `effects.ts` and `upgrade-effects.ts`
---
## Verification Checklist
After each phase:
- [ ] Game builds without errors
- [ ] Game runs correctly in browser
- [ ] All tabs functional
- [ ] No console errors
- [ ] Tests pass (if any)
- [ ] Commit and push changes
---
**Next Steps:** Begin Phase 2 - Safe Deletions
-149
View File
@@ -1,149 +0,0 @@
# Phase 1 Audit Report - Mana-Loop Game
## Overview
Audit completed on: 2024-04-24
Scope: `/home/user/repos/Mana-Loop/src/` directory
Initial build status: ✅ Passing (Next.js 16.2.4 build succeeds)
---
## 1. Files Over 300 Lines (Splitting Candidates)
| File Path | Line Count | Purpose | Split Candidate |
|-----------|------------|---------|-----------------|
| `src/lib/game/store.ts` | 2464 | Monolithic legacy game store | **YES (HIGH PRIORITY)** |
| `src/lib/game/skill-evolution.ts` | 2312 | All skill talent trees | **YES (HIGH PRIORITY)** |
| `src/lib/game/constants.ts` | 1436 | Mixed game constants | **YES (HIGH PRIORITY)** |
| `src/lib/game/data/enchantment-effects.ts` | 846 | Enchantment effect definitions | **YES (MEDIUM PRIORITY)** |
| `src/components/game/tabs/CraftingTab.tsx` | 965 | Crafting UI (4 stages) | **YES (MEDIUM PRIORITY)** |
| `src/components/game/tabs/DebugTab.tsx` | 700 | Debug/development UI | **YES (LOW PRIORITY)** |
| `src/lib/game/types.ts` | 516 | Central type definitions | **YES (MEDIUM PRIORITY)** |
| `src/lib/game/computed-stats.ts` | 492 | Mixed utility/stat functions | **YES (MEDIUM PRIORITY)** |
| `src/app/page.tsx` | 465 | Main game page component | **YES (LOW PRIORITY)** |
| `src/components/game/GameContext.tsx` | 405 | Unified store context | **YES (LOW PRIORITY)** |
| `src/lib/game/utils.ts` | 372 | Mixed utility functions | **YES (MEDIUM PRIORITY)** |
**Key Observation**: Project is mid-refactor from legacy `store.ts` to slice-based architecture (`lib/game/stores/`). Priority should be completing this migration.
---
## 2. Unused Exports (207 Total)
### Game Components (Never Imported)
- `src/components/game/ComboMeter.tsx` - `ComboMeter`
- `src/components/game/GrimoireTab.tsx` - `GrimoireTab`
- `src/components/game/layout/GameFooter.tsx` - `GameFooter`
- `src/components/game/layout/GameHeader.tsx` - `GameHeader`
- `src/components/game/layout/GameSidebar.tsx` - `GameSidebar`
- `src/components/game/shared/GameOverScreen.tsx` - `GameOverScreen`
### Tab Component Props (Unused Type Exports)
- All `Tabs/*TabProps` types in `src/components/game/tabs/` (12 total)
### Library Files (Unused Exports)
- `src/lib/game/attunements.ts` - 8 unused exports
- `src/lib/game/constants.ts` - 15+ unused exports
- `src/lib/game/computed-stats.ts` - 5 unused exports
- `src/lib/game/effects.ts` - 5 unused exports
- `src/lib/game/store.ts` - 7 unused exports
- `src/lib/game/types.ts` - 20+ unused type exports
- `src/lib/game/upgrade-effects.ts` - 6 unused exports
- `src/lib/game/utils.ts` - 2 unused exports
### UI Components (shadcn/ui - Never Imported)
28 unused shadcn/ui components in `src/components/ui/` (accordion, alert, calendar, chart, etc.)
---
## 3. Dead Imports (56 Total)
### Top-Level Components
- `src/app/page.tsx`: 5 dead imports (`fmtDec`, `getDamageBreakdown`, `SKILL_EVOLUTION_PATHS`, etc.)
- `src/components/game/SkillsTab.tsx`: 4 dead imports
- `src/components/game/SpellsTab.tsx`: 4 dead imports
- `src/components/game/StatsTab.tsx`: 5 dead imports
### Library Files
- `src/lib/game/store.ts`: 1 dead import
- `src/lib/game/store/combatSlice.ts`: 3 dead imports
- `src/lib/game/store/computed.ts`: 4 dead imports
- `src/lib/game/store/skillSlice.ts`: 3 dead imports
---
## 4. Unreferenced Files (57 Total)
### Game Components (Never Imported)
- 7 game components including `ComboMeter.tsx`, `GameFooter.tsx`, etc.
### UI Components
- 28 unused shadcn/ui components
### Library Files
- Old store architecture: `src/lib/game/store/*.ts` (10 files)
- Old stores: `src/lib/game/stores/*.ts` (8 files)
- Test files: `src/lib/game/*test.ts` (4 files)
- `src/lib/db.ts` (Prisma client, may be runtime-used)
---
## 5. TODO/FIXME Comments
**None found** in source code (only "Temp" substring matches from temporal/tempest references)
---
## 6. Unimplemented Stubs & Unused Effects
### Critical Issues
1. **`EXECUTIONER` effect used but not defined** (HIGH SEVERITY)
- Referenced in `store.ts:1085`, `combatSlice.ts:102`, `gameStore.ts:265`
- Missing from `SPECIAL_EFFECTS` in `upgrade-effects.ts`
- **Will cause runtime errors**
### Unused Effects
2. **51/59 `SPECIAL_EFFECTS` constants unused** (Medium severity)
- Only 8/59 effects are actually checked via `hasSpecial()`
- Examples: `FLOW_SURGE`, `MANA_OVERFLOW`, `FIRST_STRIKE`, etc.
3. **5 unused enchantment `specialId` values**
- `spellEcho10`, `fireBlade`, `frostBlade`, `lightningBlade`, `voidBlade`
- Defined in `enchantment-effects.ts` but never checked in game logic
4. **~200+ `specialId` values in `skill-evolution.ts` never checked**
- Most `specialId` values added to `specials` Set but no corresponding `hasSpecial()` check
### Empty Functions
**None found** - no empty function stubs detected
---
## 7. Summary of Priority Actions
### Phase 2 (Safe Deletions) - Recommended Deletions
1. Remove 28 unused shadcn/ui components from `src/components/ui/`
2. Remove dead imports (56 total) across all files
3. Remove old store architecture files if confirmed unused:
- `src/lib/game/store/*.ts`
- `src/lib/game/stores/*.ts`
4. Remove unused game components if not needed:
- `ComboMeter.tsx`, `GameFooter.tsx`, `GameHeader.tsx`, etc.
### Phase 3 (Refactor Large Files) - Recommended Splits
1. **HIGH PRIORITY**: Split `src/lib/game/store.ts` (2464 lines) - complete migration to slice architecture
2. Split `src/lib/game/skill-evolution.ts` (2312 lines) by skill category
3. Split `src/lib/game/constants.ts` (1436 lines) into domain-specific files
4. Split `src/components/game/tabs/CraftingTab.tsx` (965 lines) by crafting stage
### Phase 4 (Implement Missing Effects) - Critical Fixes
1. **CRITICAL**: Add `EXECUTIONER: 'executioner'` to `SPECIAL_EFFECTS` in `upgrade-effects.ts`
2. Either implement or remove 51 unused `SPECIAL_EFFECTS` constants
3. Either implement or remove 5 unused enchantment `specialId` values
4. Audit ~200 `specialId` values in `skill-evolution.ts`
---
## Verification
- Initial build: ✅ Passing
- No TODO/FIXME comments found
- No empty function stubs found
- Runtime error identified: Missing `EXECUTIONER` effect definition
-43
View File
@@ -1,43 +0,0 @@
# Phase 2: Safe Deletions Summary
## Completed Deletions (All Committed)
### 1. Unused shadcn/ui Components (29 files)
- Deleted 29 unused UI components from `src/components/ui/`
- Verified build passes after deletion
- Commit: `Phase 2: Remove 29 unused shadcn/ui components`
### 2. Critical Bug Fix
- Added missing `EXECUTIONER: 'executioner'` to `SPECIAL_EFFECTS` in `upgrade-effects.ts`
- Fixed runtime error where `EXECUTIONER` was used but not defined
- Commit: `Phase 4: Add missing EXECUTIONER special effect definition (fixes runtime error)`
### 3. Unreferenced Game Components (6 files)
- `src/components/game/ComboMeter.tsx` - unreferenced
- `src/components/game/layout/GameFooter.tsx` - unreferenced
- `src/components/game/layout/GameHeader.tsx` - unreferenced
- `src/components/game/layout/GameSidebar.tsx` - unreferenced
- `src/components/game/shared/GameOverScreen.tsx` - unreferenced
- Both `GrimoireTab.tsx` files (duplicate/unreferenced)
- Commits: `Phase 2: Remove unreferenced ComboMeter and GameFooter components`, `Phase 2: Remove unreferenced GameHeader, GameSidebar, GameOverScreen components`, `Phase 2: Remove duplicate/unreferenced GrimoireTab components`
### 4. Dead Import Removals
- Removed dead imports from `src/app/page.tsx` (fmtDec, getDamageBreakdown, SKILL_EVOLUTION_PATHS, getTierMultiplier, formatHour)
## Verified Build Status
✅ Build passes after all deletions (verified multiple times with `npm run build`)
## Remaining Items (Flagged for Future Review)
1. **~50 remaining dead imports**: Audit identified 56 dead imports, but manual verification shows many may be false positives. Sub-agent attempts failed. Since the build passes and these are non-critical, they are flagged for future cleanup.
2. **Old store files**: Audit incorrectly listed `src/lib/game/store/*.ts` and `src/lib/game/stores/*.ts` as unreferenced, but grep shows they are actively imported. These should NOT be deleted.
3. **51 unused SPECIAL_EFFECTS**: These are defined but not checked via `hasSpecial()`. Flagged for Phase 4 (Implement missing effects).
## Phase 2 Completion Criteria
✅ Removed confirmed dead code (unused components, duplicates)
✅ Fixed critical runtime bug (EXECUTIONER)
✅ No changes to game balance values
✅ No new dependencies introduced
✅ Build verified passing after each deletion
✅ Changes committed to git regularly
**Phase 2 is complete.** Ready to proceed to Phase 3 (Refactor large files).
-91
View File
@@ -1,91 +0,0 @@
# Phase 3: Refactor Large Files - Progress #
## Completed Refactorings (All Committed & Pushed!)
### 1. `types.ts` (516 lines) ✅
- **Commit**: `eb81ccb Phase 3: Split types.ts into domain-specific files`
- **Result**: Split into domain-specific files
- **Build**: ✅ Passes
### 2. `constants.ts` (1436 lines) ✅
- **Commit**: `f8520e1 Phase 3: Split constants.ts into domain-specific files`
- **Result**: Split into domain-specific files
- **Build**: ✅ Passes
### 3. `enchantment-effects.ts` (846 lines) ✅
- **Commit**: `c46981d Phase 3: Split enchantment-effects.ts into category files`
- **Result**: Split into category files
- **Build**: ✅ Passes
### 4. `CraftingTab.tsx` (965 lines) ✅
- **Commit**: `ra528feb Phase 3: Split CraftingTab.tsx into crafting stage components`
- **Result**: Split into crafting stage components
- **Build**: ✅ Passes
### 5. `computed-stats.ts` (492 lines) ✅
- **Commit**: `b3291c3 Phase 3: Split computed-stats.ts by responsibility`
- **Result**: Split by responsibility
- **Build**: ✅ Passes
### 6. `utils.ts` (372 lines) ✅
- **Commit**: `23d0a12 Phase 3: Split utils.ts by responsibility`
- **Result**: Split by responsibility
- **Build**: ✅ Passes
### 7. `DebugTab.tsx` (700 lines) ✅
- **Commit**: Phase 3: Split DebugTab.tsx into functional components`
- **Result**: Split into functional components
- **Build**: ✅ Passes
### 8. `page.tsx` (465 lines) ✅
- **Commit**: `eea5ed1 Phase 3: Lazy load tabs in page.tsx`
- **Result**: Lazy load tabs
- **Build**: ✅ Passes
### 9. `StatsTab.tsx` (551 lines) ✅
- **Result**: Extracted sub-components: `stats/ManaStatsSection.tsx`, `CombatStatsSection.tsx`, `StudyStatsSection.tsx`, `UpgradeEffectsSection.tsx`, `index.tsx`
- **Build**: ✅ Passes (just verified: "✓ Compiled successfully in 3.2s")
## Failed Refactorings!
### 1. `store.ts` (2464 lines) ❌
- **Issue**: Sub-agent made changes that broke build
- **Status**: Flagged as "too large for current sub-agent setup"
### 2. `skill-evolution.ts` (2312 lines) ❌
- **Issue**: Too large for sub-agents (context limits)
- **Status**: Flagged as "too large for current sub-agent setup"
### 3. `gameStore.ts` (509 lines) ❌
- **Issue**: Sub-agent returned empty result
- **Status**: Flagged as "unstable sub-agent behavior"
## Phase 3 Status: ✅ LARGELY COMPLETE!
- **9 successful refactorings** via sub-agents (all committed & pushed!)
- **Build verified passing** after each refactoring
- **All manageable files** (under ~1500 lines) completed
- **Large files** (2000+ lines) flagged as "too large for current sub-agent setup"
## Next Phase: Phase 4 (Implement missing effects)
### Tasks:
1. ✅ Fixed EXECUTIONER bug (already done)
2.**51 unused SPECIAL_EFFECTS** - defined but never used
3. Need to either:
a. Implement them (add `hasSpecial()` checks)
b. Remove them if not needed
### Approach:
- This is a 3+ step complex task → MUST delegate to sub-agent
- Will launch sub-agent for Phase 4 next!
## Build Status
✅ Build passes after ALL successful refactorings!
✅ All commits pushed to remote!
## Notes
- Sub-agents work best with files under ~1500 lines
- 9 successful refactorings completed!
- When in doubt, flag it and move on (per user instructions)
- Phase 3 is largely complete → **Ready to move to Phase 4**
-90
View File
@@ -1,90 +0,0 @@
# Phase 3: Refactor Large Files Plan
## Overview
Split files over 300 lines into focused modules. Keep public APIs stable - don't rename exports unless clearly a mistake.
## High Priority Files (Audit Findings)
### 1. `src/lib/game/store.ts` (2464 lines) - MONOLITHIC LEGACY STORE
**Status**: Mid-refactor - project has started moving to slice architecture (`/stores/` directory)
**Action**: Complete migration to slice-based architecture
- New architecture exists: `gameStore.ts`, `manaStore.ts`, `skillStore.ts`, `combatStore.ts`, `prestigeStore.ts`
- Migrate all remaining imports from `store.ts` to new stores
- Deprecate and eventually remove `store.ts`
- **Complexity**: 3+ steps → Requires sub-agent delegation
### 2. `src/lib/game/skill-evolution.ts` (2312 lines) - ALL SKILL TREES
**Action**: Split by skill category
- Separate files for: mana skills, combat skills, study skills, element skills
- Extract helper functions (`createPerk`, `createUpgrade`, etc.) to `skill-utils.ts`
- Keep `SKILL_EVOLUTION_PATHS` as the main export
- **Complexity**: 3+ steps → Requires sub-agent delegation
### 3. `src/lib/game/constants.ts` (1436 lines) - MIXED CONSTANTS
**Action**: Split into domain-specific files
- `elements.ts` (element definitions)
- `guardians.ts` (guardian definitions)
- `spells.ts` (spell definitions)
- `skills.ts` (skill definitions)
- `prestige.ts` (prestige definitions)
- `room-config.ts` (room types, swarm config, etc.)
- Keep `constants.ts` as barrel file exporting from all split files
- **Complexity**: 3+ steps → Requires sub-agent delegation
### 4. `src/lib/game/data/enchantment-effects.ts` (846 lines) - ENCHANTMENT DATA
**Action**: Split by category or move data to JSON
- Separate files: `spell-enchants.ts`, `mana-enchants.ts`, `combat-enchants.ts`, etc.
- Keep `ENCHANTMENT_EFFECTS` as main export
- **Complexity**: 2-3 steps → Consider sub-agent
### 5. `src/components/game/tabs/CraftingTab.tsx` (965 lines) - CRAFTING UI
**Action**: Split by crafting stage
- `EnchantmentDesigner.tsx` (design stage)
- `EnchantmentPreparer.tsx` (prepare stage)
- `EnchantmentApplier.tsx` (apply stage)
- `EquipmentCrafter.tsx` (craft stage)
- Keep `CraftingTab.tsx` as coordinator
- **Complexity**: 2-3 steps → Consider sub-agent
## Medium Priority Files
### 6. `src/lib/game/types.ts` (516 lines) - TYPE DEFINITIONS
**Action**: Split into domain-specific type files
- `types/elements.ts`, `types/attunements.ts`, `types/spells.ts`, etc.
- Keep `types/index.ts` as barrel file
### 7. `src/lib/game/computed-stats.ts` (492 lines) - MIXED UTILITIES
**Action**: Split by responsibility
- `formatting.ts` (fmt, fmtDec)
- `floor-utils.ts` (floor HP, floor element)
- `mana-utils.ts` (computeMaxMana, computeRegen, etc.)
- `combat-utils.ts` (calcDamage, calcInsight, etc.)
### 8. `src/lib/game/utils.ts` (372 lines) - MIXED UTILITIES
**Action**: Same as computed-stats.ts - split by responsibility
## Low Priority Files (Acceptable Size/Structure)
- `src/lib/game/stores/gameStore.ts` (509 lines) - Good coordinator
- `src/lib/game/store/craftingSlice.ts` (644 lines) - Well-structured slice
- `src/components/game/tabs/DebugTab.tsx` (700 lines) - Debug UI, can split if desired
- `src/app/page.tsx` (465 lines) - Main page, could lazy load tabs
## Guidelines
1. Keep public APIs stable - don't rename exports unless mistake
2. Don't change game balance values
3. Don't refactor working code just for style
4. Don't introduce new dependencies
5. When in doubt, flag it and move on
6. Verify build after each file split
7. Commit regularly
## Execution Order
1. Start with `store.ts` (highest priority, completes architecture migration)
2. Then `skill-evolution.ts` (second largest)
3. Then `constants.ts` (mixed constants)
4. Other files as time permits
## Verification
- Run `npm run build` after each refactoring step
- Run `npm run test` if tests exist
- Commit changes regularly with descriptive messages
-33
View File
@@ -1,33 +0,0 @@
# Phase 4 Blockers: Remaining Effects
## Status
-**49+ effects implemented**: Mana Flow (7), Mana Well (14), Combat (6), Study (12), Element (4), Enchanting (6)
- 🔴 **9 effects remaining** (sub-agent implementation failed multiple times)
## Remaining Effects
### Crafting Special Effects (4)
- BATCH_CRAFTING
- MASS_PRODUCTION
- SCAVENGE
- RECLAIM
### Golemancy Special Effects (4)
- GOLEM_FURY
- GOLEM_RESONANCE
- RAPID_STRIKES
- BLITZ_ATTACK
### Ascension Special Effects (1)
- INSIGHT_BOUNTY
## Blocker Details
Multiple sub-agent attempts failed due to:
1. **Context length limits**: Prompts exceeding 262k token maximum (last attempt: 630k tokens)
2. **Prompt misalignment**: Sub-agents returning unrelated results (table sorting bugs, enchantment system explorations, paidStudySkills fixes)
3. **Inability to follow "implement X effects" instructions**: Sub-agents keep exploring instead of executing
## Next Steps
- Flag these 9 effects for manual implementation later
- Verify all 49+ implemented effects work correctly
- Complete Phase 4 documentation
- Move to Phase 5 (Testing & Verification)
-48
View File
@@ -1,48 +0,0 @@
# Phase 4 Progress: Implement Missing Effects
## Status: Mostly Complete (49+ effects implemented)
## Completed Effects (49+ total)
### Mana Flow Effects (7)
- ✅ All 7 effects implemented (commit: "Phase 4: Mana Flow effects")
### Mana Well Effects (14)
- ✅ All 14 effects implemented (2 commits: "Phase 4: Mana Well effects (1st 7)" and "Phase 4: Mana Well effects (remaining 7)")
### Combat Special Effects (6)
- ✅ All 6 effects implemented (commit: "Phase 4: Combat special effects (6)")
### Study Special Effects (12)
- ✅ All 12 effects implemented (2 commits: "Phase 4: Study effects (first 6)" and "Phase 4: Study effects (remaining 6)")
### Element Special Effects (4)
- ✅ All 4 effects implemented (commit: "Phase 4: Element special effects (4)")
### Enchanting Special Effects (6)
- ✅ All 6 effects implemented (commit: "Phase 4: Enchanting special effects (6)")
## Remaining Effects (9 total - BLOCKED)
### Crafting Special Effects (4)
- 🔴 BATCH_CRAFTING, MASS_PRODUCTION, SCAVENGE, RECLAIM
- Blocker: Multiple sub-agent attempts failed (context length limits, unrelated results)
- Details: See `docs/phase4-blockers.md`
### Golemancy Special Effects (4)
- 🔴 GOLEM_FURY, GOLEM_RESONANCE, RAPID_STRIKES, BLITZ_ATTACK
- Blocker: Multiple sub-agent attempts failed (context length limits, unrelated results)
- Details: See `docs/phase4-blockers.md`
### Ascension Special Effects (1)
- 🔴 INSIGHT_BOUNTY
- Blocker: Multiple sub-agent attempts failed (context length limits, unrelated results)
- Details: See `docs/phase4-blockers.md`
## Verification
- ✅ Build passes: `npm run build` completed successfully (exit code 0)
- 🔄 UI verification: In progress (dev server starting)
## Next Steps
1. Verify UI works correctly (dev server check)
2. Flag remaining 9 effects for future implementation
3. Move to Phase 5 (Testing & Verification)
4. Commit and push this progress doc
-35
View File
@@ -1,35 +0,0 @@
**Role:** You are an expert Next.js game developer.
**Project Context:** `/home/user/repos/Mana-Loop`
**Objective:** Execute a multi-system update covering UI reworks, state-machine logic, game balance, developer tools, and critical bug fixes.
### **1. Workflow & State Management (Priority)**
* **Initialization:** Check `docs/task2_progress.md` and `docs/task2.md` to identify current progress.
* **Tracking:** Use the `todo_list` tool. Document all actions in the `docs/` files.
* **Delegation:** Use sub-agents for modular tasks; commit and push changes incrementally.
### **2. Automation & State Logic**
* **ActionButtons Rework:**
* **Remove Manual Selection:** Remove buttons that allow players to manually choose their action.
* **Automatic Transition:** Automatically switch the state to **"Meditate"** whenever a Study or Crafting task finishes.
* **Status Display:** Replace buttons with a read-only "Current Activity" indicator.
* **Research Locking:** In the `SkillsTab`, prevent switching research topics while a study action is in progress.
### **3. Feature Reworks & UI**
* **SpireTab Overhaul:** * **"Climb the Spire":** Create an entry button navigating to a dedicated, locked "Spire Mode."
* **Exit Condition:** Player must "climb down" to exit.
* **Persistent UI:** Only `ManaDisplay` and `CalendarDisplay` remain. Display Spire info and Golems.
* **Equipment System:** Support **2-Handed Weapons**. Staves must block the offhand slot.
### **4. Developer & System Tools**
* **DebugTab Update:** Add **Invoker Debugging Buttons** to manually trigger/force **Pacts with different Guardians**.
* **System Integrity:** Fix the **"Show Component Names"** debug option. Following the recent refactor, ensure this works for **all** components. Check for missing `displayName` properties or wrappers that might be masking component identities in the DOM/DevTools.
### **5. Bug Fixes & Refinement**
* **CRITICAL: Mana Well Bug:** Fix the "Deep Basin" upgrade logic. Currently, choosing this upgrade resets max mana capacity to 120 instead of the expected 600. Ensure the upgrade correctly calculates or adds to the base capacity rather than overwriting it with a flat value.
* **Combat UI:** Fix the "Casting Bar" progress animation; ensure the progress bar fills correctly.
* **LootTab:** Remove "Transference" mana from Essence/Item lists.
* **Crafting:** Disable "Prepare" for non-enchanted items; limit "Design" to gear types currently owned.
### **6. Game Balance & Progression**
* **SkillsTab:** Delete all "Ascension" skills (Insight gain is prestige-only).
* **StatsTab:** Lock Fire, Water, Air, and Earth at start. Only "Transference" is unlocked initially.
-34
View File
@@ -1,34 +0,0 @@
# Task 2: ActionButtons Rework - Context
## Task Description
**Priority task from task2.md**
### Requirements:
1. **Remove Manual Selection:** Remove buttons that allow players to manually choose their action.
2. **Automatic Transition:** Automatically switch the state to 'Meditate' whenever a Study or Crafting task finishes.
3. **Status Display:** Replace buttons with a read-only 'Current Activity' indicator.
### Current Implementation:
- ActionButtons component is in `/home/user/repos/Mana-Loop/src/components/game/ActionButtons.tsx`
- The component currently shows buttons for: meditate, climb, study, craft, repair, convert, design, prepare, enchant
- `currentAction` state comes from the game store
- Buttons allow manual selection of actions
### What Needs To Be Done:
1. Read `src/components/game/ActionButtons.tsx` to understand current implementation
2. Remove the manual selection buttons (or make them read-only)
3. Find where Study and Crafting actions complete (look in store.ts or crafting-slice.ts)
4. Add logic to automatically set `currentAction` to 'meditate' when Study or Crafting completes
5. Replace buttons with a read-only "Current Activity" indicator showing the current action
6. Test the changes
7. Commit with message: "Task 2: ActionButtons rework - remove manual selection, auto-transition to Meditate"
### Key Files To Examine:
- `src/components/game/ActionButtons.tsx` - main component to modify
- `src/lib/game/store.ts` - likely contains action completion logic
- `src/lib/game/crafting-slice.ts` - crafting completion logic
### Implementation Notes:
- Study completes when `studyProgress` finishes
- Crafting completes when `preparationProgress` or `enchantProgress` finishes
- Need to track these completion events and trigger the Meditate transition
-33
View File
@@ -1,33 +0,0 @@
# Task 8: Combat UI - Casting Bar Animation Fix - Context
## Task Description
**Bug Fix from task2.md**
### Problem:
The "Casting Bar" progress animation doesn't fill correctly during spell casting.
### Current Implementation:
- Casting bar is likely in a Combat-related component
- Search for "CastingBar" or "casting" in components folder
- Progress animation probably uses a Progress component or div with width styling
### What Needs To Be Done:
1. Search for "CastingBar" or "casting" in `src/components/game/` to find the relevant component
2. Read the component to understand the current implementation
3. Find the bug in the progress animation:
- Is the progress value being calculated correctly?
- Is the CSS/style correct for the progress bar?
- Is the animation updating properly?
4. Fix the bug so the progress bar fills correctly during casting
5. Test the changes
6. Commit with message: "Task 2: Fix Combat UI Casting Bar progress animation"
### Key Files To Examine:
- Search for files containing "CastingBar" or "casting" in `src/components/game/`
- Look for Progress components or div elements with dynamic width
### Common Issues To Check:
- Progress value calculation (should be percentage 0-100)
- CSS transitions/animations
- State updates during casting
- Re-rendering issues
-44
View File
@@ -1,44 +0,0 @@
# Task 10: Crafting - Prepare/Design Limits - Context
## Task Description
**From task2.md:** Disable "Prepare" for non-enchanted items; limit "Design" to gear types currently owned.
## Current Implementation:
- Crafting system involves:
- `src/components/game/tabs/CraftingTab.tsx` - main crafting UI
- `src/components/game/crafting/EnchantmentPreparer.tsx` - Prepare stage
- `src/lib/game/crafting-slice.ts` - crafting logic
- `currentAction` can be 'design', 'prepare', 'enchant'
- "Prepare" stage is for preparing equipment for enchanting
## What Needs To Be Done:
### Part 1: Disable "Prepare" for non-enchanted items
1. Read `EnchantmentPreparer.tsx` to understand current logic
2. Currently shows "Prepare" option for non-enchanted items
3. **Clarify**: Does this mean:
- Disable the "Prepare" button if the item is NOT enchanted?
- Or disable if there are no enchanted items to disenchant?
4. Make the appropriate changes to disable "Prepare" based on the requirement
### Part 2: Limit "Design" to gear types currently owned
1. Read `CraftingTab.tsx` to understand the "Design" stage
2. Find where gear types are listed for design
3. Filter to only show gear types that the player currently owns (has blueprints for)
4. This might involve checking `store.lootInventory.blueprints` or similar
### Final Steps:
5. Test the changes
6. Commit with message: "Task 2: Crafting - disable Prepare for non-enchanted items, limit Design to owned gear types"
## Key Files:
- `src/components/game/tabs/CraftingTab.tsx` - Design and Prepare stages
- `src/components/game/crafting/EnchantmentPreparer.tsx` - Prepare logic
- `src/lib/game/crafting-slice.ts` - crafting state management
- `src/lib/game/data/equipment.ts` - equipment types definition
## Implementation Notes:
- "Prepare" is the action of preparing equipment for enchanting
- Non-enchanted items might refer to items that don't have enchantments yet
- "Design" stage lets players design enchantments for gear types
- Limit to "owned" gear types = types that the player has blueprints for (in `lootInventory.blueprints`)
-32
View File
@@ -1,32 +0,0 @@
# Task 5: DebugTab Update - Invoker Debug Buttons - Context
## Task Description
**From task2.md:** Add Invoker Debugging Buttons to manually trigger/force Pacts with different Guardians.
## Current Implementation:
- DebugTab is likely in `/home/user/repos/Mana-Loop/src/components/game/debug/` or similar
- Pact system involves Guardians and signing pacts with them
- DebugTab already has some debugging features
## What Needs To Be Done:
1. Find the DebugTab component (search for "DebugTab" or look in `src/components/game/debug/`)
2. Read the component to understand current implementation
3. Find how Pacts work:
- Look for "pact" related functions in the store (`store.ts` or similar)
- Understand what signing a pact does (what state changes)
4. Add buttons to manually trigger/force Pacts with different Guardians:
- Each Guardian should have a button
- Clicking the button forces a pact with that Guardian
5. Test the implementation
6. Commit with message: "Task 2: DebugTab Update - add Invoker Debugging Buttons for Pacts"
## Key Files To Examine:
- `src/components/game/debug/` - DebugTab component
- `src/lib/game/store.ts` - Pact-related functions
- Look for Guardian definitions (maybe in `constants/` or `data/`)
## Implementation Notes:
- Pacts are likely stored in the game state
- Forcing a pact might involve calling a function like `store.signPact(guardianId)`
- The buttons should be clearly labeled with Guardian names
- Consider adding confirmation dialogs to prevent accidental clicks
-42
View File
@@ -1,42 +0,0 @@
# Task 2 Progress Tracking - COMPLETE!
**Last Updated**: 2026-04-26 18:53:00
**Current Status**: ✅ COMPLETE (12/12 tasks done!)
## ✅ ALL Tasks Completed:
### UI/UX Changes:
1.**Task 1**: ActionButtons Rework - Remove manual selection, auto-transition to Meditate, add Current Activity indicator (commit `313aa33`)
2.**Task 3**: SpireTab Overhaul - Implement Spire Mode with "Climb the Spire" button and exit condition (commit `50ce70e`)
3.**Task 5**: DebugTab Update - Add Invoker Debugging Buttons for Pacts (commit `9f029d9`)
4.**Task 8**: Combat UI - Fix Casting Bar progress animation (commit `9bf6e91`)
### Game Systems:
5.**Task 2**: Research Locking - Prevent switching topics while study in progress (commit `229cb16`)
6.**Task 4**: Equipment System - Support 2-Handed Weapons, Staves block offhand (commit `5e0bee8`)
7.**Task 7**: CRITICAL FIX - Mana Well 'Deep Basin' upgrade multiplier values (commit `f61ed00`)
8.**Task 10**: Crafting - Disable Prepare for enchanted items, limit Design to owned gear (commit `c8baea4`)
### Bug Fixes & Balance:
9.**Task 9**: LootTab - Remove 'Transference' mana from essence list (commit `65b0f96`)
10.**Task 11**: SkillsTab - Delete all 'Ascension' skills (commit `65b0f96`)
11.**Task 12**: StatsTab - Lock Fire/Water/Air/Earth at start, only Transference unlocked (commit `2355be6`)
### System Integrity:
12.**Task 6**: System Integrity - Fix 'Show Component Names' debug option (commit `c2dd846`)
## Final Commit History (Task 2):
- `313aa33` (HEAD -> master) Task 2: ActionButtons rework ✓
- `b10d92b` Task 2: 11/12 completed, Task 1 blocked (old)
- `c2dd846` Task 2: System Integrity - Fix Show Component Names ✓
- `c8baea4` Task 2: Crafting - disable Prepare, limit Design ✓
- `9bf6e91` Task 2: Fix Combat UI Casting Bar progress animation ✓
- `50ce70e` Task 2: SpireTab Overhaul - Spire Mode ✓
- `9f029d9` Task 2: DebugTab Update - Invoker Debugging Buttons ✓
- `229cb16` Task 2: Research Locking - prevent switching topics ✓
- Plus 5 earlier commits...
## Summary:
**ALL 12/12 TASKS COMPLETED SUCCESSFULLY!** All work has been committed and pushed to gitea (master branch).
**Task 2 is OFFICIALLY COMPLETE!** 🎉
-29
View File
@@ -1,29 +0,0 @@
# Task 2: Research Locking in SkillsTab - Context
## Task Description
**From task2.md:** Prevent switching research topics while a study action is in progress in the SkillsTab.
## Current Implementation:
- SkillsTab component is in `/home/user/repos/Mana-Loop/src/components/game/SkillsTab.tsx`
- Another version exists at `/home/user/repos/Mana-Loop/src/components/game/tabs/SkillsTab.tsx`
- Research topics/skills can be selected for studying
- The `currentAction` state in the game store tracks if "study" is in progress
## What Needs To Be Done:
1. Read `src/components/game/SkillsTab.tsx` to understand current implementation
2. Find where research topics/skills are selected
3. Check if `store.currentAction === 'study'` (study is in progress)
4. Disable topic switching/selection while study is in progress
5. Show a message like "Cannot switch topics while studying" or disable the UI elements
6. Test the changes
7. Commit with message: "Task 2: Research Locking - prevent switching topics while study in progress"
## Key Files:
- `src/components/game/SkillsTab.tsx` - main component to modify
- `src/lib/game/store.ts` - contains `currentAction` state
## Implementation Notes:
- The study action is started when a skill is selected for study
- While `currentAction === 'study'`, the player should not be able to switch to a different research topic
- Consider graying out or disabling the skill selection buttons
- Show a tooltip or message explaining why switching is disabled
@@ -1,39 +0,0 @@
# Task 6: System Integrity - Show Component Names Fix - Context
## Task Description
**From task2.md:** Fix the "Show Component Names" debug option. Following the recent refactor, ensure this works for all components. Check for missing `displayName` properties or wrappers that might be masking component identities in the DOM/DevTools.
## Current Implementation:
- "Show Component Names" is in `src/components/game/debug/GameStateDebug.tsx` (line 28)
- Uses `useDebug()` hook from `src/lib/game/debug-context.tsx`
- `DebugName` wrapper component shows component names visually (yellow label) when enabled
- `DebugName` is currently used in `src/app/page.tsx` to wrap major components
## How It Works:
1. `GameStateDebug.tsx` has a Switch for "Show Component Names"
2. When enabled, `showComponentNames` becomes true
3. `DebugName` wrapper shows a yellow label with the component name
4. Components need to be wrapped with `<DebugName name="ComponentName">...</DebugName>`
## What Needs To Be Done:
1. Ensure `DebugName` wrapper is used for ALL components (not just top-level ones in page.tsx)
2. Check for missing `displayName` properties on components:
- `displayName` helps with React DevTools identification
- Components wrapped with `React.memo()`, `React.forwardRef()`, etc. might lose their name
- Fix by setting `ComponentName.displayName = "ComponentName"`
3. Check for wrappers masking component identities:
- Search for `React.memo`, `React.forwardRef`, higher-order components
- Ensure `displayName` is set on these
4. Test that "Show Component Names" works correctly for all components
5. Commit with message: "Task 2: System Integrity - Fix Show Component Names for all components"
## Key Files:
- `src/lib/game/debug-context.tsx` - DebugName component and hook
- `src/components/game/debug/GameStateDebug.tsx` - Switch for showing names
- `src/app/page.tsx` - Currently uses DebugName for top-level components
- Search for `React.memo` and `forwardRef` in `src/components/`
## Implementation Notes:
- The `DebugName` wrapper adds a visual label - this is for the in-game debug view
- The `displayName` property is for React DevTools - this is a separate concern
- Both should be fixed for full debugging support
-37
View File
@@ -1,37 +0,0 @@
# Task 3: SpireTab Overhaul - Context
## Task Description
**Feature Rework from task2.md**
### Requirements:
1. **'Climb the Spire':** Create an entry button navigating to a dedicated, locked "Spire Mode."
2. **Exit Condition:** Player must "climb down" to exit.
3. **Persistent UI:** Only ManaDisplay and CalendarDisplay remain. Display Spire info and Golems.
### Current Implementation:
- SpireTab component is in `/home/user/repos/Mana-Loop/src/components/game/SpireTab.tsx`
- Currently shows Spire-related content in the main game UI
- Game state/progression managed in `src/lib/game/store.ts`
### What Needs To Be Done:
1. Read `src/components/game/SpireTab.tsx` to understand current implementation
2. Create a "Climb the Spire" button that enters a new "Spire Mode"
3. Implement Spire Mode as a separate UI state:
- Only show ManaDisplay, CalendarDisplay, Spire info, and Golems
- Hide all other UI elements
4. Add an "Climb Down" button to exit Spire Mode and return to normal game
5. The Spire Mode should be "locked" until the player chooses to enter it
6. Test the implementation
7. Commit with message: "Task 2: SpireTab Overhaul - add Climb the Spire button, implement Spire Mode with exit condition"
### Key Files To Examine:
- `src/components/game/SpireTab.tsx` - main component to modify
- `src/components/game/ManaDisplay.tsx` - needs to remain visible in Spire Mode
- `src/components/game/CalendarDisplay.tsx` - needs to remain visible in Spire Mode
- `src/lib/game/store.ts` - manage Spire Mode state
### Implementation Notes:
- Consider adding a `spireMode: boolean` state to the game store
- Spire Mode is a simplified UI - only essential info
- "Climb the Spire" button should be in SpireTab
- "Climb Down" button should be visible in Spire Mode to exit