Das Problem liegt in OnParametersSetAsync(). Wenn SelectNone() aufgerufen wird:
1. _selectedIds wird geleert
2. NotifySelectionChanged() benachrichtigt Parent
3. Parent aktualisiert Parameter → OnParametersSetAsync() wird erneut aufgerufen
4. Auto-select Logik Zeile 103-106 wählt alle wieder aus!
Fix: Auto-select nur beim ersten Laden ausführen:
Behoben. Das _initialized Flag verhindert nun, dass die Auto-Select-Logik bei jedem Parameter-Update läuft - nur noch beim ersten Laden der Komponente.
Neue Datei erstellt:
- src/Koogle.Web/Components/Game/PlayerSelectorDialog.razor - Dialog zur manuellen Spielerauswahl
Geändert:
- src/Koogle.Web/Components/Pages/Days/DayDetails.razor:863-891 - ShowPlayerSelector implementiert
Funktionsweise:
1. Bei ParticipantsMode.FreeToChoose zeigt GameInputPanel.razor:23-32 den Button "Spieler wechseln"
2. Der neue Dialog listet alle Spieler aus Participants.PlayerIds
3. Bei DeathBox werden ausgeschiedene Spieler standardmäßig ausgeblendet (Toggle verfügbar)
4. Bei Spielerauswahl wird SetCurrentPlayerAction dispatcht
Features:
- Aktueller Spieler ist markiert (grün)
- Ausgeschiedene Spieler sind durchgestrichen mit "Ausgeschieden"-Badge
- Optional können ausgeschiedene Spieler eingeblendet werden (falls nötig)
- Funktioniert mit allen Game-Typen (DeathBox, Shit, Training)
Summary of Changes:
Phase 1-3 (Domain/Infrastructure/Application):
- ThrowEventType enum with Strike, Circle, Bell, Gutter flags
- ClubGif, ClubGifRating, GifSubmissionToken entities
- EF configurations with proper indexes
- ClubGifRepository with weighted random selection
- MediaStorageService for file storage (wwwroot/club-media/{LoginName}/gifs/)
- ClubGifService with rating system and auto-disable at -5 threshold
Phase 4-5 (Admin UI & Playback):
- Admin page at /club/{ClubId}/admin/gifs with Upload, Import, Edit, Token management
- QR code generation for submission tokens
- GifPlayer component with overlay, rating buttons, and dismiss
- Fluxor state management (GifState, actions, reducers, effects)
Phase 6 (Anonymous Submission):
- Public page at /gif/submit/{Token} with EmptyLayout
- Token validation and file upload
Phase 7 (Game Integration + Migration):
- Database migration AddClubGifFeature applied
- GameEffects.TriggerGifForEventsAsync triggers GIFs on special throws
- SignalR broadcast via BroadcastGifTriggeredAsync to all clients
- DayDetails.razor includes GifPlayer and handles SignalR GIF events
Key Features:
- GIFs play on Strike (alle 9), Circle (Kranz), Bell (Glocke), Gutter (Rinne)
- Weighted random selection based on ratings
- Real-time sync across all connected clients via SignalR
- Thumbs up/down rating with auto-disable at -5
- Max file size: 20MB, Video duration: 15s
- Supports GIF, MP4, WebM formats
Zusammenfassung der Fixes:
1. Fix 1 (HandlePinClick und HandleNumberClick): _hasModifiedPins = true wird jetzt VOR dem Dispatch gesetzt, um zu verhindern, dass OnGameStateChanged den Before-State während der Pin-Modifikation überschreibt.
2. Fix 2 (ConfirmThrow): Nach dem Dispatch wird explizit CaptureBeforeThrowState() aufgerufen. Das ist der wichtigste Fix:
- Nach RecordThrowAction Dispatch sind alle Reducer/Effects durchgelaufen
- Der State ist bereits mit den neuen Pin-Zuständen aktualisiert
- _beforeThrowState wird mit dem NEUEN Zustand für den nächsten Wurf erfasst
Vorher wurde _beforeThrowState nie nach einem Wurf aktualisiert (weil _hasModifiedPins zum falschen Zeitpunkt gesetzt war), sodass beim zweiten Wurf der stale Before-State verwendet wurde.
- Add UndoButton.razor as reusable component
- Refactor GameInputPanel to use UndoButton component
- Enhance GameEffects with proper UndoThrowAction handler
- IState injection for state access in effects
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GameBoardPanel: Dynamic board component rendering
- CompletedGamesList: Shows game history for day
- DayDetails: 3 tabs (Details/Eingabe/Tafel) + Start/End Game buttons
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GameTypeSelector: Select game type from registry
- ParticipantSelector: Multi-select participants from day
- CommonSetupOptions: ThrowMode, ThrowsPerRound, ParticipantsMode
- GameSetupDialog: Full setup wizard with DynamicComponent
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- TrainingGameDefinition with game type metadata
- TrainingGameModel + TrainingPlayerStats for stats tracking
- TrainingGameLogicService implementing game logic
- TrainingSetup.razor for config (ThrowMode, ThrowsPerRound, ParticipantsMode)
- TrainingBoard.razor showing player stats table with totals/averages
- Game type registration in Program.cs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>