fix: address multiple bugs (1,2,3,5,6,9,10,11,12,13) - partial fix for 4, remaining 7,8
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m9s

This commit is contained in:
2026-05-07 12:28:16 +02:00
parent 54d5e576ab
commit 7851d8c7cb
10 changed files with 136 additions and 22 deletions
+5 -4
View File
@@ -8,10 +8,11 @@ import { useGameStore } from '@/lib/game/stores';
interface GameOverScreenProps {
day: number;
hour: number;
insight: number;
insightGained: number;
totalInsight: number;
}
export function GameOverScreen({ day, hour, insight }: GameOverScreenProps) {
export function GameOverScreen({ day, hour, insightGained, totalInsight }: GameOverScreenProps) {
const startNewLoop = () => {
useGameStore.getState().startNewLoop();
};
@@ -31,7 +32,7 @@ export function GameOverScreen({ day, hour, insight }: GameOverScreenProps) {
<div className="grid grid-cols-2 gap-3">
<div className="p-3 bg-gray-800 rounded">
<div className="text-xl font-bold text-amber-400 game-mono">{fmt(insight)}</div>
<div className="text-xl font-bold text-amber-400 game-mono">{fmt(insightGained)}</div>
<div className="text-xs text-gray-400">Insight Gained</div>
</div>
<div className="p-3 bg-gray-800 rounded">
@@ -43,7 +44,7 @@ export function GameOverScreen({ day, hour, insight }: GameOverScreenProps) {
<div className="text-xs text-gray-400">Hour</div>
</div>
<div className="p-3 bg-gray-800 rounded">
<div className="text-xl font-bold text-green-400 game-mono">{insight}</div>
<div className="text-xl font-bold text-green-400 game-mono">{fmt(totalInsight)}</div>
<div className="text-xs text-gray-400">Total Insight</div>
</div>
</div>
+7 -12
View File
@@ -49,7 +49,7 @@ import { LeftPanel } from './components/LeftPanel';
const SpireTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.SpireTab })));
const SkillsTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.SkillsTab })));
const SpellsTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.SpellsTab })));
const LabTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.LabTab })));
const StatsTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.StatsTab })));
const EquipmentTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.EquipmentTab })));
const AttunementsTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.AttunementsTab })));
@@ -72,7 +72,7 @@ function GrimoireTab() {
}
return [];
});
const loaded = grimoireSpells.length > 0 || (typeof window !== 'undefined' && !SPELLS_DEF);
const loaded = typeof window !== 'undefined';
if (!loaded) {
return <div className="p-4 text-center text-gray-400">Loading grimoire...</div>;
@@ -142,6 +142,7 @@ export default function ManaLoopGame() {
const prestigeUpgrades = usePrestigeStore((s) => s.prestigeUpgrades);
const insight = usePrestigeStore((s) => s.insight);
const loopInsight = usePrestigeStore((s) => s.loopInsight);
const rawMana = useManaStore((s) => s.rawMana);
const meditateTicks = useManaStore((s) => s.meditateTicks);
@@ -221,7 +222,7 @@ export default function ManaLoopGame() {
// Conditional returns AFTER all hooks
if (gameOver) {
return <GameOverScreen store={{ day, hour, insight }} />;
return <GameOverScreen day={day} hour={hour} insightGained={loopInsight} totalInsight={insight} />;
}
if (!mounted) return <div className="p-4 text-center text-gray-400">Loading...</div>;
@@ -256,7 +257,7 @@ export default function ManaLoopGame() {
<TabsTrigger value="crafting" className="text-xs px-2 py-1">🔧 Craft</TabsTrigger>
<TabsTrigger value="loot" className="text-xs px-2 py-1">💎 Loot</TabsTrigger>
<TabsTrigger value="achievements" className="text-xs px-2 py-1">🏆 Achieve</TabsTrigger>
<TabsTrigger value="lab" className="text-xs px-2 py-1">🔬 Lab</TabsTrigger>
<TabsTrigger value="stats" className="text-xs px-2 py-1">📊 Stats</TabsTrigger>
<TabsTrigger value="debug" className="text-xs px-2 py-1">🐛 Debug</TabsTrigger>
<TabsTrigger value="grimoire" className="text-xs px-2 py-1">📖 Grimoire</TabsTrigger>
@@ -265,7 +266,7 @@ export default function ManaLoopGame() {
<TabsContent value="spire">
<ErrorBoundary fallback={<div className="p-4 text-red-400">spire tab failed to load.</div>}>
<Suspense fallback={<TabLoadingFallback />}>
<SpireTab />
<SpireTab simpleMode={spireMode} />
</Suspense>
</ErrorBoundary>
</TabsContent>
@@ -334,13 +335,7 @@ export default function ManaLoopGame() {
</ErrorBoundary>
</TabsContent>
<TabsContent value="lab">
<ErrorBoundary fallback={<div className="p-4 text-red-400">lab tab failed to load.</div>}>
<Suspense fallback={<TabLoadingFallback />}>
<LabTab />
</Suspense>
</ErrorBoundary>
</TabsContent>
<TabsContent value="stats">
<ErrorBoundary fallback={<div className="p-4 text-red-400">stats tab failed to load.</div>}>