Skip to content

Show correct score playerBars#19800

Draft
SergioGlorias wants to merge 3 commits intolichess-org:masterfrom
SergioGlorias:score-in-bars
Draft

Show correct score playerBars#19800
SergioGlorias wants to merge 3 commits intolichess-org:masterfrom
SergioGlorias:score-in-bars

Conversation

@SergioGlorias
Copy link
Member

Better for KO events and Round-Robin
image

Some organizers request

  • IA: copilot helping to no duplicate request

Better for KO events and Round-Robin
fideId,
},
photo = fideId ? relayPlayers?.fidePhoto(fideId) : undefined;
if (relayPlayers && !relayPlayers.players && !relayPlayers.loading) void relayPlayers.loadFromXhr();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 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.

  2. 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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I don't know how to solve the problem 😓

}

.result.score {
background: $c-brilliant;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is such a bright, distracting color. It distracts from the game results, which, I think is more important.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 loadFromXhr flow in RelayPlayers to prevent duplicate concurrent loads and to always reset loading.
  • Render a player’s tournament score in the relay board player bar (and trigger player list loading if needed).
  • Style the new score badge via the existing %result-box placeholder.

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.

Comment on lines +102 to +103
const playerScore = relayPlayers?.players?.find(p => playerId(p) === playerId(player))?.score;
const scoreNode = defined(playerScore) ? hl('span.result.score', playerScore) : undefined;
Comment on lines +97 to 109
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();
@ornicar
Copy link
Collaborator

ornicar commented Mar 15, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants