refactor: extract HuntersPath.tsx monolith (6,555 → 3,975 lines)#34
Merged
JesseRWeigel merged 5 commits intomainfrom Mar 17, 2026
Merged
refactor: extract HuntersPath.tsx monolith (6,555 → 3,975 lines)#34JesseRWeigel merged 5 commits intomainfrom
JesseRWeigel merged 5 commits intomainfrom
Conversation
Phase 1 of HuntersPath.tsx refactor (6,555 → 5,965 lines): - Extract 15 interfaces to lib/game/types.ts - Extract constants to lib/game/constants/: - prestige.ts, ui.ts, story.ts, combatMessages.ts, monsters.ts - Extract 6 UI components to components/game/ui/: - Card, Btn, Bar, BarMini, CombatBar, DamageNumber All 215 tests pass. No logic changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 2 of HuntersPath.tsx refactor (5,965 → 5,466 lines): - useAudio: sound/music state, audioManager sync, first-interaction ambient start, volume/toggle controls - useSaveSystem: save/load/export/import, autosave, visibility-change save, offline gains, corruption recovery, spirit migration All 215 tests pass. No logic changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 3 of HuntersPath.tsx refactor (5,466 → 5,029 lines): - useGameTime: game time advance, passive EXP on new day - useTraining: physical/mental/meditation training, work - useShop: buy potions, buy equipment upgrades - useEquipment: equip/unequip items - useItemUsage: use potions, runes, dungeon keys - useRebirth: rebirth handler, prestige upgrade purchase All 215 tests pass. No logic changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 4 of HuntersPath.tsx refactor (5,029 → 3,975 lines): - useCombatEngine: combat tick loop, gate selection, auto-dungeon, boss intro, combat result handling (621 lines) - useDailyQuests: quest progress, completion, penalties, reset (241 lines) - useLevelUp: level gain, celebration modal, story events, stat allocation feedback (210 lines) - useSpiritBinding: binding sequence, phases, try binding (240 lines) 40% total reduction from original 6,555 lines. All 215 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major refactor of the 6,555-line monolithic
HuntersPath.tsxinto modular, testable pieces. 40% reduction (3,975 lines remaining).Extracted Modules
Types & Constants (Phase 1):
lib/game/types.ts— 15 game interfaceslib/game/constants/— prestige, UI, story, combat messages, monsterscomponents/game/ui/— Card, Btn, Bar, BarMini, CombatBar, DamageNumberCustom Hooks (Phases 2-4):
useAudiouseSaveSystemuseGameTimeuseTraininguseShopuseEquipmentuseItemUsageuseRebirthuseCombatEngineuseDailyQuestsuseLevelUpuseSpiritBindingVerification
Closes #11
Test plan
🤖 Generated with Claude Code