feat: link competition games to detail analysis

Route each result-history Game by its global display number and preserve the Competition return target. Refuse stale detail fallbacks so a missing requested Game cannot silently show another Game.
This commit is contained in:
dahyeon committed 2026-07-13 10:41:44 +00:00
1 parent 3c60081ece
commit 3bd3120eb1
11 files changed
+382 -54

No files matched your search

+80
View File
@@ -108,6 +108,84 @@ and preserve all current Competition/API contracts.
- [x] Git diff contains only the feature spec, plan, tests, model, and UI integration.
- [x] Unrelated working-tree files are unchanged.
### Phase 3: Game Detail Navigation
#### Task 5: Specify the canonical Game route test-first
**Acceptance criteria:**
- [x] A Game whose `ordinal` and `displayNumber` differ links with
`displayNumber`.
- [x] Non-positive or non-integer legacy display numbers do not produce a broken
detail link.
- [x] The focused test is observed failing before the route adapter exists.
**Verification:**
- [x] Run the focused Node test for RED and GREEN states.
**Files likely touched:**
- `apps/web/test/competition-series-history.test.ts`
- `apps/web/src/components/competition/competition-series-history.ts`
#### Task 6: Make disclosed Game rows navigable
**Acceptance criteria:**
- [x] The full Game row is one React Router link with an always-visible detail cue.
- [x] The link carries the current Competition location as `backTo` and a Korean
return label.
- [x] Mobile targets are at least 44px high; keyboard focus is visible; hover and
active states use restrained semantic-primary coral accents.
- [x] The scoped primary token keeps that coral accent in both themes without a
global dark-theme color migration.
- [x] Winner, score, and status colors retain their existing domain meaning.
**Verification:**
- [x] Focused and full web tests pass.
- [x] Changed-file ESLint and the production web build pass.
- [x] Independent review checks route identity, interaction semantics, accessibility,
and unrelated working-tree preservation.
**Files likely touched:**
- `apps/web/src/components/competition/CompetitionGameHistory.tsx`
- `apps/web/src/components/competition/CompetitionSeriesHistory.tsx`
- `apps/web/src/components/competition/CompetitionResults.tsx`
#### Task 7: Refuse incorrect Game-detail fallbacks
**Acceptance criteria:**
- [x] Exact requested Game numbers resolve to that Game.
- [x] Missing or invalid requested Game numbers return no selection instead of the
first Game.
- [x] The detail page renders an explicit missing-Game state with the preserved return
target.
- [x] The policy is covered by an observed RED→GREEN pure regression test.
**Verification:**
- [x] Focused selection tests, full web tests, changed-file ESLint, and build pass.
**Files likely touched:**
- `apps/web/src/lib/internal-match-game-selection.ts`
- `apps/web/src/pages/MatchGameDetailPage.tsx`
- `apps/web/test/internal-match-game-selection.test.ts`
### Checkpoint: Navigable Game History
- [x] Every valid recorded Game opens its own internal-stat detail view.
- [x] Browser back and the detail page return link restore the Competition result
page.
- [x] Invalid legacy route data degrades to a non-clickable row instead of a wrong
destination.
- [x] A stale detail payload cannot substitute a different Game for the requested
route.
## Risks and Mitigations
| Risk | Impact | Mitigation |
@@ -117,6 +195,8 @@ and preserve all current Competition/API contracts.
| KST day changes by deploy environment | Medium | Use explicit `Intl.DateTimeFormat` timezone and boundary tests. |
| Long team names break mobile rows | Medium | Use balanced minmax columns and allow wrapping. |
| Existing dirty work is overwritten | High | Restrict patches and verification to named feature files. |
| Series-local ordinal opens another Series' Game | High | Generate routes only from tested global `displayNumber`. |
| Coral is mistaken for the winning side | Medium | Restrict primary color to interaction edges, focus, and arrows. |
## Open Questions