1
0
Fork 0
Commit graph

6 commits

Author SHA1 Message Date
33f3f7aa75 feat(minigames): add phasing-out status with estimated removal date
Add a "phasingOut" minigame status and an `estimatedRemovalDate` field so a
game can be announced as leaving soon while staying fully playable and keeping
scoring periods (unlike retired games). Visibility is the only difference:

- Sidebar badge + tooltip (amber "Phasing out", countdown to removal) in
  NavMinigames, via new phasingOutTooltip in countdown.ts.
- In-game banner (PhasingOutBanner) on all 9 game pages, wired from
  getMinigameReleaseState (added the fetch to call-for-fire, which lacked it).
- registry.ts status union + field; loadRegistry.ts maps the field;
  config status select + estimatedRemovalDate date field added.
- Migration adds the enum value and column (idempotent); types + db schema
  regenerated.

Adds tests for visibility, round-trip, and period scoring; updates the
minigames domain guide.
2026-10-14 23:51:37 -04:00
005ff0e5df feat(minigames): add Call for Fire: Versus multiplayer artillery duel
Head-to-head artillery duel in a new "multiplayer" registry category
(out of periods). Each operator hides a fire-base fleet on a 10x10 grid,
then takes turns calling fire: the first mission is a grid designation,
every later shot adjusts from that operator's last impact using the
single-player range/deflection controls. First to reduce every enemy
emplacement wins; a cap decides on emplacements then cells.

Pure engine in src/lib/minigames/call-for-fire-versus (engine, views,
types, constants) is client-safe and unit-tested. The server-only
registry mirrors the blackjack table pattern (globalThis-anchored Map,
lobby, per-turn timeout, expiry sweep, single-instance only); its views
are built per viewer so the opponent's fleet layout never leaves the
server. The client polls the match snapshot (the in-memory SSE bus is
unreliable across dev module copies). Rewards on completion update the
callForFireVersus profile group, pay XP and chips, and emit
minigame:call-for-fire-versus.

Wires the game into the registry (new multiplayer category + enum
migration), the sidebar grouping, the command palette, and the profile
XP aggregation. The registry row seed is split into its own migration
because Postgres forbids using a freshly added enum value in the same
transaction.

Verified: 21 new tests (engine + registry) plus the wider minigame suite
pass; tsc clean; a live two-player award run confirmed XP, chips, and
the event.
2026-10-11 21:55:39 -04:00
0bb9719139 feat(minigames): show upcoming games as disabled with a release countdown
- Optional `estimatedReleaseDate` (date and time) on the minigames registry,
  with a named migration and regenerated types.
- Sidebar: an `upcoming` game renders greyed out and non-interactive, with a
  tooltip carrying the estimate and a live countdown. It is a hoverable row
  rather than a disabled menu item, because a disabled Radix item sets
  `pointer-events: none` and would swallow the tooltip.
- Page gate: each minigame page checks its registry status and renders
  `MinigameComingSoon` instead of the arena while the game is upcoming, so a
  typed URL cannot reach unfinished gameplay. The date is display only: the
  game goes live when an admin flips `status` to active.
- Leaderboards exclude upcoming games, so they get neither a tab nor a board.
- Pure `countdown.ts` formatter plus a client ticker that computes the
  remaining time only after mount, avoiding an SSR hydration mismatch.

Note: `registry.ts`, `payload-types.ts` and `migrations/index.ts` also carry
the Call for Fire registry row and its generated types. That feature was
committed as 6d6a5fb and announced a separate commit for those files; they are
included here because they are entangled with these edits in the same files.

Tests: pure countdown unit tests, registry/gate/leaderboard integration tests,
and an e2e that seeds an upcoming row, hovers the disabled sidebar entry to
assert the tooltip, and checks the coming-soon gate.
2026-10-11 18:47:43 -04:00
316797d27d feat(minigames): add period leaderboards, all-time view and achievements
Phase 5 of the minigame periods feature:

- Read model (lib/minigames/periods/standings.ts) that shapes period boards
  from the ledger (rank, placement points, names) and All-Time boards from the
  untouched profile aggregates into one row type.
- GET /api/minigames/leaderboards: ?period=current|<id>|all-time, returning
  the period, the period list, the boards and the achievements honor roll.
- New /minigames/leaderboards page: period selector (current, every past
  period, All-Time), per-game tabs, and the achievements honor roll. Core-only
  in period mode; every registered game in All-Time.
- Shared client pieces: useLeaderboards hook, StandingsTable,
  PeriodStandingsCard (period by default, All-Time toggle) and
  AchievementsHonorRoll.
- Each Core game page gains an "Anchored period standings" card so the period
  board is visible on the game itself; its existing all-time board and
  mode/difficulty selectors are untouched, and it links to the full page.
  (Plan said replace the inline board; keeping it preserves the per-mode
  selectors, so the period board is added instead. Easy to swap if you prefer.)
- Ledger fetch helper extracted to lib/minigames/periods/ledger.ts.
- Integration test for the period boards, the All-Time path and the honor roll.
2026-10-11 17:06:52 -04:00
deb88ded56 feat(minigames): drive the nav and period scoring from the registry
Phase 4 of the minigame periods feature:

- Server registry loader (lib/minigames/loadRegistry.ts) reads the
  minigames collection and falls back to the built-in seven when it is empty
  or unreadable, so the nav and boards never render blank.
- The sidebar minigames dropdown now renders from the registry (Core and
  Cardtable groups, retired games hidden, registry order), with lucide icons
  resolved from the icon-name string through a client icon map and a
  safe fallback.
- Period scoring is registry-driven: the close pipeline uses core games with
  countsForPeriods instead of a hardcoded list. A retired game simply stops
  accruing entries and drops out of the next period while its history stays.
- Integration tests for the fallback, ordering, retirement filtering and the
  non-scoring-game exclusion; the older minigame specs now wipe the registry
  too so files stay order-independent.
2026-10-11 17:06:52 -04:00
ad2fbb167a refactor(nav): sidebar minigames group, inline admin link, hidden map entry
Move minigame links from the user dropdown into a NavMinigames sidebar group, inline the admin link in AppSidebar via a new canAccessAdminPanel helper, guard NavCore against empty groups, drop the feedback secondary link, and add an empty navMap slot with a restore comment so the World Map ships hidden while /map stays live.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-09-16 23:14:16 -04:00