Show correct score playerBars#19800
Show correct score playerBars#19800SergioGlorias wants to merge 3 commits intolichess-org:masterfrom
Conversation
Better for KO events and Round-Robin
| fideId, | ||
| }, | ||
| photo = fideId ? relayPlayers?.fidePhoto(fideId) : undefined; | ||
| if (relayPlayers && !relayPlayers.players && !relayPlayers.loading) void relayPlayers.loadFromXhr(); |
There was a problem hiding this comment.
-
This adds a /players request to every single broadcast page load (!!). Loading this information is only useful in the case that the broadcast has scores enabled. You should limit the fetch only to such cases.
-
Because you only load the players once, when an ongoing game finishes it will not reflect the new game result. It will only fix itself if the user visits /players to trigger a re-fetch or they refresh the page.
There was a problem hiding this comment.
Unfortunately, I don't know how to solve the problem 😓
| } | ||
|
|
||
| .result.score { | ||
| background: $c-brilliant; |
There was a problem hiding this comment.
This is such a bright, distracting color. It distracts from the game results, which, I think is more important.
There was a problem hiding this comment.
Pull request overview
Updates relay study UI so the per-player score can be displayed in the board “player bars”, improving clarity for KO and round-robin events.
Changes:
- Add a guarded
loadFromXhrflow inRelayPlayersto prevent duplicate concurrent loads and to always resetloading. - Render a player’s tournament
scorein the relay board player bar (and trigger player list loading if needed). - Style the new score badge via the existing
%result-boxplaceholder.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ui/analyse/src/study/relay/relayPlayers.ts | Adds loading guard + try/finally to make XHR loading state consistent and prevent concurrent fetches. |
| ui/analyse/src/study/playerBars.ts | Loads relay players (if missing) and displays the matched player’s score in the relay player bar. |
| ui/analyse/css/study/relay/_result-box.scss | Adds styling for .result.score within the shared result-box styling placeholder. |
You can also share your feedback on Copilot code review. Take the survey.
| const playerScore = relayPlayers?.players?.find(p => playerId(p) === playerId(player))?.score; | ||
| const scoreNode = defined(playerScore) ? hl('span.result.score', playerScore) : undefined; |
| if (relayPlayers && !relayPlayers.players && !relayPlayers.loading) void relayPlayers.loadFromXhr(); | ||
| const coloredResult = status && status !== '*' && playerColoredResult(status, color, round); | ||
| const resultNode = coloredResult | ||
| ? hl(`${coloredResult.tag}.result`, coloredResult.points) | ||
| : result && hl(`${resultTag(result)}.result`, result); | ||
| const playerScore = relayPlayers?.players?.find(p => playerId(p) === playerId(player))?.score; | ||
| const scoreNode = defined(playerScore) ? hl('span.result.score', playerScore) : undefined; | ||
| return relayPlayers | ||
| ? hl(`div.relay-board-player.relay-board-player-${top ? 'top' : 'bot'}`, { class: { ticking } }, [ | ||
| hl('div.left', [ | ||
| playerPhotoOrFallback(player, photo, 'small', 'relay-board-player__photo'), | ||
| scoreNode, | ||
| hl('div.info-split', [ |
| fideId, | ||
| }, | ||
| photo = fideId ? relayPlayers?.fidePhoto(fideId) : undefined; | ||
| if (relayPlayers && !relayPlayers.players && !relayPlayers.loading) void relayPlayers.loadFromXhr(); |
|
Are we sure we want to always show the score there? Adding yet another piece of information to an already bloated UI? The score is visible in the player mouseover popup |
Better for KO events and Round-Robin

Some organizers request