- {history.map((day) => {
- const headingId = `competition-history-${day.dateKey}`;
+ {history.map((day, dayIndex) => {
+ const headingId = historyDayHeadingId(day.dateKey);
+ const dayHeading = formatCompetitionHistoryDayHeading(
+ day.dateKey,
+ day.rows.length,
+ );
return (
{day.dateKey === "unknown" ? (
- formatCompetitionHistoryDate(day.dateKey)
+ dayHeading
) : (
)}
- {day.rows.map((row) => (
- -
-
-
- ))}
+ {day.rows.map((row, rowIndex) => {
+ const isLatestResult =
+ dayIndex === history.length - 1 &&
+ rowIndex === day.rows.length - 1;
+ return (
+ -
+
+
+ );
+ })}
);
@@ -95,31 +144,50 @@ function SeriesHistoryRow({
teamById,
communityId,
matchId,
- historyBackTo,
+ historyPath,
+ currentHash,
}: {
row: CompetitionSeriesHistoryRow;
teamById: ReadonlyMap
;
communityId: CommunityId;
matchId: MatchId;
- historyBackTo: string;
+ historyPath: string;
+ currentHash: string;
}) {
+ const detailsId = seriesHistoryDetailsId(row.series.seriesId);
+ const seriesHash = `#${detailsId}`;
+ const [expanded, setExpanded] = useState(currentHash === seriesHash);
+
if (row.games.length === 0) {
return (
-
+
);
}
return (
-
-
-
+ setExpanded(event.currentTarget.open)}
+ >
+
+
);
@@ -136,47 +204,55 @@ function SeriesSummary({
}) {
const { series } = row;
const statusLabel = getSeriesHistoryStatusLabel(series);
- const timeLabel =
- row.timestampSource === "game-start"
- ? formatCompetitionHistoryTime(row.occurredAt)
- : null;
+ const timeLabel = formatCompetitionHistoryTime(row.occurredAt);
+ const timeKind = row.timestampSource === "game-start" ? "시작" : "결정";
const roundLabel = bracketRoundLabel(
series.stage.type,
series.stage.roundNumber,
);
+ const closedRecordLabel = getSeriesHistoryRecordLabel(
+ series,
+ row.games.length,
+ false,
+ );
return (
-
-
-
-
+
+
+
+
+
+
{roundLabel}
-
-
-
-
+
+
+
+
{hasGameDetails ? (
<>
- {row.games.length}게임 보기
- 게임 접기
+ {closedRecordLabel}
+
+ {getSeriesHistoryRecordLabel(series, row.games.length, true)}
+
>
) : (
- 개별 기록 없음
+ {closedRecordLabel}
)}
@@ -185,22 +261,24 @@ function SeriesSummary({
function HistoryTime({
occurredAt,
+ timeKind,
timeLabel,
}: {
occurredAt: string;
+ timeKind: "시작" | "결정";
timeLabel: string | null;
}) {
return timeLabel ? (
) : (
-
- —
- 시작 시간 기록 없음
+
+ {timeKind} —
+ {timeKind} 시각 기록 없음
);
}
@@ -238,27 +316,36 @@ function SeriesMatchup({
const teamAWon = isSeriesEntryWinner(row.series, entryA.teamId);
const teamBWon = isSeriesEntryWinner(row.series, entryB.teamId);
const showScore = shouldDisplaySeriesHistoryScore(row.series);
+ const resultLabel = getSeriesHistoryResultLabel(row.series);
+ const statusLabel = getSeriesHistoryStatusLabel(row.series);
const officialWinnerTeamId =
row.series.status === "completed" && row.series.outcome.type !== "draw"
? row.series.outcome.winnerTeamId
: null;
- const winnerAnnouncement = officialWinnerTeamId
- ? `, ${teamName(officialWinnerTeamId, teamById)} 승`
- : "";
- const accessibleResult = showScore
- ? `${teamAName} ${entryA.gameWins} 대 ${entryB.gameWins} ${teamBName}${winnerAnnouncement}`
- : `${teamAName} 대 ${teamBName}, ${getSeriesHistoryStatusLabel(row.series)}${winnerAnnouncement}`;
+ const matchupAnnouncement = showScore
+ ? `${teamAName} ${entryA.gameWins} 대 ${entryB.gameWins} ${teamBName}`
+ : `${teamAName} 대 ${teamBName}`;
+ const accessibleResult = [
+ matchupAnnouncement,
+ resultLabel,
+ officialWinnerTeamId
+ ? `${teamName(officialWinnerTeamId, teamById)} 승`
+ : null,
+ statusLabel,
+ ]
+ .filter((part): part is string => Boolean(part))
+ .join(", ");
return (
<>
-
+
{showScore ? (
- <>
+
{entryB.gameWins}
- >
- ) : (
- —
+
+ ) : null}
+ {resultLabel && (
+
+ {resultLabel}
+
)}
@@ -316,3 +412,11 @@ function teamName(
): string {
return teamById.get(teamId)?.name ?? "알 수 없는 팀";
}
+
+function historyDayHeadingId(dateKey: string): string {
+ return `competition-series-history-day-${dateKey}`;
+}
+
+function seriesHistoryDetailsId(seriesId: string): string {
+ return `competition-series-history-series-${seriesId}`;
+}
diff --git a/apps/web/src/components/competition/MatchDetailTabBar.tsx b/apps/web/src/components/competition/MatchDetailTabBar.tsx
index 29e70aaf..84bfe30f 100644
--- a/apps/web/src/components/competition/MatchDetailTabBar.tsx
+++ b/apps/web/src/components/competition/MatchDetailTabBar.tsx
@@ -79,7 +79,7 @@ export function MatchDetailTabBar({
onKeyDown={(event) => handleKeyDown(event, tab.id)}
className={`min-h-11 flex-none whitespace-nowrap border-b-2 px-4 text-xs font-bold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary ${
selected
- ? "border-primary bg-primary/5 text-primary"
+ ? "border-primary bg-primary/5 text-base-content"
: "border-transparent text-base-content/45 hover:bg-base-content/[0.03] hover:text-base-content"
}`}
>
diff --git a/apps/web/src/components/competition/competition-series-history.ts b/apps/web/src/components/competition/competition-series-history.ts
index bfbfd340..f2c05197 100644
--- a/apps/web/src/components/competition/competition-series-history.ts
+++ b/apps/web/src/components/competition/competition-series-history.ts
@@ -103,20 +103,41 @@ export function getSeriesHistoryStatusLabel(
series: CompetitionSeriesHistorySeries,
): string {
if (series.status === "in-progress") return "진행 중";
+ return "최종";
+}
+
+export function getSeriesHistoryResultLabel(
+ series: CompetitionSeriesHistorySeries,
+): string | null {
+ if (series.status === "in-progress") return null;
switch (series.outcome.type) {
case "played":
- return "종료";
+ return null;
case "draw":
- return "무승부";
+ return series.outcome.basis.type === "played"
+ ? "무승부"
+ : "판정 무승부";
case "walkover":
return "부전승";
case "forfeit":
return "기권승";
case "administrative":
- return "판정";
+ return "판정승";
}
}
+export function getSeriesHistoryRecordLabel(
+ series: CompetitionSeriesHistorySeries,
+ gameCount: number,
+ expanded: boolean,
+): string {
+ if (gameCount > 0) {
+ return expanded ? "게임 상세 접기" : `게임 상세 (${gameCount})`;
+ }
+ if (isGameLessDecision(series)) return "경기 없이 결정";
+ return "게임 기록 미등록";
+}
+
export function shouldDisplaySeriesHistoryScore(
series: CompetitionSeriesHistorySeries,
): boolean {
@@ -155,7 +176,14 @@ export function formatCompetitionHistoryDate(dateKey: string): string {
) {
return "일시 정보 없음";
}
- return `${padNumber(month)}월 ${padNumber(day)}일 (${KOREAN_WEEKDAYS[date.getUTCDay()]})`;
+ return `${month}월 ${day}일 (${KOREAN_WEEKDAYS[date.getUTCDay()]})`;
+}
+
+export function formatCompetitionHistoryDayHeading(
+ dateKey: string,
+ gameCount: number,
+): string {
+ return `${formatCompetitionHistoryDate(dateKey)} · ${gameCount}경기`;
}
export function formatCompetitionHistoryTime(
@@ -233,6 +261,16 @@ function timestampValue(value: IsoDateTime): number {
return Number.isNaN(timestamp) ? Number.POSITIVE_INFINITY : timestamp;
}
+function isGameLessDecision(
+ series: CompetitionSeriesHistorySeries,
+): boolean {
+ if (series.status === "in-progress") return false;
+ if (series.outcome.type === "draw") {
+ return series.outcome.basis.type !== "played";
+ }
+ return series.outcome.type !== "played";
+}
+
function padNumber(value: number): string {
return value.toString().padStart(2, "0");
}
diff --git a/apps/web/test/competition-series-history.test.ts b/apps/web/test/competition-series-history.test.ts
index 262ac460..a971cd64 100644
--- a/apps/web/test/competition-series-history.test.ts
+++ b/apps/web/test/competition-series-history.test.ts
@@ -12,8 +12,11 @@ import {
competitionHistoryGameDetailPath,
createCompetitionSeriesHistory,
formatCompetitionHistoryDate,
+ formatCompetitionHistoryDayHeading,
formatCompetitionHistoryTime,
formatSeriesGameDuration,
+ getSeriesHistoryRecordLabel,
+ getSeriesHistoryResultLabel,
getSeriesHistoryStatusLabel,
shouldDisplaySeriesHistoryScore,
} from "../src/components/competition/competition-series-history.ts";
@@ -234,74 +237,108 @@ test("sorts tied timestamps deterministically and ignores orphan Games", () => {
assert.equal(rows.every(({ games }) => games.length === 0), true);
});
-test("returns explicit status labels for played and adjudicated outcomes", () => {
+test("separates lifecycle status from played and adjudicated result labels", () => {
const teamA = teamId("team-a");
const teamB = teamId("team-b");
+ const running = inProgressSeries("running", teamA, teamB, 1, 0);
+ const played = completedSeries({
+ id: "played",
+ teamA,
+ teamB,
+ scoreA: 2,
+ scoreB: 1,
+ });
+ const playedDraw = completedSeries({
+ id: "played-draw",
+ teamA,
+ teamB,
+ scoreA: 1,
+ scoreB: 1,
+ outcome: "draw",
+ });
+ const administrativeDraw = {
+ ...playedDraw,
+ seriesId: seriesId("administrative-draw-label"),
+ outcome: {
+ ...playedDraw.outcome,
+ basis: {
+ type: "administrative" as const,
+ decisionFactId: "draw-label-fact" as never,
+ },
+ },
+ };
+ const walkover = completedSeries({
+ id: "walkover",
+ teamA,
+ teamB,
+ scoreA: 0,
+ scoreB: 0,
+ outcome: "walkover",
+ });
+ const forfeit = completedSeries({
+ id: "forfeit",
+ teamA,
+ teamB,
+ scoreA: 1,
+ scoreB: 1,
+ outcome: "forfeit",
+ });
+ const administrative = completedSeries({
+ id: "administrative",
+ teamA,
+ teamB,
+ scoreA: 0,
+ scoreB: 0,
+ outcome: "administrative",
+ });
+ assert.equal(getSeriesHistoryStatusLabel(running), "진행 중");
+ for (const completed of [
+ played,
+ playedDraw,
+ administrativeDraw,
+ walkover,
+ forfeit,
+ administrative,
+ ]) {
+ assert.equal(getSeriesHistoryStatusLabel(completed), "최종");
+ }
+
+ assert.equal(getSeriesHistoryResultLabel(running), null);
+ assert.equal(getSeriesHistoryResultLabel(played), null);
+ assert.equal(getSeriesHistoryResultLabel(playedDraw), "무승부");
assert.equal(
- getSeriesHistoryStatusLabel(
- inProgressSeries("running", teamA, teamB, 1, 0),
- ),
- "진행 중",
- );
- assert.equal(
- getSeriesHistoryStatusLabel(
- completedSeries({ id: "played", teamA, teamB, scoreA: 2, scoreB: 1 }),
- ),
- "종료",
- );
- assert.equal(
- getSeriesHistoryStatusLabel(
- completedSeries({
- id: "draw",
- teamA,
- teamB,
- scoreA: 1,
- scoreB: 1,
- outcome: "draw",
- }),
- ),
- "무승부",
- );
- assert.equal(
- getSeriesHistoryStatusLabel(
- completedSeries({
- id: "walkover",
- teamA,
- teamB,
- scoreA: 0,
- scoreB: 0,
- outcome: "walkover",
- }),
- ),
- "부전승",
- );
- assert.equal(
- getSeriesHistoryStatusLabel(
- completedSeries({
- id: "forfeit",
- teamA,
- teamB,
- scoreA: 1,
- scoreB: 1,
- outcome: "forfeit",
- }),
- ),
- "기권승",
- );
- assert.equal(
- getSeriesHistoryStatusLabel(
- completedSeries({
- id: "administrative",
- teamA,
- teamB,
- scoreA: 0,
- scoreB: 0,
- outcome: "administrative",
- }),
- ),
- "판정",
+ getSeriesHistoryResultLabel(administrativeDraw),
+ "판정 무승부",
);
+ assert.equal(getSeriesHistoryResultLabel(walkover), "부전승");
+ assert.equal(getSeriesHistoryResultLabel(forfeit), "기권승");
+ assert.equal(getSeriesHistoryResultLabel(administrative), "판정승");
+});
+
+test("describes recorded Games, decisions, and legacy missing records", () => {
+ const teamA = teamId("record-team-a");
+ const teamB = teamId("record-team-b");
+ const played = completedSeries({
+ id: "recorded-played",
+ teamA,
+ teamB,
+ scoreA: 2,
+ scoreB: 0,
+ });
+ const decision = completedSeries({
+ id: "recorded-decision",
+ teamA,
+ teamB,
+ scoreA: 0,
+ scoreB: 0,
+ outcome: "walkover",
+ });
+
+ assert.equal(getSeriesHistoryRecordLabel(played, 2, false), "게임 상세 (2)");
+ assert.equal(getSeriesHistoryRecordLabel(played, 2, true), "게임 상세 접기");
+ assert.equal(getSeriesHistoryRecordLabel(decision, 0, false), "경기 없이 결정");
+ assert.equal(getSeriesHistoryRecordLabel(played, 0, false), "게임 기록 미등록");
});
test("shows a numeric score only for played records", () => {
@@ -386,12 +423,25 @@ test("formats recorded Game duration and omits unknown legacy zero values", () =
});
test("formats history dates and times explicitly in Asia/Seoul", () => {
- assert.equal(formatCompetitionHistoryDate("2026-07-13"), "07월 13일 (월)");
+ assert.equal(formatCompetitionHistoryDate("2026-07-05"), "7월 5일 (일)");
+ assert.equal(formatCompetitionHistoryDate("2026-07-13"), "7월 13일 (월)");
+ assert.equal(
+ formatCompetitionHistoryDayHeading("2026-07-05", 1),
+ "7월 5일 (일) · 1경기",
+ );
+ assert.equal(
+ formatCompetitionHistoryDayHeading("2026-07-13", 2),
+ "7월 13일 (월) · 2경기",
+ );
assert.equal(
formatCompetitionHistoryTime("2026-07-12T15:05:00.000Z"),
"00:05",
);
assert.equal(formatCompetitionHistoryDate("unknown"), "일시 정보 없음");
+ assert.equal(
+ formatCompetitionHistoryDayHeading("unknown", 1),
+ "일시 정보 없음 · 1경기",
+ );
});
function playedSeriesWithGame({