[Medium] [Bug] Mana Conversion: Stats tab uses hardcoded values instead of actual game state #294

Closed
opened 2026-06-07 17:40:59 +02:00 by Anexim · 2 comments
Owner

Spec: docs/specs/mana-conversion-spec.md §11
Severity: Medium

Problem: src/components/game/tabs/StatsTab/ElementStatsSection.tsx passes hardcoded values:

  • Line 50: meditationMultiplier: 1 — always assumes no meditation
  • Line 51: rawGrossRegen: 2 — hardcoded instead of actual computed raw regen

This means pause detection and drain calculations in the stats tab are inaccurate. The stats display should use the actual baseRegen and meditation state from the game state.

Additionally, the cost breakdown (raw cost per unit, component costs, downstream drains, net regen) specified in §11 is not implemented at all.

File: src/components/game/tabs/StatsTab/ElementStatsSection.tsx:50-51

**Spec:** docs/specs/mana-conversion-spec.md §11 **Severity:** Medium **Problem:** `src/components/game/tabs/StatsTab/ElementStatsSection.tsx` passes hardcoded values: - Line 50: `meditationMultiplier: 1` — always assumes no meditation - Line 51: `rawGrossRegen: 2` — hardcoded instead of actual computed raw regen This means pause detection and drain calculations in the stats tab are inaccurate. The stats display should use the actual `baseRegen` and meditation state from the game state. Additionally, the cost breakdown (raw cost per unit, component costs, downstream drains, net regen) specified in §11 is not implemented at all. **File:** `src/components/game/tabs/StatsTab/ElementStatsSection.tsx:50-51`
Anexim added the ai:todo label 2026-06-07 17:40:59 +02:00
n8n-gitea was assigned by Anexim 2026-06-07 17:40:59 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-08 14:02:00 +02:00
Author
Owner

Starting work on this bug. Will read the affected files and the mana-conversion spec §11 to understand the expected behavior.

Starting work on this bug. Will read the affected files and the mana-conversion spec §11 to understand the expected behavior.
Anexim added ai:done and removed ai:in-progress labels 2026-06-08 14:09:16 +02:00
Author
Owner

Fixed. Changes made:

  1. StatsTab.tsx — Now passes meditationMultiplier and baseRegen from useManaStats() to ElementStatsSection

  2. ElementStatsSection.tsx — Three fixes:

    • meditationMultiplier: Now uses the actual computed value from game state instead of hardcoded 1
    • rawGrossRegen: Now uses the actual baseRegen from computeRegen() instead of hardcoded 2
    • ConversionRow: Enhanced with full cost breakdown per spec §11:
      • Raw mana cost (costPerUnit × rate)
      • Per-component costs with element symbols
      • Downstream drain indicator when an element is consumed by higher-tier conversions

All 1069 tests pass. No new TypeScript errors introduced.

Fixed. Changes made: 1. **StatsTab.tsx** — Now passes `meditationMultiplier` and `baseRegen` from `useManaStats()` to `ElementStatsSection` 2. **ElementStatsSection.tsx** — Three fixes: - `meditationMultiplier`: Now uses the actual computed value from game state instead of hardcoded `1` - `rawGrossRegen`: Now uses the actual `baseRegen` from `computeRegen()` instead of hardcoded `2` - **ConversionRow**: Enhanced with full cost breakdown per spec §11: - Raw mana cost (costPerUnit × rate) - Per-component costs with element symbols - Downstream drain indicator when an element is consumed by higher-tier conversions All 1069 tests pass. No new TypeScript errors introduced.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#294