feat(game): show 'Opponent's turn' instead of the opponent's name in the turn strip
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 12s
CI / integration (pull_request) Successful in 21s
CI / ui (pull_request) Successful in 1m15s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m57s

When it is not the viewer's turn in an online PvP or vs_ai game, the under-board status
now reads the generic 'Opponent's turn' (game.opponentsTurn) rather than the opponent's
display name or the robot mark, so whose turn it is reads uniformly. The hotseat branch
still names the seat to move (whose device-turn it is matters there), and the seat row
below continues to name each player.
This commit is contained in:
Ilia Denisov
2026-07-15 00:34:58 +02:00
parent da25eac070
commit 513b772cd4
+4 -5
View File
@@ -1451,12 +1451,11 @@
return s.displayName;
}
// turnLabel is the under-board status when it is not the viewer's turn: the opponent's name
// once they have joined, or a generic "opponent's turn" while the seat is still empty (waiting).
// turnLabel is the under-board status when it is not the viewer's turn, for online PvP and
// vs_ai (the hotseat branch of the turn strip shows the seat's own name instead): a generic
// "opponent's turn" rather than the opponent's name or the robot mark, so whose turn it is
// reads the same everywhere. The seat row below still names each player.
function turnLabel(): string {
if (view?.game.vsAi) return '🤖';
const s = view?.game.seats[view?.game.toMove ?? -1];
if (s && s.accountId && s.accountId !== app.session?.userId) return s.displayName;
return t('game.opponentsTurn');
}