fix(ui): green both lobby scores on a tie, mute a 0:0 board
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 54s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m7s

The lobby tinted only the viewer's own number, and a tie counted as
"leading" — so an even score showed only the viewer's number green,
reading as if the viewer were ahead. A fresh 0:0 board did the same,
accenting the start of a game where nobody has scored.

scoreStanding is now per-seat: the viewer's seat stays green when
leading or tied and red when trailing; an opponent's seat greens only
when it ties the viewer for the lead, so an equal non-zero score paints
both numbers green. When the top score is 0 (nobody has moved) every
number is left muted, like a finished game.
This commit is contained in:
Ilia Denisov
2026-06-20 21:28:31 +02:00
parent 9824214fd7
commit 264097bbf6
4 changed files with 71 additions and 24 deletions
+6 -5
View File
@@ -267,11 +267,11 @@
{#if badge}<span class="unread-dot" class:nudge={badge === 'nudge'}></span>{/if}
</span>
<span class="sub scoreline"
>{#each orderedSeats(g) as s, i (s.seat)}{#if i > 0}<span class="sep">{' : '}</span
>{#each orderedSeats(g) as s, i (s.seat)}{@const standing = scoreStanding(g, myId, s)}{#if i > 0}<span class="sep">{' : '}</span
>{/if}<span
class="num"
class:win={s.accountId === myId && scoreStanding(g, myId) === 'win'}
class:lose={s.accountId === myId && scoreStanding(g, myId) === 'lose'}>{s.score}</span
class:win={standing === 'win'}
class:lose={standing === 'lose'}>{s.score}</span
>{/each}</span
>
</span>
@@ -483,8 +483,9 @@
font-weight: 700;
font-size: 0.8rem;
}
/* The viewer's own number on an in-progress game: green when leading or tied, red when
losing; other numbers and the separators keep the muted .sub colour. */
/* In-progress score colours (see scoreStanding): the viewer's number greens when leading or
tied, reds when losing; an opponent's number greens only when it ties the viewer (an equal
score paints both green). A fresh 0:0 board and the separators keep the muted .sub colour. */
.num.win {
color: var(--ok);
}