feat(ui): per-kind active-game limit lock on the New Game screen #235
Reference in New Issue
Block a user
Delete Branch "feature/e8-guest-limits-client"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Client half of the active-game limits (follows the backend/admin PR): the per-kind lock on the New Game screen.
Wire (additive, forward-compatible — no contour wipe)
Profile.game_limits(GameLimits{vs_ai, random, friends}, the caller's tier resolved server-side) +GameView.kind— appended FBS fields + a newGameLimitstable (committed regen). Threaded backend DTO → gateway transcode → client codec. Old clients ignore the new fields; a new client on an old backend degrades to no lock.Client
gamelimits.ts(pure): count active games per kind from the lobby, resolve the tier cap, decide the lock.GameLimitModalinstead of a game — native (TelegramshowPopup) or the in-appModalelsewhere. A guest sees a sign-in funnel (Отмена / Вход →/settings); a durable account sees a plain "finish a current game first" notice (ОК). The lock lifts via the existing profile refetch after a guest→durable upgrade.Lobby behaviour change (owner-agreed)
The old
at_game_limitNew-Game tab disable + notice is removed. That flag (now the random-kind cap) conflicted with the per-kind lock — it hid the New Game screen where the lock lives and wrongly blocked starting an unfulfilled kind. The tab is always enabled; the per-kind start lock is the only gate. TheGameList.at_game_limitwire field stays (unused by the client) for a later cleanup.Tests
gamelimits.ts(count/cap/lock), codeckind+game_limitsroundtrip, gateway transcodegame_limitsencode, the native popup builders.gamelimit.spec.ts, rewritten): a capped start shows 🔒, opens the modal without navigating, OK dismisses, and the lock clears when the profile refetch lifts the cap (chromium + webkit).Full local suite green:
go build/vet/gofmt+ backend/gateway tests;svelte-check,vitest(567),pnpm build, Playwright.After this merges, E8 is complete — next is the prod deploy of E5-E8 (the monetization launch).