CREW tab: crew roster with good/bad traits #7

Closed
opened 2026-09-28 23:13:04 +02:00 by kamilkrzywda · 1 comment
Owner

Goal

Make the CREW tab functional: a real crew roster — members found during exploration (plus a small starting crew), each with name, role and one good / one bad trait.

Scope

  • DB: crew table (id, name, role, trait_good, trait_bad, origin/where-found). Starting crew seeded on new game; exploration outcomes can add crew members.
  • API: GET /api/crew. Update OpenAPI spec.
  • Frontend: cards rendered from API — name/role + good (+) / bad (−) trait each, plus where they came from. No placeholder crew.

Acceptance criteria

  • Unit tests: starting crew shape, traits always present (one good, one bad), crew added by exploration outcome.
  • e2e: after exploring a planet that yields crew, the new member appears as a card with both traits; persists across restart.
  • Local verify green: tsc / vitest / playwright --list (+ build DOM check).

Dependencies

After LOCAL SYSTEM issue (crew arrives via exploration).

## Goal Make the CREW tab functional: a real crew roster — members found during exploration (plus a small starting crew), each with name, role and one good / one bad trait. ## Scope - **DB:** `crew` table (id, name, role, trait_good, trait_bad, origin/where-found). Starting crew seeded on new game; exploration outcomes can add crew members. - **API:** `GET /api/crew`. Update OpenAPI spec. - **Frontend:** cards rendered from API — name/role + good (+) / bad (−) trait each, plus where they came from. No placeholder crew. ## Acceptance criteria - Unit tests: starting crew shape, traits always present (one good, one bad), crew added by exploration outcome. - e2e: after exploring a planet that yields crew, the new member appears as a card with both traits; persists across restart. - Local verify green: tsc / vitest / playwright --list (+ build DOM check). ## Dependencies After LOCAL SYSTEM issue (crew arrives via exploration).
Author
Owner

Done in v0.5.0 (PR #14, merge commit f5cba45).

  • DB: crew (name, role, trait_good, trait_bad, origin)
  • Gen: pure + seeded in lib/game/crew.ts — 352 name combos unique on ship, 8 roles, 10 good + 10 bad traits; starting crew of 2–3 with unique roles
  • Exploration: ~18% of scans yield a joining member (CREW_CHANCE pinned by test); appended to the same per-planet rng stream so resource/part outcomes are unchanged and everything stays deterministic per save+planet
  • API: GET /api/crew; POST /api/explore carries crewFound; OpenAPI updated in code
  • UI: CREW tab renders live roster cards — name + role, +good / −bad traits, ORIGIN line; refetch on tab open
  • Tests: unit 29→38, e2e 10→11 (real cards show both traits; roster survives the mid-run container restart)

Deployed to https://space-wanderer.dev.kkhost.pl — verified /api/version → 0.5.0 and live crew (3 starting members). Note: prod DB wiped once after deploy because the pre-existing v0.4.0 save predates crew seeding; a versioned idempotent backfill lands with #8 so saves survive future feature additions without wipes.

Done in v0.5.0 (PR #14, merge commit f5cba45). - DB: `crew` (name, role, trait_good, trait_bad, origin) - Gen: pure + seeded in lib/game/crew.ts — 352 name combos unique on ship, 8 roles, 10 good + 10 bad traits; starting crew of 2–3 with unique roles - Exploration: ~18% of scans yield a joining member (CREW_CHANCE pinned by test); appended to the same per-planet rng stream so resource/part outcomes are unchanged and everything stays deterministic per save+planet - API: GET /api/crew; POST /api/explore carries crewFound; OpenAPI updated in code - UI: CREW tab renders live roster cards — name + role, +good / −bad traits, ORIGIN line; refetch on tab open - Tests: unit 29→38, e2e 10→11 (real cards show both traits; roster survives the mid-run container restart) Deployed to https://space-wanderer.dev.kkhost.pl — verified /api/version → 0.5.0 and live crew (3 starting members). Note: prod DB wiped once after deploy because the pre-existing v0.4.0 save predates crew seeding; a versioned idempotent backfill lands with #8 so saves survive future feature additions without wipes.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/SpaceWanderer#7