Stage 17 #5: hide finished games from your own lobby list
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 11s
CI / ui (pull_request) Successful in 35s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 2m16s

A player can remove a finished game from their own 'my games' list. The action is
per-account, finished-only and irreversible (the game stays for the other players;
there is no un-hide).

- backend: migration 00012 game_hidden(account_id, game_id); store HideGame +
  hiddenGameIDs + ListGamesForAccount filtering; service HideGame (seat + finished
  checks, reusing ErrNotAPlayer / ErrGameActive); POST /api/v1/user/games/:id/hide.
- gateway: game.hide edge op (reuses GameActionRequest -> Ack) + backendclient.HideGame.
- ui: finished rows reveal a delete via swipe-left (touch) or a kebab tap (desktop),
  active rows get an inert chevron for icon alignment; optimistic removal + lobby-cache
  sync; mock + transport + client wiring; lobby.hideGame label (en/ru).
- tests: integration (active->ErrGameActive, outsider->ErrNotAPlayer, per-account,
  idempotent), gateway transcode round-trip, mock e2e (kebab -> delete); hardened a
  pre-existing chat-screen .back transition flake surfaced by the new test's timing.
- docs: ARCHITECTURE persistence list, FUNCTIONAL (+ _ru) lobby story, PLAN tracker.
This commit is contained in:
Ilia Denisov
2026-06-09 00:26:35 +02:00
parent a7c566d2d1
commit 4999478ded
21 changed files with 425 additions and 17 deletions
+3
View File
@@ -170,6 +170,9 @@ test('chat and word-check open as their own screens and back to the game (Stage
await expect(page).toHaveURL(/\/game\/g1\/chat$/);
await expect(page.locator('.pane')).toHaveCount(1); // let the slide transition settle
await expect(page.locator('.chat')).toBeVisible();
// The outgoing game header and the incoming chat header both carry a .back mid-slide; wait
// for the game's to unmount so the click targets a single, settled button.
await expect(page.locator('.back')).toHaveCount(1);
await page.locator('.back').click(); // header back chevron returns to the game
await expect(page).toHaveURL(/\/game\/g1$/);
await expect(page.locator('.pane')).toHaveCount(1);
+21
View File
@@ -86,6 +86,27 @@ test('finished game draws an inert footer and trims the live-only menu', async (
await expect(page.getByRole('button', { name: 'Drop game' })).toHaveCount(0);
});
test('lobby: hiding a finished game removes it (kebab → ❌), keeping the others', async ({ page }) => {
await loginLobby(page);
// Both seeded finished games are listed; the active row carries the inert chevron, not a kebab.
await expect(page.locator('.rowwrap', { hasText: 'Kaya' })).toBeVisible();
await expect(page.locator('.rowwrap', { hasText: 'Rick' })).toBeVisible();
const annRow = page.locator('.rowwrap', { hasText: 'Ann' });
await expect(annRow.locator('.kebab')).toHaveCount(0);
await expect(annRow.locator('.chev')).toBeVisible();
// The kebab reveals the delete action in place (no dropdown menu); tapping ❌ hides the game.
const kayaRow = page.locator('.rowwrap', { hasText: 'Kaya' });
await kayaRow.locator('.kebab').click();
await expect(kayaRow).toHaveClass(/revealed/);
await kayaRow.locator('.del').click();
// The hidden game is gone from the list; the other finished game remains.
await expect(page.locator('.rowwrap', { hasText: 'Kaya' })).toHaveCount(0);
await expect(page.locator('.rowwrap', { hasText: 'Rick' })).toBeVisible();
});
test('lobby hamburger shows the pending notification count', async ({ page }) => {
await loginLobby(page);
// One incoming friend request (Rick) + one invitation (Kaya) = 2.