diff --git a/Client/context-files/global.md b/Client/context-files/global.md index 20c4b51..8ae4e89 100644 --- a/Client/context-files/global.md +++ b/Client/context-files/global.md @@ -5,6 +5,11 @@ - `Report Bug` button is present in every scene. - Placement and interaction pattern must remain consistent across scenes. +## Global Scene Transition Rules +- Ordered startup/auth flow: `ClientLaunch` -> `Login` -> `MainMenu`. +- `Register` is reachable from `Login` and returns to `Login` unless server returns immediate auth tokens. +- Gameplay scenes are reachable from lobby scenes (`RankedPlay`, `CustomPlay`) only after server-authoritative match start. + ## Shared Transport Notes - Persistent real-time session to relay/hub for presence + notifications. - HTTPS API calls for auth/account/content operations. @@ -19,6 +24,11 @@ - Scene-specific controls may add actions, but must not override baseline navigation behavior. - Input remapping and accessibility options should apply globally, not per-scene. +## Global Social/Chat Rules +- Baseline channels: `System`, `General`, `Friends`. +- Friend moderation actions where identity is visible: `Add Friend`, `Remove Friend`, `Block`. +- Lobby-specific channel sections are context-sensitive and shown only inside the active lobby scene. + ## Security and Validation Baseline - Server authoritative for identity/session, ownership, deck legality, and entitlements. - Client authoritative for rendering and non-authoritative UI state (filters/sorts). diff --git a/Client/context-files/scenes.md b/Client/context-files/scenes.md index 09a66ef..dddaac2 100644 --- a/Client/context-files/scenes.md +++ b/Client/context-files/scenes.md @@ -1,26 +1,38 @@ # Scenes Index -This file is the top-level map. Scene details now live in `context-files/scenes/*.scene.md`. +This file is the canonical client flow map. Scene details live in `context-files/scenes/*.scene.md`. -## Boot + Session -1. `ClientLaunch` (includes patch/version check) → `scenes/client-launch.scene.md` +## Core Lifecycle Flow +1. `ClientLaunch` -> `scenes/client-launch.scene.md` +2. `Login` -> `scenes/login.scene.md` +3. `Register` (from Login) -> `scenes/register.scene.md` +4. `MainMenu` (post-auth hub) -> `scenes/main-menu.scene.md` -## Auth -2. `Login` (includes hub connection, session probe, and OAuth start/callback flows) → `scenes/login.scene.md` -3. `Register` → `scenes/register.scene.md` +Flow rules: +- `ClientLaunch` must complete update check before opening auth flow. +- `Login` owns initial connection/session probe and transitions to `MainMenu` only after auth success. +- `Register` returns to `Login` (or direct session bootstrap if server returns tokens). -## Primary App -4. `MainMenu` → `scenes/main-menu.scene.md` -5. `Bazaar` → `scenes/bazaar.scene.md` -6. `Leaderboard` → `scenes/leaderboard.scene.md` -7. `Settings` → `scenes/settings.scene.md` -8. `AccountManagement` → `scenes/account-management.scene.md` -9. `CollectionHub` → `scenes/collection-hub.scene.md` -10. `RankedPlay` → `scenes/ranked-play.scene.md` -11. `CustomPlay` → `scenes/custom-play.scene.md` -12. `DeckEditor` → `scenes/deck-editor.scene.md` -13. `CardViewer` → `scenes/card-viewer.scene.md` -14. `Cosmetics` → `scenes/cosmetics.scene.md` +## Main Menu Navigation Map +Primary destinations: +1. `RankedPlay` (ranked lobby + matchmaking) -> `scenes/ranked-play.scene.md` +2. `CustomPlay` (unranked/custom lobby) -> `scenes/custom-play.scene.md` +3. `Bazaar` -> `scenes/bazaar.scene.md` +4. `Leaderboard` -> `scenes/leaderboard.scene.md` +5. `CollectionHub` -> `scenes/collection-hub.scene.md` +6. `AccountManagement` -> `scenes/account-management.scene.md` +7. `Settings` -> `scenes/settings.scene.md` + +Collection subtree: +1. `DeckEditor` -> `scenes/deck-editor.scene.md` +2. `CardViewer` -> `scenes/card-viewer.scene.md` +3. `Cosmetics` -> `scenes/cosmetics.scene.md` + +## Cross-Scene UI Requirements +- Persistent quick actions: `Settings` and `Report Bug` in all scenes. +- Main social/chat panel channels: `System`, `General`, `Friends`. +- Friend actions available where identity is visible: `Add Friend`, `Remove Friend`, `Block`. +- Ranked/unranked lobby-specific chat sections appear only while inside those lobbies. ## Global Rules - Shared/global client rules are in `global.md`. diff --git a/Client/context-files/scenes/client-launch.scene.md b/Client/context-files/scenes/client-launch.scene.md index 52d1126..7940c7f 100644 --- a/Client/context-files/scenes/client-launch.scene.md +++ b/Client/context-files/scenes/client-launch.scene.md @@ -12,7 +12,7 @@ - Initialize telemetry/session id. - Perform client/content version check during launch. - If update required: show patch flow, apply update, and continue. -- If up-to-date: transition to `HubConnection`. +- If up-to-date: initialize transport prerequisites and transition to `Login`. ## Server - Provide version support status and update manifest metadata. diff --git a/Client/context-files/scenes/custom-play.scene.md b/Client/context-files/scenes/custom-play.scene.md index dbbf36e..6352df8 100644 --- a/Client/context-files/scenes/custom-play.scene.md +++ b/Client/context-files/scenes/custom-play.scene.md @@ -1,9 +1,56 @@ -# Custom play Scene +# CustomPlay Scene (Unranked Lobby) -## Status -Draft placeholder. +## UI +- Custom games list +- Filter controls (open slots, format/rules tags, region, friends-only) +- Game row indicators for key rule categories +- Rules detail tooltip/panel on hover/focus with full ruleset display +- Create custom game panel: + - lobby name + - privacy + - ruleset configuration + - deck/archspirit constraints + - max players/spectators +- Lobby chat subsection: + - unranked/custom channels visible while in this scene -## Planned Scope -- Define scene UI blocks -- Define client interactions -- Define server contract and payloads +## Client +- Fetch and render open custom games with summary rule indicators. +- Show full ruleset details on hover/focus without requiring join. +- Allow joining joinable games. +- Allow creating custom game with configurable rules. +- Transition to gameplay scene when lobby host starts match. + +## Server +- Return browseable custom game lobbies and summarized rule metadata. +- Validate join permissions and slot availability. +- Validate and persist custom ruleset configuration on create/update. +- Publish lobby state changes and match start event. + +## Data Exchange +### Client -> Server (`CustomLobbyListRequest`) +- `requestId`, `filters`, `sort`, `page`, `pageSize` + +### Server -> Client (`CustomLobbyListResponse`) +- `requestId`, `results`, `totalCount` + +### Client -> Server (`CustomLobbyRulesRequest`) +- `requestId`, `customLobbyId` + +### Server -> Client (`CustomLobbyRulesResponse`) +- `requestId`, `customLobbyId`, `ruleset` + +### Client -> Server (`CustomLobbyJoinRequest`) +- `requestId`, `customLobbyId`, `deckId`, `archspiritId` + +### Server -> Client (`CustomLobbyJoinResponse`) +- `requestId`, `success`, `customLobbyState`, `errorCode` + +### Client -> Server (`CustomLobbyCreateRequest`) +- `requestId`, `name`, `privacy`, `ruleset`, `formatId`, `deckConstraints`, `archspiritConstraints`, `maxPlayers`, `maxSpectators` + +### Server -> Client (`CustomLobbyCreateResponse`) +- `requestId`, `success`, `customLobbyId`, `customLobbyState`, `errorCode` + +### Server -> Client (`CustomMatchStarting`) +- `requestId`, `customLobbyId`, `matchId`, `rulesetId`, `gameServerEndpoint`, `matchToken` diff --git a/Client/context-files/scenes/login.scene.md b/Client/context-files/scenes/login.scene.md index fde41ec..3769f46 100644 --- a/Client/context-files/scenes/login.scene.md +++ b/Client/context-files/scenes/login.scene.md @@ -7,6 +7,7 @@ - Password field - Remember device toggle - Submit + Forgot Password actions +- `Create Account` action to open `Register` - OAuth provider buttons (Google/Steam/Apple/Microsoft as enabled) - Session check/loading indicator - OAuth status text + callback verification state @@ -18,6 +19,8 @@ - Perform session probe after connection is established. - Decide path: existing session refresh, password login, or OAuth login. - Start OAuth flow and handle OAuth callback exchange in this scene. +- Route `Forgot Password` to account recovery flow. +- Route `Create Account` to `Register`. - On success transition to `MainMenu`. ## Server diff --git a/Client/context-files/scenes/main-menu.scene.md b/Client/context-files/scenes/main-menu.scene.md index f5c75c0..089aac6 100644 --- a/Client/context-files/scenes/main-menu.scene.md +++ b/Client/context-files/scenes/main-menu.scene.md @@ -4,8 +4,12 @@ - Navigation nodes/buttons to: - `Bazaar`, `Leaderboard`, `Settings`, `AccountManagement`, `CollectionHub`, `RankedPlay`, `CustomPlay` - Profile summary widget -- Notifications widget +- Notifications widget with popup modal support for updates, news, and account alerts - Settings/logout actions +- Chat panel: + - channel tabs: `System`, `General`, `Friends` + - friend moderation/actions: `Add Friend`, `Remove Friend`, `Block` + - lobby-aware sections that appear while inside ranked or custom lobbies - Interactive background: - dark aura visual treatment - rotatable 3D grid layer @@ -17,14 +21,15 @@ - node selection via left click and middle mouse click ## Client -- Display entry points and key account notifications. +- Display entry points, key account notifications, and social/chat state. +- Apply feature flags and queue/lobby presence to determine which nav nodes and chat subsections are visible. ## Server -- Return role/entitlement menu permissions, badge counts, feature flags. +- Return role/entitlement menu permissions, badge counts, feature flags, chat channel permissions, and presence state. ## Data Exchange ### Client -> Server (`MainMenuBootstrapRequest`) - `requestId`, `accountId`, `clientVersion` ### Server -> Client (`MainMenuBootstrapResponse`) -- `requestId`, `profileSummary`, `roles`, `featureFlags`, `menuPermissions`, `notificationCounts`, `rankedSummary` +- `requestId`, `profileSummary`, `roles`, `featureFlags`, `menuPermissions`, `notificationCounts`, `rankedSummary`, `chatChannels`, `friendSummary`, `presenceState` diff --git a/Client/context-files/scenes/ranked-play.scene.md b/Client/context-files/scenes/ranked-play.scene.md index 57d105c..78f09b0 100644 --- a/Client/context-files/scenes/ranked-play.scene.md +++ b/Client/context-files/scenes/ranked-play.scene.md @@ -1,9 +1,51 @@ -# Ranked play Scene +# RankedPlay Scene -## Status -Draft placeholder. +## UI +- Ranked lobby header (season, rank, queue health) +- Loadout panel: + - selected deck + - selected archspirit + - deck legality status for ranked ruleset +- Queue actions: + - `Join Queue` + - `Leave Queue` +- Matchmaking status panel: + - elapsed queue time + - estimated wait range + - cancellation state +- Lobby chat subsection: + - ranked-only channel visibility while in this scene -## Planned Scope -- Define scene UI blocks -- Define client interactions -- Define server contract and payloads +## Client +- Load ranked eligibility and current competitive profile. +- Require valid deck + archspirit selection before enabling `Join Queue`. +- Submit ranked queue request and transition to matchmaking state. +- On match found, lock queue interactions and transition to gameplay scene with ranked ruleset payload. + +## Server +- Return ranked season/profile data and queue eligibility. +- Validate selected deck against ranked format/rules. +- Enqueue/dequeue player for ranked matchmaking. +- Emit match-found payload with authoritative match seed and ruleset. + +## Data Exchange +### Client -> Server (`RankedLobbyBootstrapRequest`) +- `requestId`, `accountId`, `clientVersion` + +### Server -> Client (`RankedLobbyBootstrapResponse`) +- `requestId`, `seasonSummary`, `rankedProfile`, `queueEligibility`, `formatId`, `rulesVersion` + +### Client -> Server (`RankedQueueJoinRequest`) +- `requestId`, `deckId`, `archspiritId`, `formatId` + +### Server -> Client (`RankedQueueJoinResponse`) +- `requestId`, `success`, `queueTicketId`, `estimatedWaitSeconds`, `errorCode` + +### Client -> Server (`RankedQueueLeaveRequest`) +- `requestId`, `queueTicketId` + +### Server -> Client (`RankedQueueLeaveResponse`) +- `requestId`, `success`, `errorCode` + +### Server -> Client (`RankedMatchFound`) +- `requestId`, `queueTicketId`, `matchId`, `rulesetId`, `opponentSummary`, `acceptDeadlineUtc`, `gameServerEndpoint`, `matchToken` diff --git a/Client/context-files/scenes/register.scene.md b/Client/context-files/scenes/register.scene.md index db88f9e..4127fb2 100644 --- a/Client/context-files/scenes/register.scene.md +++ b/Client/context-files/scenes/register.scene.md @@ -1,20 +1,26 @@ # Register Scene ## UI -- Email/username/password inputs +- Username input +- Email input +- Password input +- Confirm password input - Terms/privacy acceptance controls -- Submit action + validation messages +- Submit/Cancel actions + validation messages ## Client - Submit account fields and required agreements. -- On success transition to `MainMenu`. +- Validate password/confirm password match before submit. +- On success: + - if auth tokens are returned, transition to `MainMenu` + - otherwise return to `Login` with success message ## Server -- Create account, validate uniqueness, persist agreements. +- Create account, validate username/email uniqueness, persist agreements. ## Data Exchange ### Client -> Server (`RegisterRequest`) -- `requestId`, `email`, `username`, `password`, `countryCode`, `dob`, `acceptedPolicies` +- `requestId`, `email`, `username`, `password`, `confirmPassword`, `countryCode`, `dob`, `acceptedPolicies` ### Server -> Client (`RegisterResponse`) - `requestId`, `success`, `accessToken` (optional), `refreshToken` (optional), `accountSummary` (optional), `requiresEmailVerification`, `errorCode`