feat: recreate Debug Tab with modular debugging functions
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m17s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m17s
- Add DebugTab.tsx as main container with collapsible sections - Add 8 debug section components in DebugTab/ subdirectory: - GameStateDebugSection: reset, mana, time, pause controls - DisciplineDebugSection: activate/deactivate, add XP - AttunementDebugSection: unlock, add XP - ElementDebugSection: unlock all, add elemental mana - GolemDebugSection: enable/disable golems - PactDebugSection: force sign/clear pacts - SpireDebugSection: jump floors, toggle spire mode - AchievementDebugSection: unlock/reset achievements - Add DebugTab to barrel export (tabs/index.ts) - Add lazy-loaded Debug tab to page.tsx - Add DebugTab.test.ts with 45 tests - All files under 400 lines - Uses existing debug context (DebugProvider, DebugName) - Destructive actions require confirmation (double-click pattern)
This commit is contained in:
@@ -44,6 +44,7 @@ import { LeftPanel } from './components/LeftPanel';
|
||||
const DisciplinesTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.DisciplinesTab })));
|
||||
const SpellsTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.SpellsTab })));
|
||||
const StatsTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.StatsTab })));
|
||||
const DebugTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.DebugTab })));
|
||||
const AchievementsTab = lazy(() => import('@/components/game/tabs').then(module => ({ default: module.AchievementsTab })));
|
||||
|
||||
const TabLoadingFallback = () => <div className="p-4 text-center text-gray-400">Loading...</div>;
|
||||
@@ -234,6 +235,7 @@ export default function ManaLoopGame() {
|
||||
<TabsTrigger value="stats" className="text-xs px-2 py-1">📊 Stats</TabsTrigger>
|
||||
<TabsTrigger value="disciplines" className="text-xs px-2 py-1">📚 Disciplines</TabsTrigger>
|
||||
<TabsTrigger value="grimoire" className="text-xs px-2 py-1">📖 Grimoire</TabsTrigger>
|
||||
<TabsTrigger value="debug" className="text-xs px-2 py-1">🐛 Debug</TabsTrigger>
|
||||
<TabsTrigger value="achievements" className="text-xs px-2 py-1">🏆 Achievements</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
@@ -265,6 +267,14 @@ export default function ManaLoopGame() {
|
||||
<GrimoireTab />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="debug">
|
||||
<ErrorBoundary fallback={<div className="p-4 text-red-400">debug tab failed to load.</div>}>
|
||||
<Suspense fallback={<TabLoadingFallback />}>
|
||||
<DebugTab />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="achievements">
|
||||
<ErrorBoundary fallback={<div className="p-4 text-red-400">achievements tab failed to load.</div>}>
|
||||
<Suspense fallback={<TabLoadingFallback />}>
|
||||
|
||||
Reference in New Issue
Block a user