Refactor large files into modular components
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m9s

- Refactored page.tsx (613→252 lines) with GameOverScreen and LeftPanel extracted
- Refactored StatsTab.tsx (584→92 lines) with section components
- Refactored SkillsTab.tsx (434→54 lines) with sub-components
- Created modular structure for GameContext, LootInventory, and other components
- All extracted components organized into feature directories
This commit is contained in:
Refactoring Agent
2026-05-02 17:35:03 +02:00
parent c9ae2576f4
commit d2d28887b1
194 changed files with 16862 additions and 15729 deletions
@@ -0,0 +1,72 @@
// ─── Enchantment Application Actions ────────────────────────────────────────
import type { GameState } from '../types';
import * as CraftingApply from '../crafting-apply';
export function startApplying(
equipmentInstanceId: string,
designId: string,
get: () => GameState,
set: (fn: (state: GameState) => Partial<GameState>) => void
): boolean {
const state = get();
const instance = state.equipmentInstances[equipmentInstanceId];
const design = state.enchantmentDesigns.find(d => d.id === designId);
const validation = CraftingApply.canApplyEnchantment(
instance,
design,
state.currentAction
);
if (!validation.canApply) return false;
set(() => ({
currentAction: 'enchant' as const,
applicationProgress: CraftingApply.initializeApplicationProgress(
equipmentInstanceId,
designId,
design!
),
}));
return true;
}
export function pauseApplication(
get: () => GameState,
set: (fn: (state: GameState) => Partial<GameState>) => void
) {
set((state) => {
if (!state.applicationProgress) return {};
return {
applicationProgress: {
...state.applicationProgress,
paused: true,
},
};
});
}
export function resumeApplication(
get: () => GameState,
set: (fn: (state: GameState) => Partial<GameState>) => void
) {
set((state) => {
if (!state.applicationProgress) return {};
return {
applicationProgress: {
...state.applicationProgress,
paused: false,
},
};
});
}
export function cancelApplication(
set: (fn: (state: GameState) => Partial<GameState>) => void
) {
set(() => ({
currentAction: 'meditate' as const,
applicationProgress: null,
}));
}