[priority: high] Remove debug "Skip to Floor 100" and "Reset Floor HP" buttons #207
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?
BUG: Two debug buttons create inconsistent game states and break progression.
Buttons to Remove
"Skip to Floor 100" —
src/components/game/tabs/DebugTab/GameStateDebugSection.tsxline 175, wired todebugSetFloor(100)at line 265. Also present insrc/components/game/debug/GameStateDebug.tsxline 297 (legacy duplicate), and quick-jump floor 100 button insrc/components/game/tabs/DebugTab/SpireDebugSection.tsxline ~95."Reset Floor HP" —
src/components/game/tabs/DebugTab/GameStateDebugSection.tsxline 176, wired toresetFloorHP()at line 266. Also present insrc/components/game/debug/GameStateDebug.tsxline 298 (legacy duplicate) andsrc/components/game/tabs/DebugTab/SpireDebugSection.tsxline 31.Why "Skip to Floor 100" Is Dangerous
debugSetFloor(stores/combatStore.tslines 294-300) only setscurrentFloor,floorHP, andfloorMaxHP. It does not:spireModeorclimbDirection(combat state may be inconsistent)currentRoom(floor 100 should be a guardian floor but room type is wrong)clearedFloorsThis teleports the player into a broken state where the tick pipeline may crash trying to process combat on a floor that was never properly initialized.
Why "Reset Floor HP" Is Dangerous
resetFloorHP()(stores/combatStore.tslines 302-306) restoresfloorHPtofloorMaxHPwith a simpleset(). This:castProgress, combo counters, or equipment spell states — creating a desync between player progress and enemy stateFiles to Modify
src/components/game/tabs/DebugTab/GameStateDebugSection.tsx— RemoveonSkipToFloorandonResetFloorHPprops and their button elements (lines 168-177), remove wiring (lines 265-266)src/components/game/debug/GameStateDebug.tsx— Remove buttons at lines 297-298 (legacy duplicate panel)src/components/game/tabs/DebugTab/SpireDebugSection.tsx— Remove floor 100 quick-jump button and "Reset Floor HP" button (lines 24-33, 88-99)src/lib/game/stores/combatStore.ts— RemovedebugSetFloorandresetFloorHPactions (lines 294-306) and their type definitions incombat-state.types.ts(lines 127-128)src/components/game/tabs/DebugTab.test.ts— Remove/update tests at lines 98-111src/lib/game/__tests__/store-actions.test.ts— Remove/update tests at lines 350-358src/lib/game/__tests__/store-actions-combat-prestige.test.ts— Remove/update tests at lines 136-147Priority
HIGH — These buttons can crash the game or corrupt save state.
Fix Complete ✅
Removed the dangerous debug "Skip to Floor 100" and "Reset Floor HP" buttons that could crash the game or corrupt save state.
Files Modified (8):
src/lib/game/stores/combatStore.ts— RemoveddebugSetFloorandresetFloorHPactionssrc/lib/game/stores/combat-state.types.ts— Removed their type definitions fromCombatActionssrc/components/game/tabs/DebugTab/GameStateDebugSection.tsx— RemovedonSkipToFloorandonResetFloorHPprops and buttonssrc/components/game/debug/GameStateDebug.tsx— Removed same buttons from legacy debug panelsrc/components/game/tabs/DebugTab/SpireDebugSection.tsx— Removed floor jump input/buttons, Reset Floor HP buttonsrc/components/game/tabs/DebugTab.test.ts— Removed 2 tests for the deleted actionssrc/lib/game/__tests__/store-actions.test.ts— RemoveddebugSetFloor / resetFloorHPdescribe block (2 tests)src/lib/game/__tests__/store-actions-combat-prestige.test.ts— Removed same describe block (2 tests)Additional fix:
src/test/setup.ts— Created missing setup file referenced byvitest.config.ts(all tests were failing without it)Test Results:
All 122 tests pass across the 3 affected test files:
store-actions.test.ts— 44 tests ✅store-actions-combat-prestige.test.ts— 35 tests ✅DebugTab.test.ts— 43 tests ✅Pre-commit hook verified all files under 400 lines, no circular dependencies.
Commit:
e0e7beb