[priority: 4] Recreate Prestige Tab — Insight Upgrade Purchasing #91

Closed
opened 2026-05-19 10:48:11 +02:00 by Anexim · 3 comments
Owner

Summary

Recreate the Prestige tab that was deleted in commit fe0f2a0. This tab should allow the player to purchase prestige/insight upgrades and manage loop resets.

Context

  • Prestige store exists at src/lib/game/stores/prestigeStore.ts
  • prestigeUpgrades: Record<string, number> — maps upgrade ID to level
  • insight: number — current insight available to spend
  • totalInsight: number — total insight earned across all loops
  • loopInsight: number — insight earned in the current loop
  • loopCount: number — number of loops completed
  • Prestige upgrade definitions in src/lib/game/constants/prestige.ts (14 upgrades: manaWell, manaFlow, deepMemory, insightAmp, spireKey, temporalEcho, steadyHand, ancientKnowledge, elementalAttune, spellMemory, guardianPact, quickStart, elemStart, unlockedManaTypeCapacity)
  • PrestigeDef has: name, desc, max, cost
  • Memory system: memories[], memorySlots — carry skills/levels between loops
  • Pact system: pactSlots, signedPacts, defeatedGuardians

Requirements

  • Create src/components/game/tabs/PrestigeTab.tsx
  • Show current insight available and total insight earned
  • Show loop count and current loop insight
  • Display all 14 prestige upgrades in a grid/list with:
    • Name and description
    • Current level / max level
    • Cost for next level
    • Purchase button (disabled if insufficient insight or maxed)
  • Show memory slots and what's carried between loops
  • Show pact slots available
  • Include a "Reset Loop" button with confirmation dialog that:
    • Awards loopInsight to totalInsight
    • Resets game state (day, hour, mana, etc.)
    • Preserves prestige upgrades, memories, pacts, and insight
  • Use shared UI components from src/components/ui/
  • Use Tailwind CSS from the global design token system (no SCSS)
  • Add to src/components/game/tabs/index.ts barrel export
  • Add tab trigger and content to src/app/page.tsx with lazy loading pattern
  • Add DebugName wrapper
  • Write tests

Architecture Notes

  • Follow the existing lazy-loaded tab pattern
  • Use Zustand store selectors
  • Keep under 400 lines; split into sub-components if needed
  • The reset loop function already exists in gameActions.tscreateResetGame()
## Summary Recreate the Prestige tab that was deleted in commit `fe0f2a0`. This tab should allow the player to purchase prestige/insight upgrades and manage loop resets. ## Context - Prestige store exists at `src/lib/game/stores/prestigeStore.ts` - `prestigeUpgrades: Record<string, number>` — maps upgrade ID to level - `insight: number` — current insight available to spend - `totalInsight: number` — total insight earned across all loops - `loopInsight: number` — insight earned in the current loop - `loopCount: number` — number of loops completed - Prestige upgrade definitions in `src/lib/game/constants/prestige.ts` (14 upgrades: manaWell, manaFlow, deepMemory, insightAmp, spireKey, temporalEcho, steadyHand, ancientKnowledge, elementalAttune, spellMemory, guardianPact, quickStart, elemStart, unlockedManaTypeCapacity) - `PrestigeDef` has: `name`, `desc`, `max`, `cost` - Memory system: `memories[]`, `memorySlots` — carry skills/levels between loops - Pact system: `pactSlots`, `signedPacts`, `defeatedGuardians` ## Requirements - Create `src/components/game/tabs/PrestigeTab.tsx` - Show current insight available and total insight earned - Show loop count and current loop insight - Display all 14 prestige upgrades in a grid/list with: - Name and description - Current level / max level - Cost for next level - Purchase button (disabled if insufficient insight or maxed) - Show memory slots and what's carried between loops - Show pact slots available - Include a "Reset Loop" button with confirmation dialog that: - Awards loopInsight to totalInsight - Resets game state (day, hour, mana, etc.) - Preserves prestige upgrades, memories, pacts, and insight - Use shared UI components from `src/components/ui/` - Use Tailwind CSS from the global design token system (no SCSS) - Add to `src/components/game/tabs/index.ts` barrel export - Add tab trigger and content to `src/app/page.tsx` with lazy loading pattern - Add `DebugName` wrapper - Write tests ## Architecture Notes - Follow the existing lazy-loaded tab pattern - Use Zustand store selectors - Keep under 400 lines; split into sub-components if needed - The reset loop function already exists in `gameActions.ts` → `createResetGame()`
Anexim added the ai:blocked label 2026-05-19 10:48:11 +02:00
n8n-gitea was assigned by Anexim 2026-05-19 10:48:11 +02:00
Anexim added ai:todo and removed ai:blocked labels 2026-05-19 20:10:22 +02:00
Author
Owner

Starting work on PrestigeTab. I've reviewed the prestige store, prestige constants (14 upgrades), game loop actions, and existing tab patterns. Now creating the PrestigeTab component.

Starting work on PrestigeTab. I've reviewed the prestige store, prestige constants (14 upgrades), game loop actions, and existing tab patterns. Now creating the PrestigeTab component.
Author
Owner

Summary of changes

Files created:

  • src/components/game/tabs/PrestigeTab.tsx — Full prestige tab with:
    • Insight/loop summary header (available insight, total insight, loop count, this loop's insight)
    • Memory slots section showing carried skills between loops
    • Pacts section showing signed pacts and defeated guardians
    • 14 prestige upgrades in a 2-column grid with name, description, level/max, cost, and purchase button
    • Reset Loop button with AlertDialog confirmation that calls startNewLoop() from gameStore
    • DebugName wrapper, mounted state guard, Zustand selectors via useShallow
  • src/components/game/tabs/PrestigeTab.test.ts — 10 tests covering module exports, barrel export, upgrade definitions (14 IDs, required fields, positive costs/levels), store import, and file size limit

Files modified:

  • src/components/game/tabs/index.ts — Added PrestigeTab barrel export
  • src/app/page.tsx — Added lazy-loaded PrestigeTab and " Prestige" tab trigger

Verification:

  • All 10 tests pass
  • No new TypeScript errors introduced
  • File size: PrestigeTab.tsx is under 400 lines
  • All pre-existing errors are unrelated to this change
## Summary of changes ### Files created: - `src/components/game/tabs/PrestigeTab.tsx` — Full prestige tab with: - Insight/loop summary header (available insight, total insight, loop count, this loop's insight) - Memory slots section showing carried skills between loops - Pacts section showing signed pacts and defeated guardians - 14 prestige upgrades in a 2-column grid with name, description, level/max, cost, and purchase button - Reset Loop button with AlertDialog confirmation that calls `startNewLoop()` from gameStore - `DebugName` wrapper, mounted state guard, Zustand selectors via `useShallow` - `src/components/game/tabs/PrestigeTab.test.ts` — 10 tests covering module exports, barrel export, upgrade definitions (14 IDs, required fields, positive costs/levels), store import, and file size limit ### Files modified: - `src/components/game/tabs/index.ts` — Added `PrestigeTab` barrel export - `src/app/page.tsx` — Added lazy-loaded `PrestigeTab` and "✨ Prestige" tab trigger ### Verification: - All 10 tests pass ✅ - No new TypeScript errors introduced ✅ - File size: PrestigeTab.tsx is under 400 lines ✅ - All pre-existing errors are unrelated to this change ✅
Author
Owner

PrestigeTab complete. All tests pass, no new TS errors, under 400 lines. Ready for review.

PrestigeTab complete. All tests pass, no new TS errors, under 400 lines. Ready for review.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#91