BUG: useManaStats in Stats tab ignores discipline maxManaBonus (Stats shows wrong Total Max Mana)
#213
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The Stats tab displays "Total Max Mana" without including discipline bonuses, while the LeftPanel mana bar correctly shows the increased max. This is because
useManaStats()computesmaxManawithout passingdisciplineEffectstocomputeMaxMana().Root Cause
In
src/lib/game/hooks/useGameDerived.ts:Meanwhile
computeMaxManainsrc/lib/game/utils/mana-utils.ts:40-51accepts a thirddisciplineparameter:The
disciplineEffectsare computed on line 56 but never used in thecomputeMaxManacall.Meanwhile
LeftPanel.tsxusescomputeTotalMaxMana()fromsrc/lib/game/effects.tswhich correctly merges discipline bonuses.Fix
Change
useGameDerived.tslines 57-59 from:To:
Reproduction
Severity
Medium - Stats display inconsistency. The actual mana cap may be correct (via LeftPanel path) but the Stats tab shows wrong information.
Note
This bug shares the same root file (
useGameDerived.ts) as issue #212 (meditation bonus bug). Both can be fixed in the same PR.Playwright Test Ref
The Playwright test
e2e/playtest.spec.ts→2 - Stats Tab → KNOWN BUG #210navigates to Stats and checks for "Total Max Mana" text. After the fix, the Stats tab should show discipline-included max mana.A future enhancement to the Playwright test could verify that the Stats tab max mana matches the LeftPanel max mana value (currently they diverge when disciplines are active).
✅ Fix Applied
Fixed
useGameDerived.tsto passdisciplineEffectstocomputeMaxMana():The Stats tab "Total Max Mana" will now correctly include discipline bonuses (e.g., Raw Mana Mastery's maxManaBonus), matching the LeftPanel mana bar display.
Build: ✅ passing
Fixed — disciplineEffects now passed to computeMaxMana in useGameDerived.ts. Stats tab will now show correct Total Max Mana including discipline bonuses.