Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcast teams: White is first #15642

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ui/analyse/src/study/relay/relayTeams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ const renderTeams = (
cloudEval?: MultiCloudEval,
): MaybeVNodes =>
teams.table.map(row => {
const firstTeam = row.teams[0];
const firstTeam = row.teams[1];
const secondTeam = row.teams[0];
Copy link
Collaborator

Choose a reason for hiding this comment

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

This assumes that the second team is first, and the first team is second.
I doubt that it's always true, but if it was, then it should be fixed upstream in the backend, and not reverted in the frontend.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well... I may have done it in the frontend, but this is currently how lila is generating the teams (not just in this case at all)

Copy link
Collaborator

@ornicar ornicar Jul 4, 2024

Choose a reason for hiding this comment

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

The first random team broadcast I looked at has the first players using the white pieces:
https://lichess.org/broadcast/french-cup-grand-finals-chartres-2024--womens-top-12-club-championship/semi-finals/EisjcYTg#teams

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh...

return h('div.relay-tour__team-match', [
h('div.relay-tour__team-match__teams', [
h('strong.relay-tour__team-match__team', row.teams[0].name),
h('strong.relay-tour__team-match__team', firstTeam.name),
h('span.relay-tour__team-match__team__points', [
h('points', firstTeam.points.toString()),
h('vs', 'vs'),
h('points', row.teams[1].points.toString()),
h('points', secondTeam.points.toString()),
]),
h('strong.relay-tour__team', row.teams[1].name),
h('strong.relay-tour__team', secondTeam.name),
]),
h(
'div.relay-tour__team-match__games',
Expand All @@ -88,7 +89,7 @@ const renderTeams = (
const players = chap?.players;
if (!players) return;
const sortedPlayers =
game.pov == 'white' ? [players.white, players.black] : [players.black, players.white];
game.pov == 'white' ? [players.black, players.white] : [players.white, players.black];
return (
chap &&
h('a.relay-tour__team-match__game', { attrs: gameLinkAttrs(basePath, chap) }, [
Expand All @@ -109,7 +110,7 @@ const playerView = (p: ChapterPreviewPlayer) =>
]);

const statusView = (g: ChapterPreview, pov: Color, chapters: StudyChapters, cloudEval?: MultiCloudEval) => {
const status = pov == 'white' ? g.status : (g.status?.split('').reverse().join('') as StatusStr);
const status = pov == 'white' ? (g.status?.split('').reverse().join('') as StatusStr) : g.status;
return h(
'span.relay-tour__team-match__game__status',
status && status != '*' ? status : cloudEval ? evalGauge(g, pov, chapters, cloudEval) : '*',
Expand Down
Loading