5.3 KiB
Spec: Series Result History UI
Objective
Replace the compact Game N - winner cards below Competition brackets with a
chronological, Series-centric result history. Users should be able to scan when a
Series was played, its round, participants, official result, and current score,
then expand the row to inspect the accepted Games that produced that record.
This first version is a truthful activity/result history, not a future schedule. It uses only recorded Competition projection data and does not invent scheduled times, venues, replay links, or team logos.
Approved Product Decisions
- Keep the bracket first as the topology view and place the chronological history below it.
- Render one primary row per Series, never one primary row per Game.
- Include a started
in-progressSeries when it has at least one accepted Game, so completed Games do not disappear while a best-of Series is still running. - Include every completed Series, including draw, walkover, forfeit, and administrative outcomes with no accepted Game.
- Exclude inactive, waiting, ready, and game-less in-progress Series because they do not have a truthful result timestamp.
- Use the earliest accepted Game
startedAtas the Series activity time. For a game-less decision, group byoutcome.completedAtbut display no fake start time. - Group and format dates explicitly in
Asia/Seoul. - Keep individual Games in a native, keyboard-accessible disclosure below the Series row.
Tech Stack
- React 19 and TypeScript 6 under
apps/web - Tailwind CSS 4 and daisyUI semantic tokens
- Shared Competition contracts from
@lolympus/contracts - Node's built-in test runner with TypeScript type stripping for pure model tests
Commands
- Focused RED/GREEN test:
pnpm --filter web exec node --test --experimental-strip-types test/competition-series-history.test.ts - Full web tests:
pnpm --filter web test - Web lint:
pnpm --filter web lint - Web build:
pnpm --filter web build
Project Structure
apps/web/src/components/competition/competition-series-history.tsderives the stable, timezone-aware history view model without React.apps/web/src/components/competition/CompetitionSeriesHistory.tsxrenders the semantic date sections, responsive Series rows, and Game disclosures.apps/web/src/components/competition/CompetitionResults.tsxreplaces the existing completed-Game card grid with the new component.apps/web/test/competition-series-history.test.tsspecifies aggregation, ordering, outcome, and formatting behavior.
Code Style
Use contract discriminators and team IDs as the source of truth:
const shouldInclude =
(series.status === "in-progress" && games.length > 0) ||
series.status === "completed";
const winnerTeamId =
series.status === "completed" && series.outcome.type !== "draw"
? series.outcome.winnerTeamId
: undefined;
The UI uses flat, full-width rows and existing semantic tokens. It does not reuse the bordered bracket card layout or introduce new dependencies.
Testing Strategy
Develop the pure model test-first. Cover:
- Games aggregated by
seriesIdand ordered by Series-localordinal; - Series score preserved from A/B entries even when blue/red sides change;
- chronological ordering independent of projection graph order;
Asia/Seoulgrouping across the UTC day boundary;- started in-progress Series and game-less completed decisions;
- exclusion of unstarted and orphan data;
- played, draw, walkover, forfeit, and administrative status semantics;
- deterministic tie-breaking and legacy zero-duration formatting.
After unit tests, run full web tests, changed-file lint, and the TypeScript/Vite build. Review the markup for native keyboard interaction, heading order, visible status text, and mobile layouts down to 320px.
Boundaries
Always
- Use
series.entriesfor A/B score andoutcome.winnerTeamIdfor the official winner; never infer identity from score, array position, or blue/red side. - Keep game-less adjudications visible without presenting
0 : 0as a played score. - Omit
durationSeconds === 0because it represents missing legacy data. - Preserve all unrelated working-tree changes.
Ask First
- Change the public Competition contract, database schema, or projector.
- Add Series scheduling or external replay/venue data.
- Add a frontend dependency or test framework.
Never
- Present
completedAtas a scheduled or actual start time. - Reuse free-text
match.scheduleas official Series scheduling data. - Parse
series.codefor identity, winner, or ordering. - Make status or winner understandable only through color.
Success Criteria
- A completed
2 : 1Series appears as one chronological row with both teams, the official score, round label, status, and an expandable three-Game history. - In-progress Series retain already accepted Games and display
진행 중. - No-game decisions appear with the correct decision label and no misleading score or start time.
- Date grouping and time display are stable in
Asia/Seoulregardless of runtime timezone. - The layout is readable without horizontal scrolling at 320px and uses the wider double-elimination page naturally on desktop.
- Focused/full tests, lint, and web build pass without modifying unrelated work.
Open Questions
None. The user approved the Series-centric, result-history-first direction and requested implementation.