From 896b7f57a7daa7b4fb27042169b22b3de52a773c Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Wed, 15 Jul 2026 02:17:13 +0200 Subject: [PATCH] feat(newgame): skip the take-a-seat prompt for a guest offline host A guest host has no meaningful display name to seat, so the offline 'with friends' flow's "do you take a seat?" prompt only produced a nameless seat. For a guest the prompt is skipped: after the master PIN, the two empty player seats show directly. A durable host is still asked. --- ui/e2e/native.spec.ts | 7 ++++--- ui/src/screens/NewGame.svelte | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/e2e/native.spec.ts b/ui/e2e/native.spec.ts index 4fc1f5b..37301db 100644 --- a/ui/e2e/native.spec.ts +++ b/ui/e2e/native.spec.ts @@ -97,14 +97,15 @@ test.describe('native offline-first', () => { await expectOfflineGuestLobby(page); // New game -> the offline mode selector offers "with friends" (pass-and-play) to the local guest. - // A minimal create: set the mandatory host (master) PIN, decline a seat, the sole offered variant - // (Erudit — the profileless guest's default), two open seats. + // A minimal create: set the mandatory host (master) PIN. A guest host skips the "do you take a + // seat?" prompt (no name to seat) and goes straight to the two open seats, so pick the sole + // offered variant (Erudit — the profileless guest's default) right after the PIN. await page.locator('button.tab').nth(0).click(); await page.getByRole('button', { name: /With friends|друзьями/i }).click(); await page.locator('.hostpin .plink').click(); await typePin(page, '9999'); await typePin(page, '9999'); - await page.getByRole('button', { name: /^(No|Нет)$/ }).click(); + await expect(page.getByRole('button', { name: /^(No|Нет)$/ })).toHaveCount(0); // no seat prompt for a guest await page.locator('.variant').click(); await page.locator('.pname').nth(0).fill('Ann'); await page.locator('.pname').nth(1).fill('Bob'); diff --git a/ui/src/screens/NewGame.svelte b/ui/src/screens/NewGame.svelte index 0d44e71..5ffd6a0 100644 --- a/ui/src/screens/NewGame.svelte +++ b/ui/src/screens/NewGame.svelte @@ -265,7 +265,10 @@ case 'host-set': if (r.kind === 'set') { hostPin = r.lock; - askHostPlays = true; + // A guest host has no meaningful display name to seat, so the "do you take a seat?" + // prompt would only produce a nameless seat — skip it and go straight to the (empty) + // player seats. A durable host is still asked. + if (!guest) askHostPlays = true; } break; case 'host-change':