fix: resolve mana conversion, Spire/Grimoire tab errors, and legacy store references
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m33s

- Fix mana conversion to deduct from regen instead of mana pool (resolves player stuck at 1 mana below cap)
- Fix Spire Tab error by removing unused legacy import (store-modules/enemy-utils)
- Fix Grimoire Tab error by adding Array.isArray check for effects.map
- Move utility functions from legacy store-modules to utils/ to eliminate legacy dependencies
- Add regression test for mana conversion fix
- Update SpellsTab.tsx imports to use utils instead of legacy stores
This commit is contained in:
2026-05-08 13:48:53 +02:00
parent e4fb66df9f
commit 2130d30133
10 changed files with 396 additions and 19 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ export function SpellsTab() {
<div className="text-xs text-gray-500 italic">{def.desc}</div>
)}
{def.effects && def.effects.length > 0 && (
{def.effects && Array.isArray(def.effects) && def.effects.length > 0 && (
<div className="flex gap-1 flex-wrap">
{def.effects.map((eff, i) => (
<Badge key={i} variant="outline" className="text-xs">
+1 -1
View File
@@ -5,7 +5,7 @@ import { GameCard, ElementBadge } from '@/components/ui';
import { Badge } from '@/components/ui/badge';
import { ELEMENTS, SPELLS_DEF } from '@/lib/game/constants';
import { ENCHANTMENT_EFFECTS } from '@/lib/game/data/enchantment-effects';
import { canAffordSpellCost } from '@/lib/game/stores';
import { canAffordSpellCost } from '@/lib/game/utils';
import { formatSpellCost, getSpellCostColor } from '@/lib/game/formatting';
export function SpellsTab() {
+1 -1
View File
@@ -7,7 +7,7 @@ import { Mountain } from 'lucide-react';
import type { ActivityLogEntry } from '@/lib/game/types';
import { ELEMENTS, GUARDIANS, SPELLS_DEF, SKILLS_DEF } from '@/lib/game/constants';
import { calcDamage } from '@/lib/game/stores';
import { getEnemyName } from '@/lib/game/store-modules/enemy-utils';
// Removed legacy import - getEnemyName not used in this component
import { getActiveEquipmentSpells, getTotalDPS } from '@/lib/game/computed-stats';
import { getUnifiedEffects } from '@/lib/game/effects';
import { formatSpellCost, getSpellCostColor } from '@/lib/game/formatting';