From b6dcd74cc3e296ffb2de1d816005de2a96f047e9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 23:16:18 -0500 Subject: [PATCH] Play section: lobby, deck builder, match, results, tutorial Mobile-first game UI in src/game/, built against a UI-side EngineAdapter. A temporary mock 3-lane engine (src/game/mock/) stands in until shared/game lands. Tap a card, then tap a lane; bottom thumb dock; bottom sheets instead of hover; full-screen match on phones. Lobby lists local and peer modes (GET /api/game/modes, parsed defensively) and shows the eom.dev login state through a stub hook for the SSO team. Co-Authored-By: Claude Opus 5.5 --- src/App.tsx | 11 +-- src/game/DeckBuilder.tsx | 68 ++++++++++++++++ src/game/GameCard.tsx | 30 +++++++ src/game/MatchScreen.tsx | 153 ++++++++++++++++++++++++++++++++++ src/game/PlaySection.tsx | 97 ++++++++++++++++++++++ src/game/Results.tsx | 24 ++++++ src/game/Tutorial.tsx | 45 ++++++++++ src/game/adapter.ts | 13 +++ src/game/bots.ts | 16 ++++ src/game/cards.ts | 54 ++++++++++++ src/game/mock/engine.ts | 156 +++++++++++++++++++++++++++++++++++ src/game/play.css | 172 +++++++++++++++++++++++++++++++++++++++ src/game/types.ts | 94 +++++++++++++++++++++ src/game/useAccount.ts | 6 ++ src/game/useModes.ts | 42 ++++++++++ tests/ui-play.test.ts | 79 ++++++++++++++++++ 16 files changed, 1055 insertions(+), 5 deletions(-) create mode 100644 src/game/DeckBuilder.tsx create mode 100644 src/game/GameCard.tsx create mode 100644 src/game/MatchScreen.tsx create mode 100644 src/game/PlaySection.tsx create mode 100644 src/game/Results.tsx create mode 100644 src/game/Tutorial.tsx create mode 100644 src/game/adapter.ts create mode 100644 src/game/bots.ts create mode 100644 src/game/cards.ts create mode 100644 src/game/mock/engine.ts create mode 100644 src/game/play.css create mode 100644 src/game/types.ts create mode 100644 src/game/useAccount.ts create mode 100644 src/game/useModes.ts create mode 100644 tests/ui-play.test.ts diff --git a/src/App.tsx b/src/App.tsx index ca9d178..412ca7b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from 'react'; import { ArrowDownLeft, ArrowLeftRight, ArrowRight, ArrowUpRight, BookOpen, Check, ChevronRight, CircleHelp, Copy, Cpu, Download, ExternalLink, Globe2, Layers3, LayoutDashboard, LoaderCircle, - Pickaxe, Search, Shield, Sparkles, Wallet as WalletIcon, X } from 'lucide-react'; + Pickaxe, Search, Shield, Sparkles, Swords, Wallet as WalletIcon, X } from 'lucide-react'; import { rarity } from '../shared/protocol.ts'; import { CONSENSUS, NETWORK, isNftTrade, nftTransferMessage, testnetOwnerOf, transactionCardIds, type TestnetBlock, type TestnetSnapshot } from '../shared/testnet.ts'; @@ -13,10 +13,11 @@ import { ThemePicker } from './ThemePicker.tsx'; import { TradeDesk } from './TradeDesk.tsx'; import { IS_MAINNET, NETWORK_GENESIS_TIME, NETWORK_LABEL } from '../shared/network.ts'; import { StateClient } from '../shared/rpc-client.ts'; +import { PlaySection } from './game/PlaySection.tsx'; import './App.css'; import './testnet.css'; -type View = 'Discover' | 'My collection' | 'Block explorer' | 'Trade cards'; +type View = 'Discover' | 'Play' | 'My collection' | 'Block explorer' | 'Trade cards'; const short = (s: string) => s ? `${s.slice(0, 6)}…${s.slice(-4)}` : '—'; const asCard = (block: TestnetBlock): CardData => ({ article: block.article, hash: block.powHash, block }); const message = (error: unknown) => error instanceof Error ? error.message : 'Request failed. Please try again.'; @@ -161,8 +162,8 @@ export default function App() {