From 8dfb4b9683e21a8cd0f186a73bace0bcb4955621 Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Wed, 15 Apr 2026 13:11:51 -0400 Subject: [PATCH] fix: display matches properly when using custom seeding, hide colors for infered bracket --- connect4-ui/app/spectate/page.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/connect4-ui/app/spectate/page.tsx b/connect4-ui/app/spectate/page.tsx index 6199cc2..1ed0f57 100644 --- a/connect4-ui/app/spectate/page.tsx +++ b/connect4-ui/app/spectate/page.tsx @@ -331,7 +331,6 @@ export default function SpectatePage() { send(cmd.getData("TOURNAMENT_DATA")); } } else if (msg.key === "TOURNAMENT_DATA" && msg.value) { - resetLiveGames(); setKnockoutRawData(msg.value); } break; @@ -677,7 +676,7 @@ function BracketPlayerRow({ isActive, }: { name: string | null; - playerColor: 1 | 2; + playerColor: 1 | 2 | null; isActive: boolean; }) { const isRed = playerColor === 1; @@ -692,7 +691,7 @@ function BracketPlayerRow({ : "border-gray-700 bg-gray-900 text-gray-400" }`} > - {name && ( + {name && playerColor !== null && (
@@ -856,20 +857,17 @@ function buildKnockoutBracket( const nextRound = displayRounds[roundIndex + 1]; const nextRoundPlayer = nextRound?.players[matchIndex] ?? null; const liveMatch = findLiveMatch(liveGameEntries, player1, player2); - const isProjectedRound = Boolean(round.projected); - const hasKnownPlayers = Boolean(player1 && player2); const hasAdvancedPastRound = roundIndex < rounds.length - 1 && !displayRounds[roundIndex + 1]?.projected; - const inferredCompletedRealMatch = - !isProjectedRound && hasKnownPlayers && !liveMatch; + const hasExplicitResult = Boolean(liveMatch?.result); const winner = nextRoundPlayer && (nextRoundPlayer === player1 || nextRoundPlayer === player2) ? nextRoundPlayer : resolveLiveWinner(liveMatch, tournamentWinner, player1, player2); const status = - winner || hasAdvancedPastRound || inferredCompletedRealMatch + hasExplicitResult || winner || hasAdvancedPastRound ? "completed" : liveMatch ? "live"