diff --git a/app/components/sport-season/RegularSeasonStandings.tsx b/app/components/sport-season/RegularSeasonStandings.tsx index 2036748..8974f04 100644 --- a/app/components/sport-season/RegularSeasonStandings.tsx +++ b/app/components/sport-season/RegularSeasonStandings.tsx @@ -243,10 +243,16 @@ function StandingsTable({ // # Team GP W [D] L [GF GA GD PTS] [OTL PTS] [PCT] [GB] [L10] [STK] Mgr // Soccer: 11 fixed columns. Non-soccer: 5 base + GP + optional cols. + // GP and PCT are always counted even when hidden on mobile; colSpan must + // reflect all rendered columns regardless of CSS visibility. const totalCols = showSoccerTable ? 11 : 5 + 1 /* GP */ + (showOtLosses ? 2 : 0) + 1 /* PCT */ + (hasGB ? 1 : 0) + (hasLastTen ? 1 : 0) + (hasStreak ? 1 : 0); + // Non-soccer rows get a secondary sub-row on mobile showing GP/PCT/GB/L10. + // Soccer tables show GP inline (no sub-row) since they already show many columns. + const showSubRow = !showSoccerTable; + return (
@@ -254,7 +260,7 @@ function StandingsTable({ - + {showSoccerTable && } @@ -314,19 +320,16 @@ function StandingsTable({ const isUserTeam = userParticipantIds.includes(row.participantId); const ownership = teamOwnerships[row.participantId]; - // Non-soccer rows get a secondary sub-row on mobile showing GP/PCT/GB/L10 - const hasSecondaryStats = !showSoccerTable; - sectionRows.push( - - @@ -411,8 +414,7 @@ function StandingsTable({ ); - // Secondary stats sub-row for mobile (hidden on sm+) - if (hasSecondaryStats) { + if (showSubRow) { sectionRows.push( { expect(screen.queryByText("L10")).not.toBeInTheDocument(); }); + it("hides GB column when no rows have gamesBack data", () => { + render( + + ); + expect(screen.queryByText("GB")).not.toBeInTheDocument(); + }); + it("shows soccer table columns when showSoccerTable=true", () => { render(
# TeamGPGP WDL
{rank} - + + {row.participant.shortName ?? row.participant.name} {section.showDivisionLabel && row.division && ( @@ -335,7 +338,7 @@ function StandingsTable({ )} + {row.gamesPlayed} {row.wins}