From 0f1c558493ad7a09309320482d9633b1d9ec99d0 Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 19 Apr 2026 18:36:11 -0400 Subject: [PATCH] =?UTF-8?q?style:=20tighten=20playoff=20card=20copy=20?= =?UTF-8?q?=E2=80=94=20uniform=20Game=20X=20of=207=20header,=20leaner=20bl?= =?UTF-8?q?urbs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Top row now always reads "Game N of 7" (round is already shown by the R1/R2/CONF FINAL/CUP FINAL badge). Bottom blurb drops the trailing period on "Series opener" and uses "{Team} lead X-Y" (plural verb, no "— Game N" suffix) when a leader is established. Co-Authored-By: Claude Opus 4.7 --- app/playoff.py | 13 ++++--------- tests/test_games.py | 3 ++- tests/test_playoff_series.py | 12 ++++++------ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/app/playoff.py b/app/playoff.py index c49eda3..0d5e8c7 100644 --- a/app/playoff.py +++ b/app/playoff.py @@ -106,9 +106,9 @@ def series_blurb(game): if state["is_pivotal"]: return f"Series tied 2\u20112 \u2014 pivotal Game {g}." if state["is_opener"]: - return "Series opener." + return "Series opener" if leader_name and trailer_name: - return f"{leader_name} leads {state['hi']}\u2011{state['lo']} \u2014 Game {g}." + return f"{leader_name} lead {state['hi']}\u2011{state['lo']}" if state["hi"] == state["lo"]: return f"Series even at {state['hi']}\u2011{state['lo']} \u2014 Game {g}." return f"Game {g}." @@ -135,14 +135,9 @@ def series_badges(game): def series_summary(game): - """Short series-score line rendered under the blurb, e.g. 'LAK leads 2-1'.""" + """Short line rendered above the card, e.g. 'Game 2 of 7'.""" state = series_state(game.get("seriesStatus", {})) - if state["is_opener"]: - return f"Game 1 of 7 \u00b7 Round {state['round']}" - leader_name = _leader_name(game, state) - if leader_name: - return f"{leader_name} leads {state['hi']}\u2011{state['lo']}" - return f"Series tied {state['hi']}\u2011{state['lo']}" + return f"Game {state['game_number']} of 7" def is_pinned(game): diff --git a/tests/test_games.py b/tests/test_games.py index 8b8bef7..83b9366 100644 --- a/tests/test_games.py +++ b/tests/test_games.py @@ -775,7 +775,8 @@ class TestPlayoffEnrichment: g = result[0] assert g["Is Playoff"] is True assert g["Pinned"] is False - assert "Game 4" in g["Series Blurb"] + assert "lead" in g["Series Blurb"] + assert g["Series Summary"] == "Game 4 of 7" assert "R1" in g["Series Badges"] def test_game7_is_pinned(self, mocker): diff --git a/tests/test_playoff_series.py b/tests/test_playoff_series.py index 6b6fdaf..ca9e5f8 100644 --- a/tests/test_playoff_series.py +++ b/tests/test_playoff_series.py @@ -69,7 +69,7 @@ class TestSeriesState: class TestSeriesBlurb: def test_opener_blurb(self): game = make_playoff_game(top_wins=0, bottom_wins=0) - assert series_blurb(game) == "Series opener." + assert series_blurb(game) == "Series opener" def test_game7_blurb(self): game = make_playoff_game(top_wins=3, bottom_wins=3) @@ -96,8 +96,8 @@ class TestSeriesBlurb: def test_leader_trailer_blurb(self): game = make_playoff_game(top_wins=2, bottom_wins=1) blurb = series_blurb(game) - assert "leads" in blurb - assert "Game 4" in blurb + assert "lead" in blurb + assert "2\u20111" in blurb def test_tied_mid_series_blurb(self): game = make_playoff_game(top_wins=1, bottom_wins=1) @@ -139,15 +139,15 @@ class TestSeriesBadges: class TestSeriesSummary: def test_opener_summary(self): game = make_playoff_game(top_wins=0, bottom_wins=0, round_num=1) - assert "Round 1" in series_summary(game) + assert series_summary(game) == "Game 1 of 7" def test_leader_summary(self): game = make_playoff_game(top_wins=2, bottom_wins=1) - assert "leads" in series_summary(game) + assert series_summary(game) == "Game 4 of 7" def test_tied_mid_series_summary(self): game = make_playoff_game(top_wins=1, bottom_wins=1) - assert "tied" in series_summary(game).lower() + assert series_summary(game) == "Game 3 of 7" class TestIsPinned: