Implement the 012-turn-navigation feature that adds a RetreatTurn domain operation and relocates turn controls to a navigation bar at the top of the encounter tracker

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-05 23:11:11 +01:00
parent a0d85a07e3
commit 7d440677be
19 changed files with 946 additions and 13 deletions

View File

@@ -0,0 +1,49 @@
# Quickstart: Turn Navigation
## Prerequisites
- Node.js 20+
- pnpm
## Setup
```bash
pnpm install
```
## Development
```bash
pnpm --filter web dev # Start dev server at localhost:5173
```
## Testing
```bash
# Run all tests
pnpm test
# Run only retreat-turn domain tests
pnpm vitest run packages/domain/src/__tests__/retreat-turn.test.ts
# Run tests in watch mode
pnpm test:watch
```
## Quality Gate
```bash
pnpm check # Must pass before every commit (knip + format + lint + typecheck + test)
```
## Key Files for This Feature
| File | Layer | Purpose |
|------|-------|---------|
| `packages/domain/src/retreat-turn.ts` | Domain | Pure RetreatTurn function |
| `packages/domain/src/events.ts` | Domain | TurnRetreated + RoundRetreated event types |
| `packages/domain/src/__tests__/retreat-turn.test.ts` | Domain | Acceptance scenario tests |
| `packages/application/src/retreat-turn-use-case.ts` | Application | Use case orchestration |
| `apps/web/src/components/turn-navigation.tsx` | Adapter | Turn nav UI component |
| `apps/web/src/components/action-bar.tsx` | Adapter | Remove Next Turn button |
| `apps/web/src/App.tsx` | Adapter | Wire up new component |