From 84d0385c95c026a4e72b9af6b81a593789a8e583 Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Tue, 7 Jul 2026 15:00:59 +0200 Subject: [PATCH] fix(offline): scope the medal treatment to hotseat only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per owner: a vs_ai game (one human) keeps its 'you won/lost' status text AND its lobby medal — the hidden-status + per-seat-medal treatment applies only to hotseat, where 2-4 local players make a single 'you' meaningless. isLocalGameId -> game.hotseat at the three call sites (statusBlock, seat plaque, lobby card). --- ui/src/game/Game.svelte | 9 +++++---- ui/src/lib/result.ts | 5 +++-- ui/src/screens/Lobby.svelte | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ui/src/game/Game.svelte b/ui/src/game/Game.svelte index 3cc54c6..04e2604 100644 --- a/ui/src/game/Game.svelte +++ b/ui/src/game/Game.svelte @@ -1497,7 +1497,7 @@ {#if badge}{/if} {#each view.game.seats as s (s.seat)}
-
{#if gameOver && isLocalGameId(id)}{/if}{seatName(s)}
+
{#if gameOver && view.game.hotseat}{/if}{seatName(s)}
{#if blockConfirm[s.seat]}{t('game.blockShort')}{:else if addConfirm[s.seat]}{t('game.addFriendShort')}{:else}{s.score}{/if}
@@ -1623,9 +1623,10 @@
{view.bagLen === 0 ? t('game.bagEmpty') : t('game.bag', { n: view.bagLen })} {#if gameOver} - - {#if !isLocalGameId(id)}{resultText()}{/if} + + {#if !view.game.hotseat}{resultText()}{/if} {:else if placement.pending.length === 0} {view.game.hotseat ? t('hotseat.turnOf', { name: hotseatName(view.game.toMove) }) : isMyTurn ? t('game.yourTurn') : turnLabel()} {/if} diff --git a/ui/src/lib/result.ts b/ui/src/lib/result.ts index 8ceabb1..d88968a 100644 --- a/ui/src/lib/result.ts +++ b/ui/src/lib/result.ts @@ -33,8 +33,9 @@ export function resultBadge(game: GameView, myId: string): ResultBadge { /** * seatMedal returns a per-SEAT place emoji for a finished game (empty while it is still in progress), - * so a local (offline) game can show each player's medal on their plaque instead of a single - * viewer-centric "you won/lost". The winner takes the trophy; the rest place by score (a draw — no + * so a hotseat game can show each player's medal on their plaque instead of a single viewer-centric + * "you won/lost" (which is meaningless with 2-4 local players). The winner takes the trophy; the + * rest place by score (a draw — no * winner — gives every seat the medal). Mirrors the ranking in resultBadge, keyed by seat not viewer. */ export function seatMedal(game: GameView, seat: number): string { diff --git a/ui/src/screens/Lobby.svelte b/ui/src/screens/Lobby.svelte index 1d1d103..f9b5736 100644 --- a/ui/src/screens/Lobby.svelte +++ b/ui/src/screens/Lobby.svelte @@ -354,10 +354,11 @@ > + hotseat game shows no lobby medal — its result lives on the in-game seat + plaques, and resultBadge is viewer-centric (no seat matches the account). A + vs_ai game keeps its medal (one human, a straightforward win/loss). --> {#key blinkNonce.get(g.id) ?? 0} - {isLocalGameId(g.id) ? '' : resultBadge(g, myId).emoji} + {g.hotseat ? '' : resultBadge(g, myId).emoji} {/key} {#if group.finished || g.hotseat}