Fix Sub-Task 1: Spire UI Fixes (Bugs 1, 2, 3)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 5m12s

- Bug 1: Floor health display now reactive (uses Zustand store properly)
- Bug 2: Climb Down button now climbs floor-by-floor, exit only at floor 1
- Bug 3: Redesigned SpireTab as Spire Stats view, moved Enter Spire Mode button to SpireTab, moved activity log to SpireModeUI

Changes:
- Added climbDownFloor() action to store.ts
- Modified exitSpireMode() to only work at floor 1
- Updated SpireTab.tsx: removed Current Floor stat, added Enter Spire Mode button
- Updated page.tsx: Climb Down climbs one floor, added Exit Spire button at floor 1, moved activity log to SpireModeUI
This commit is contained in:
Refactoring Agent
2026-04-27 11:15:54 +02:00
parent 900c0e8fe9
commit 35c69809a1
4 changed files with 301 additions and 208 deletions
+45 -9
View File
@@ -254,21 +254,57 @@ export default function ManaLoopGame() {
<DebugName name="SpireModeUI">
<div className="flex items-center justify-between mb-4">
<h2 className="text-2xl font-bold game-title text-amber-400">
🏔 Spire Mode
🏔 Spire Mode - Floor {store.currentFloor}
</h2>
<Button
variant="outline"
className="border-blue-600/50 text-blue-400 hover:bg-blue-900/20"
onClick={() => store.exitSpireMode()}
>
<ChevronDown className="w-4 h-4 mr-2" />
Climb Down
</Button>
<div className="flex gap-2">
<Button
variant="outline"
className="border-blue-600/50 text-blue-400 hover:bg-blue-900/20"
onClick={() => store.climbDownFloor()}
>
<ChevronDown className="w-4 h-4 mr-2" />
Climb Down
</Button>
{store.currentFloor === 1 ? (
<Button
variant="default"
className="bg-green-600 hover:bg-green-700"
onClick={() => store.exitSpireMode()}
>
Exit Spire
</Button>
) : (
<span className="text-xs text-gray-400 flex items-center">
Reach floor 1 to exit
</span>
)}
</div>
</div>
<Suspense fallback={<TabLoadingFallback />}>
<SpireTab store={store} simpleMode={true} />
</Suspense>
{/* Activity Log for Spire Mode */}
<Card className="bg-gray-900/80 border-gray-700">
<CardHeader className="pb-2">
<CardTitle className="text-amber-400 game-panel-title text-xs">Activity Log</CardTitle>
</CardHeader>
<CardContent>
<ScrollArea className="h-32">
<div className="space-y-1">
{store.log.slice(0, 20).map((entry, i) => (
<div
key={i}
className={`text-sm ${i === 0 ? 'text-gray-200' : 'text-gray-500'} italic`}
>
{entry}
</div>
))}
</div>
</ScrollArea>
</CardContent>
</Card>
</DebugName>
</div>
) : (