# Implementation Plan: Team Progress Page UX Refresh ## Overview Deliver the redesign in three verifiable slices: tested presentation rules, shared Series semantics, and the integrated page/copy experience. No API or dependency change is required because the team view already exposes `seriesId`, ordinal, round metadata, outcome categories, and code expiry. ## Architecture Decisions - Keep API/query ownership in the page and move deterministic presentation logic into a pure module that the existing Node test runner can exercise. - Compose the active-Series card with code rows instead of maintaining a separate page-wide code grid. - Reuse existing Competition history result and score helpers instead of creating a second interpretation of adjudicated outcomes. - Use one responsive layout and native disclosure/table semantics rather than separate desktop and mobile component trees. ## Task List ### Phase 1: Tested View Model - [ ] Add failing tests for Series/code grouping, stable ordering, Korean round labels, code availability/expiry, unique copy labels, and explicit clipboard results. - Acceptance: the new focused test fails because the behavior is not implemented. - Verify: `pnpm --filter web exec node --test --experimental-strip-types test/match-team-progress-view.test.ts` - Files: `apps/web/test/match-team-progress-view.test.ts` - [ ] Implement the minimal pure view helpers. - Acceptance: all focused assertions pass without React or DOM mocks. - Verify: rerun the focused command once after implementation. - Files: `apps/web/src/pages/match-team-progress-view.ts` ### Checkpoint: View Model - [ ] Focused tests pass and no API/contract file changed. ### Phase 2: Series Semantics and Code Interaction - [ ] Update the shared Series card to prefer supplied human labels, show technical codes secondarily, and hide misleading pre-start/adjudicated scores. - Acceptance: ready and adjudicated cards show `—`; result categories remain text-visible; bracket geometry stays unchanged. - Verify: `pnpm --filter web test` - Files: `apps/web/src/components/competition/SeriesScoreCard.tsx` - [ ] Add the responsive tournament-code list with accessible clipboard feedback. - Acceptance: code rows show local set number first, full selectable codes, unique 44px copy controls, expiry/state text, and success/failure announcements. - Verify: TypeScript build plus runtime keyboard/copy check. - Files: `apps/web/src/components/competition/TeamTournamentCodes.tsx` ### Checkpoint: Interaction - [ ] Full web tests pass and the web build succeeds. ### Phase 3: Page Hierarchy and Polish - [ ] Reorder the page and integrate code rows with matching active Series. - Acceptance: order is next match, roster, recent results; every code appears under exactly one matching Series; empty states remain meaningful. - Verify: desktop and mobile runtime screenshots. - Files: `apps/web/src/pages/MatchTeamProgressPage.tsx` - [ ] Compact and order the roster, and collapse results beyond the newest two. - Acceptance: position labels are Korean and role-ordered, captain is adjacent, and older results remain keyboard-accessible. - Verify: 320/768/1024/1440px reflow and keyboard traversal. - Files: `apps/web/src/pages/MatchTeamProgressPage.tsx` ### Checkpoint: Complete - [ ] Focused and full tests pass without skips. - [ ] Lint and build pass. - [ ] Runtime review confirms no console errors or horizontal overflow. - [ ] Final diff contains only the spec, plan, focused tests, and team-progress UI. ## Risks and Mitigations | Risk | Impact | Mitigation | |---|---|---| | A code appears under the wrong Series | High | Join only on exact `seriesId` and cover opponent/other-Series codes in tests. | | Global and local game numbers are confused | High | Lead with `ordinal` as set number and demote `displayNumber`. | | Adjudication looks like a played 0–0 | High | Reuse tested outcome/score helpers from Competition history. | | Clipboard permissions fail silently | Medium | Return a typed result and render an alert with manual-selection guidance. | | Long codes overflow at mobile widths | Medium | Use `minmax(0,1fr)`, `break-all`, selectable text, and a stacked mobile row. | | Shared Series card changes bracket dimensions | Medium | Preserve the bracket variant's fixed geometry and compact metadata treatment. | ## Dependencies ```text View-model tests -> view helpers -> code component -> page composition Existing history outcome helpers -> Series score semantics -> recent results ``` ## Open Questions None.