From d07e74c396255bf9af9c1be7e30b3bdbe6c0405b Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Mon, 8 Jun 2026 16:02:48 +0200 Subject: [PATCH] feat: remove Spells tab UI - Remove Spells tab trigger from TabTriggers in page.tsx - Remove TabsContent value='spells' block in page.tsx - Remove lazy import of SpellsTab in page.tsx - Change default activeTab from 'spells' to 'disciplines' - Remove SpellsTab re-export from tabs/index.ts - Remove SpellsTab re-export from game/index.ts - Delete src/components/game/tabs/SpellsTab.tsx Spell data (SPELLS_DEF, spells store state) preserved - spells still exist as enchantments. --- docs/circular-deps.txt | 2 +- docs/dependency-graph.json | 2 +- docs/project-structure.txt | 1 - src/app/page.tsx | 5 +- src/components/game/index.ts | 1 - src/components/game/tabs/SpellsTab.tsx | 131 ------------------------- src/components/game/tabs/index.ts | 1 - 7 files changed, 3 insertions(+), 140 deletions(-) delete mode 100644 src/components/game/tabs/SpellsTab.tsx diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index 4253f3e..e5a9ab7 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,5 +1,5 @@ # Circular Dependencies -Generated: 2026-06-08T13:03:26.382Z +Generated: 2026-06-08T13:51:45.536Z Found: 1 circular chain(s) — these MUST be fixed before modifying involved files. 1. 1) stores/golem-combat-actions.ts > stores/golem-combat-helpers.ts diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index 404891f..95cc0d4 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-08T13:03:24.191Z", + "generated": "2026-06-08T13:51:43.381Z", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." }, diff --git a/docs/project-structure.txt b/docs/project-structure.txt index 3c89558..28c9f1d 100644 --- a/docs/project-structure.txt +++ b/docs/project-structure.txt @@ -145,7 +145,6 @@ Mana-Loop/ │ │ │ │ ├── GuardianPactsTab.tsx │ │ │ │ ├── PrestigeTab.test.ts │ │ │ │ ├── PrestigeTab.tsx -│ │ │ │ ├── SpellsTab.tsx │ │ │ │ ├── SpireSummaryTab.helpers.tsx │ │ │ │ ├── SpireSummaryTab.test.ts │ │ │ │ ├── SpireSummaryTab.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index bdc4eba..e6cad9a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -33,7 +33,6 @@ import { LeftPanel } from './components/LeftPanel'; // Lazy load tab components const DisciplinesTab = lazy(() => import('@/components/game/tabs').then(m => ({ default: m.DisciplinesTab }))); -const SpellsTab = lazy(() => import('@/components/game/tabs').then(m => ({ default: m.SpellsTab }))); const StatsTab = lazy(() => import('@/components/game/tabs').then(m => ({ default: m.StatsTab }))); const DebugTab = lazy(() => import('@/components/game/tabs').then(m => ({ default: m.DebugTab }))); const AchievementsTab = lazy(() => import('@/components/game/tabs').then(m => ({ default: m.AchievementsTab }))); @@ -114,7 +113,6 @@ function useGameDerivedStats() { function TabTriggers() { return ( - 🔮 Spells 📊 Stats 📚 Disciplines 🐛 Debug @@ -145,7 +143,7 @@ function LazyTab({ name, children }: { name: string; children: React.ReactNode } // ─── Main Game Component ───────────────────────────────────────────────────── export default function ManaLoopGame() { - const [activeTab, setActiveTab] = useState('spells'); + const [activeTab, setActiveTab] = useState('disciplines'); useGameLoop(); @@ -211,7 +209,6 @@ export default function ManaLoopGame() { - diff --git a/src/components/game/index.ts b/src/components/game/index.ts index 94ad30f..4847650 100755 --- a/src/components/game/index.ts +++ b/src/components/game/index.ts @@ -2,7 +2,6 @@ // Re-exports all game tab components for cleaner imports // Tab components (consolidated in tabs/ subfolder) -export { SpellsTab } from './tabs/SpellsTab'; export { StatsTab } from './tabs/StatsTab'; // UI components diff --git a/src/components/game/tabs/SpellsTab.tsx b/src/components/game/tabs/SpellsTab.tsx deleted file mode 100644 index 0713e16..0000000 --- a/src/components/game/tabs/SpellsTab.tsx +++ /dev/null @@ -1,131 +0,0 @@ -'use client'; - -import { canAffordSpellCost } from '@/lib/game/stores'; -import { useCombatStore, useManaStore } from '@/lib/game/stores'; -import { ELEMENTS, SPELLS_DEF } from '@/lib/game/constants'; -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Badge } from '@/components/ui/badge'; -import { Button } from '@/components/ui/button'; -import { DebugName } from '@/components/game/debug/debug-context'; - -// Format spell cost for display -function formatSpellCost(cost: { type: 'raw' | 'element'; element?: string; amount: number }): string { - if (cost.type === 'raw') { - return `${cost.amount} raw`; - } - const elemDef = ELEMENTS[cost.element || '']; - return `${cost.amount} ${elemDef?.sym || '?'}`; -} - -// Get cost color -function getSpellCostColor(cost: { type: 'raw' | 'element'; element?: string; amount: number }): string { - if (cost.type === 'raw') { - return '#60A5FA'; - } - return ELEMENTS[cost.element || '']?.color || '#9CA3AF'; -} - -export function SpellsTab() { - const spells = useCombatStore((s) => s.spells); - const activeSpell = useCombatStore((s) => s.activeSpell); - const setSpell = useCombatStore((s) => s.setSpell); - const rawMana = useManaStore((s) => s.rawMana); - const elements = useManaStore((s) => s.elements); - - const spellTiers = [0, 1, 2, 3, 4]; - - return ( - -
- {spellTiers.map(tier => { - const spellsInTier = Object.entries(SPELLS_DEF).filter(([, def]) => def.tier === tier); - if (spellsInTier.length === 0) return null; - - const tierNames = ['Basic Spells (Raw Mana)', 'Tier 1 - Elemental', 'Tier 2 - Advanced', 'Tier 3 - Master', 'Tier 4 - Legendary']; - const tierColors = ['text-gray-400', 'text-green-400', 'text-blue-400', 'text-purple-400', 'text-amber-400']; - - return ( -
-

{tierNames[tier]}

-
- {spellsInTier.map(([id, def]) => { - const state = spells?.[id]; - const learned = state?.learned; - const elemDef = def.elem === 'raw' ? null : ELEMENTS[def.elem]; - const isActive = activeSpell === id; - const canCast = learned && canAffordSpellCost(def.cost, rawMana, elements); - - return ( - - -
- - {def.name} - - {def.tier > 0 && ( - - T{def.tier} - - )} -
-
- -
- {def.elem !== 'raw' && {elemDef?.sym} {elemDef?.name}} - ⚔️ {def.dmg} dmg -
- - {/* Cost display */} -
- Cost: {formatSpellCost(def.cost)} -
- - {def.desc && ( -
{def.desc}
- )} - - {def.effects && Array.isArray(def.effects) && def.effects.length > 0 && ( -
- {def.effects.map((eff, i) => ( - - {eff.type === 'burn' && `🔥 Burn`} - {eff.type === 'stun' && `⚡ Stun`} - {eff.type === 'pierce' && `🎯 Pierce`} - {eff.type === 'multicast' && `✨ Multicast`} - - ))} -
- )} - - {learned ? ( -
- Learned - {isActive && Active} - {!isActive && ( - - )} -
- ) : ( -
- Not yet learned -
- )} -
-
- ); - })} -
-
- ); - })} -
-
- ); -} - -SpellsTab.displayName = "SpellsTab"; diff --git a/src/components/game/tabs/index.ts b/src/components/game/tabs/index.ts index de791d3..360cfa9 100644 --- a/src/components/game/tabs/index.ts +++ b/src/components/game/tabs/index.ts @@ -2,7 +2,6 @@ // Re-exports all existing tab components for lazy loading from page.tsx export { DisciplinesTab } from './DisciplinesTab'; -export { SpellsTab } from './SpellsTab'; export { StatsTab } from './StatsTab'; export { DebugTab } from './DebugTab'; export { AchievementsTab } from './AchievementsTab';