From 7001ec12276f3d085be048a7ec5b5ab65ac28c11 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Mar 2026 21:18:32 +0000 Subject: [PATCH] Show game number when multiple games from same series are in date window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gameKeys.size > 1 branch previously showed only the round name, contradicting the rule that multi-game series always show "Game #x". Now shows the lowest game number visible in the window (e.g. both Game #1 and #2 upcoming → "Semifinals Game #1"). https://claude.ai/code/session_01CRrqu43FKHshpJt1NyrDdX --- app/models/__tests__/upcoming-calendar.test.ts | 2 ++ app/models/scoring-event.ts | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/__tests__/upcoming-calendar.test.ts b/app/models/__tests__/upcoming-calendar.test.ts index 1178a33..5d0810a 100644 --- a/app/models/__tests__/upcoming-calendar.test.ts +++ b/app/models/__tests__/upcoming-calendar.test.ts @@ -362,6 +362,8 @@ describe("getUpcomingEventsForDraftedParticipants — bracket sports", () => { // Should use the earlier time expect(result[0].earliestGameTime).toBe(gameTime1.toISOString()); + // Both games in the window → multi-game series → show lowest game number + expect(result[0].matchLabel).toBe("Knockout Stage Game #1"); }); it("sets matchLabel to round name only (no game number) for single-game matchup", async () => { diff --git a/app/models/scoring-event.ts b/app/models/scoring-event.ts index befaf35..73d7ef3 100644 --- a/app/models/scoring-event.ts +++ b/app/models/scoring-event.ts @@ -578,11 +578,13 @@ export async function getUpcomingEventsForDraftedParticipants( } } } else if (gameKeys.size > 1) { - // Multiple games across the matchup — use just the round name. + // Multiple games in the window — it's a series, show the lowest game number. const rounds = new Set([...gameKeys].map((k) => k.split("|")[0])); if (rounds.size === 1) { const round = [...rounds][0]; - event.matchLabel = round === event.name ? null : round; + const minGameNumber = Math.min(...[...gameKeys].map((k) => parseInt(k.split("|")[1], 10))); + event.matchLabel = + round === event.name ? `Game #${minGameNumber}` : `${round} Game #${minGameNumber}`; } } }