From e2c93d96521115229ba2d7b74e3dff23f1392730 Mon Sep 17 00:00:00 2001 From: dnviti Date: Sun, 14 Dec 2025 21:19:21 +0100 Subject: [PATCH] chore: Remove tournament mode feature and its associated UI from the Cube Manager, simplifying pack display. --- docs/development/CENTRAL.md | 1 + ...025-12-14-211500_remove_tournament_mode.md | 18 +++++ .../src/components/TournamentPackView.tsx | 75 ------------------- src/client/src/modules/cube/CubeManager.tsx | 37 +++------ 4 files changed, 30 insertions(+), 101 deletions(-) create mode 100644 docs/development/devlog/2025-12-14-211500_remove_tournament_mode.md delete mode 100644 src/client/src/components/TournamentPackView.tsx diff --git a/docs/development/CENTRAL.md b/docs/development/CENTRAL.md index 885a7ff..eb404cf 100644 --- a/docs/development/CENTRAL.md +++ b/docs/development/CENTRAL.md @@ -7,6 +7,7 @@ The project has successfully migrated from a .NET backend to a Node.js Modular M - **[2025-12-14] Core Implementation**: Refactored `gemini-generated.js` into modular services and components. Implemented Cube Manager and Tournament Manager. [Link](./devlog/2025-12-14-194558_core_implementation.md) - **[2025-12-14] Parser Robustness**: Improving `CardParserService` to handle formats without Scryfall IDs (e.g., Arena exports). [Link](./devlog/2025-12-14-210000_fix_parser_robustness.md) - **[2025-12-14] Set Generation**: Implemented full set fetching and booster box generation (Completed). [Link](./devlog/2025-12-14-211000_set_based_generation.md) +- **[2025-12-14] Cleanup**: Removed Tournament Mode and simplified pack display as requested. [Link](./devlog/2025-12-14-211500_remove_tournament_mode.md) ## Active Modules 1. **Cube Manager**: Fully functional (Parsing, Fetching, Pack Generation). diff --git a/docs/development/devlog/2025-12-14-211500_remove_tournament_mode.md b/docs/development/devlog/2025-12-14-211500_remove_tournament_mode.md new file mode 100644 index 0000000..3c14f32 --- /dev/null +++ b/docs/development/devlog/2025-12-14-211500_remove_tournament_mode.md @@ -0,0 +1,18 @@ +# Cleanup: Remove Tournament Mode + +## Status: Completed + +## Summary +Removed the "Tournament Mode" view and "Editor Mode" toggle from the Cube Manager. The user requested a simplified interface that lists packs without grouping them into "Boxes". + +## Changes +1. **CubeManager.tsx**: + * Removed `tournamentMode` state and setter. + * Removed usage of `TournamentPackView` component. + * Removed the "Tournament Mode / Editor Mode" toggle button. + * Simplified rendering to always show the pack list (grid/list/stack view) directly. + * Removed unsused `TournamentPackView` import and icon imports. + +## Impact +* The UI is now streamlined for the "Host" to just see generated packs. +* The `TournamentPackView` component is no longer used but file remains for now. diff --git a/src/client/src/components/TournamentPackView.tsx b/src/client/src/components/TournamentPackView.tsx deleted file mode 100644 index 1ed6a53..0000000 --- a/src/client/src/components/TournamentPackView.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import React from 'react'; -import { Target, Package, Layers } from 'lucide-react'; -import { Pack } from '../services/PackGeneratorService'; - -interface TournamentPackViewProps { - packs: Pack[]; -} - -export const TournamentPackView: React.FC = ({ packs }) => { - const packsBySet = packs.reduce((acc, pack) => { - const key = pack.setName || 'Unknown Set'; - if (!acc[key]) acc[key] = []; - acc[key].push(pack); - return acc; - }, {} as { [key: string]: Pack[] }); - - const BOX_SIZE = 30; - - return ( -
- {Object.entries(packsBySet).map(([setName, setPacks]) => { - const boxes = []; - for (let i = 0; i < setPacks.length; i += BOX_SIZE) boxes.push(setPacks.slice(i, i + BOX_SIZE)); - - return ( -
-
-
-

- {setName} -

-
-
- -
- {boxes.map((boxPacks, boxIndex) => ( -
-
- BOX {boxIndex + 1} - ({boxPacks.length} packs) -
- -
- {boxPacks.map((pack) => ( -
-
- - MTG -
-
-
#{pack.id}
-
{pack.setName}
-
- -
-
-

Contains {pack.cards.length} cards:

- {pack.cards.some(c => c.rarity === 'mythic' || c.rarity === 'rare') && ( -

★ Rare / Mythic

- )} -

Click for full list

-
-
-
- ))} -
-
- ))} -
-
- ); - })} -
- ); -}; diff --git a/src/client/src/modules/cube/CubeManager.tsx b/src/client/src/modules/cube/CubeManager.tsx index e2ab95f..731151c 100644 --- a/src/client/src/modules/cube/CubeManager.tsx +++ b/src/client/src/modules/cube/CubeManager.tsx @@ -1,10 +1,9 @@ import React, { useState, useRef, useEffect } from 'react'; -import { Layers, RotateCcw, Box, Check, Loader2, Upload, Eye, EyeOff, LayoutGrid, List, Sliders, Settings } from 'lucide-react'; +import { Layers, RotateCcw, Box, Check, Loader2, Upload, LayoutGrid, List, Sliders, Settings } from 'lucide-react'; import { CardParserService } from '../../services/CardParserService'; import { ScryfallService, ScryfallCard, ScryfallSet } from '../../services/ScryfallService'; import { PackGeneratorService, ProcessedPools, SetsMap, Pack, PackGenerationSettings } from '../../services/PackGeneratorService'; import { PackCard } from '../../components/PackCard'; -import { TournamentPackView } from '../../components/TournamentPackView'; export const CubeManager: React.FC = () => { // --- Services --- @@ -32,7 +31,6 @@ export const CubeManager: React.FC = () => { // UI State const [viewMode, setViewMode] = useState<'list' | 'grid' | 'stack'>('list'); - const [tournamentMode, setTournamentMode] = useState(false); // Generation Settings const [genSettings, setGenSettings] = useState({ @@ -106,7 +104,6 @@ export const CubeManager: React.FC = () => { setLoading(true); setPacks([]); setProgress(sourceMode === 'set' ? 'Fetching set data...' : 'Parsing text...'); - setTournamentMode(false); try { let expandedCards: ScryfallCard[] = []; @@ -164,7 +161,6 @@ export const CubeManager: React.FC = () => { alert(`Not enough cards to generate valid packs.`); } else { setPacks(newPacks); - setTournamentMode(false); } } catch (e) { console.error("Generation failed", e); @@ -372,20 +368,13 @@ export const CubeManager: React.FC = () => { {packs.length} Packs - {packs.length > 0 && ( - - )} - {!tournamentMode && ( -
- - - -
- )} +
+ + + +
{packs.length === 0 ? ( @@ -394,15 +383,11 @@ export const CubeManager: React.FC = () => {

No packs generated.

) : ( - tournamentMode ? ( - - ) : ( -
- {packs.map((pack) => ( - - ))} -
- ) +
+ {packs.map((pack) => ( + + ))} +
)}