feat: Implement pack count validation for online play, adding a dynamic rules tooltip and button state based on available packs.
All checks were successful
Build and Deploy / build (push) Successful in 1m21s

This commit is contained in:
2025-12-17 02:32:58 +01:00
parent 3194be382f
commit 80de286777
5 changed files with 107 additions and 5 deletions

View File

@@ -71,3 +71,5 @@
- [Enhanced Toast Visibility](./devlog/2025-12-17-023000_enhanced_toast_visibility.md): Completed. Updated toasts to be top-center, animated, and highly visible with premium styling.
- [Unified Toast Design](./devlog/2025-12-17-023500_unified_toast_design.md): Completed. Refined toast aesthetics to match the global dark/slate theme with subtle colored accents.
- [Animated Copy Button](./devlog/2025-12-17-024000_animated_copy_button.md): Completed. Replaced copy toast with an in-place animated tick button for immediate feedback.
- [Play Online Logic](./devlog/2025-12-17-031500_play_online_logic.md): Completed. Implemented strict pack limits (min 12 for 4 players) and visual feedback for the online lobby button.
- [Lobby Rules Tooltip](./devlog/2025-12-17-032000_lobby_rules_tooltip.md): Completed. Added dynamic rules explanation and supported player indicators to the lobby creation screen.

View File

@@ -0,0 +1,19 @@
### Play Online Logic Implementation
**Status**: Completed
**Date**: 2025-12-17
**Description**
Implemented pack count validation logic for "Play Online" to strictly enforce draft player limits.
**Changes**
1. **Rule Enforcement**:
- **< 12 packs**: Button visual disabled (slate color), shows error toast explaining rules if clicked.
- **12-17 packs**: Allows entry, shows toast "Enough for 4 players only" (Info).
- **18-23 packs**: Allows entry, shows toast "Enough for 4 or 6 players" (Info).
- **24+ packs**: Allows entry, shows toast "Enough for 8 players!" (Success).
2. **UI Feedback**: Updated button class logic to visually reflect availability based on pack count.
**Effect**
Prevents users from starting unplayable drafts and informs them of the capacity their current pool supports.

View File

@@ -0,0 +1,16 @@
### Lobby Rules Tooltip
**Status**: Completed
**Date**: 2025-12-17
**Description**
Added a dynamic tooltip and status indicator to the Online Lobby to explain draft capacity rules based on pack count.
**Changes**
1. **Info Icon**: Added an `AlertCircle` icon with a hoverable tooltip explaining the pack requirements (3 packs/player).
2. **Dynamic Rules**: The list of rules highlights the currently applicable tier based on pack count (e.g., turning green for "12-17 Packs" if 15 packs are available).
3. **Status Line**: A summary line explicitly states "Supported Players: [Status]" under the pack count.
**Effect**
Users can now clearly see why they might need more packs before creating a room, and what player counts are supported with their current pool.