1
0
Fork 0
Commit graph

368 commits

Author SHA1 Message Date
76c01d2f3c feat(minigames): run Ordnance Disposal at 20 Hz, fix float-dust glide rest
Halve TICK_MS (100 -> 50) so every snapshot-bound surface (opponents,
explosions, drops) arrives twice as fresh, and double every hardcoded
tick-denominated constant so real-world durations stay identical:
BOMB_FUSE_TICKS 25->50, FLAME_LIFETIME_TICKS 3->6,
SUDDEN_DEATH_INTERVAL_TICKS 40->80, SPAWN_INVULNERABLE_TICKS 10->20.
TPS-derived durations (round timer, countdown, end hold) scale on their
own. Client fuse-blink and flame-fade thresholds are now derived from
the constants instead of hardcoded for 10 Hz.

Fixes a latent engine bug the old rate masked via lucky float rounding:
approach() snapped to the target only when the remaining delta was
<= step exactly, so a multi-tick glide accruing float dust (5.3 + 0.35
= 5.6499999999999995) could overshoot on the final step and park the
technician at 5.999999999999999 forever (isCellCentered accepted it,
Number.isInteger did not). approach() now tolerates step + 1e-6 and the
movement loop snaps resting positions to whole cells, restoring the
documented rest-exactly-on-center invariant at any tick rate.

Docs: registry header and minigames AGENTS.md updated to ~20 Hz; also
corrected stale rate-limit (40/s) and polling (500ms fallback) notes.
2026-10-16 15:25:24 -04:00
99e610e955 feat(minigames): tighten Ordnance Disposal feel, ghost charges and flight-safe correction
Two client-side follow-ups from the first prod playtest of prediction v2:

Reconciliation no longer position-corrects while the latest inputs are still
in flight. In that window the server legitimately trails the local sim (it is
still applying the previous direction), and the previous always-on 20% pull
dragged the sprite backwards on every turn and key release; that drag is what
made movement feel heavy even after prediction landed. Soft correction now
only runs once every sent input is acknowledged and the gap exceeds a 0.4
cell deadzone, pulling the excess; the teleport hard-snap is unchanged.

Dropping a charge now renders an optimistic ghost at the technician's cell
the same frame, mirroring every server rejection rule against the freshest
state. The ghost blocks movement like a real charge (but cannot be kicked),
burns its fuse on the local clock, and is retired per snapshot by a bomb at
its cell, by a fresh bomb owned by our seat (possibly one cell away when the
server trailed the displayed position), or by a 1.2s expiry covering server
rejections.
2026-10-16 15:04:15 -04:00
7935e857af feat(minigames): make Ordnance Disposal movement feel instant
The client rendered the local technician only from server round trips, so
every keypress showed up RTT + tick + easing late (roughly 250-500ms in
production, per HAR analysis of a live playtest). Two changes, shipped
together:

Direction edges now fire immediately with a monotonic seq instead of queueing
behind an in-flight POST. The registry applies only strictly newer seqs, so
out-of-order action POSTs can never resurrect a stale intent, and echoes the
last applied seq back in every snapshot for client reconciliation.

The client predicts its own seat locally with a line-level port of the
engine's movement rule (align-first turns, blocked settle, slip-to-rest,
kick-push with an optimistic overlay) and reconciles per snapshot by
replaying unacknowledged inputs forward from the server position, timed by
send time plus measured latency, instead of snapping toward a stale sample.
A soft 20%/frame correction absorbs sub-cell error; teleports and round
resets still snap.
2026-10-16 01:41:19 -04:00
bfb5cea3c1 feat(minigames): add Ordnance Disposal (bomperator) multiplayer drill
Add a 2-8 player free-for-all Bomberman-style charge-clearing drill at
/minigames/bomperator, category multiplayer. Pure engine plus a single-instance
in-memory match registry, mirroring the call-for-fire-versus split but upgraded
from turn-based to a fixed ~10 Hz tick loop.

Engine (src/lib/minigames/bomperator): seeded RNG via state.rngState/gridSeed;
grid is 15x13 with border, even/even pillars and seeded crates; classic pickups
bomb/range/speed/kick. Movement is grid-locked with sub-cell interpolation,
charges fuse about 2.5s, cross-flames stop at walls, crates are destroyed and
charges chain-detonate and kick-push. Round ends at one alive; sudden death
spawns random explosions after 150s with a draw guard.

Registry (registry.ts): one setInterval per live match started on startMatch and
cleared on complete/dissolve; globalThis-anchored map; holds seats across a
reconnect window then eliminates; below two active seats it dissolves. On a
manual end, broadcasts a bomperator-terminated event so remaining players see a
toast, then awards rewards via stats.ts (minigame:bomperator, profile group
bomperator: matchesPlayed/matchWins/roundsWon/kills/xpEarned).

Clients POST rate-limited inputs and poll fetchBomperatorMatch; the SSE bus pushes
snapshots with a guarded slow-poll fallback. Registry row ships as upcoming so the
page renders the coming-soon shell until an admin flips it active. Adds the
migration for the stats group, the minigame:bomperator event type, XP
aggregation on the profile, generated types, and real-time event wiring.
2026-10-16 00:32:52 -04:00
1d6db3b92b Merge branch 'feat/first-party-analytics'
# Conflicts:
#	src/migrations/index.ts
2026-10-15 00:17:58 -04:00
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
c299acbe4f feat(npc-dialogue): condition groups and ternary text tokens
Conditions become a discriminated union: the existing flag leaf plus a
single-level group combining leaves with AND / OR / NOR. The evaluator
recurses one level, and every flat-assuming site (choice gating, graph
validation, editor, canvas previews) is group-aware; DB entry gates stay
flat by design. The node editor gains a shared condition builder with a
combinator dropdown and repeatable rows for both branch nodes and gated
choices.

Display strings also gain ternaries: {{ key ? yes : no }}, {{ !key ? .. }},
and numeric compares like {{ rep >= 5 ? .. }}. A brace-depth scanner
rewrites ternaries over bounded passes so branches may nest flag tokens
and even nested ternaries, then plain interpolation runs its single
never-rescanned pass. Ternary keys join collectNodeTokens so the server
reads exactly the flags a node needs.
2026-10-14 16:21:16 -04:00
a1aaed913d feat(npc-dialogue): attach files to conversation lines
Nodes can carry pointers to media docs (transcripts, sealed orders,
images). Authors upload from the node editor (gated on
npc-dialogues:update); the runtime resolves ids to file URLs server-side
and players open them in a dossier-styled viewer modal with download
and new-tab escape hatches. Deleted media resolve to nothing instead of
dead chips.
2026-10-14 16:05:15 -04:00
799c3216d2 feat(npc-dialogue): back NEW badges with server-side read markers
The per-browser localStorage tracking reset on every new device and kept
re-badging whole conversations whenever a GM edited the flowchart (hash
change), which players read as "nothing I read is remembered". Read
progress now lives in a npc-dialogue-states collection: one row per
(user, dialogue, node) with a unique index, so a node badges NEW exactly
once per player and GM edits never re-flag content they already saw.

- New collection NpcDialogueStates (own-doc access, staff-visible admin
  view) plus migration add_npc_dialogue_states.
- lib/npc-dialogue/states.ts: listSeenNodeIds for the page and an
  idempotent markNodeRead; exposed via the markNpcDialogueNodeRead
  server action, called fire-and-forget as nodes type in.
- The contacts page seeds initialSeenNodeIds into NpcConversation; the
  component keeps an optimistic local set and no longer touches
  localStorage. seen.ts and its tests are removed.

Verified live: fresh account shows NEW on all choices, reading the
"Who are you?" branch and reloading drops that badge while unread
branches keep theirs; npc_dialogue_states holds exactly the traversed
nodes. Interpolation int suite green (30/30).
2026-10-14 15:35:47 -04:00
268d4bb117 feat(analytics): add first-party analytics collector, SDK, rollups, and admin dashboard
Phase 1 of replacing Microsoft Clarity with first-party usage analytics:
- Plain Postgres tables via shared DDL module (src/lib/analytics/schema.ts)
  executed by both the add_analytics_tables migration and the test bootstrap;
  test-db.ts drops them around drizzle push (composite-PK introspector bug)
- /api/collect beacon collector with IP/UA enrichment, retroactive login
  attribution, bot blocklist, per-IP rate limiting, strict validation
- Client SDK (src/lib/client-analytics): SPA pageviews, clicks, scroll depth,
  focus, data-track visibility, heartbeats; NEXT_PUBLIC_ANALYTICS_DEV=1 dev
  gate with console mirror; mounted beside Clarity in the two frontend layouts
- Hourly rollup + daily retention bins (payload analytics-rollup/-purge)
- Chronicle read progress/completion, wiki new-clicked/created, minigame
  route mapping custom events
- admin:analytics:manage permission (+ roles enum migration) and the
  /admin/analytics Payload view with six recharts-backed report panels
2026-10-14 12:12:53 -04:00
fe57d63311 fix(garage): always fit the vehicle bay grid to its container
Cell size was computed from the wrapper width without subtracting the
inventory frame's p-2 padding and borders, so the grid was ~16px wider
than its container and grew a horizontal scrollbar. Subtract the 18px
frame chrome, lower the cell floor 40->24 (legibility guard only), and
switch the wrapper to overflow-hidden so no scrollbar can appear.
2026-10-13 16:43:16 -04:00
45bb0bd029 feat(garage): rotate vehicle thumbnails with their cards
Vehicle orientation is meaningful in a bay, so a parked-then-turned
vehicle now shows its silhouette turned too. The rotated image is sized
from the card's pixel dimensions (long edge against the card height) and
anchored to the card centre so the 90deg turn happens around the middle
instead of clipping against the top edge. Name labels stay upright.
2026-10-13 16:43:02 -04:00
7c135cd282 fix(grids): resize drag preview when rotating mid-drag
dnd-kit pins the DragOverlay container to the activator rect measured
at drag start, so pressing R while dragging left the preview at the
pre-rotation footprint (a square-ish box for elongated items). Pass the
live rotated dimensions through the DragOverlay style prop, which is
spread after the pinned rect, in all three R-to-rotate grids: garage
vehicle bay, locker, and structure storage.
2026-10-13 16:42:50 -04:00
0d73da1142 feat(garage): grid UI with dispatch and store, replacing deployed vehicles list 2026-10-13 16:02:58 -04:00
75817ed3fe feat(contributions): fade the XP hint out and polish the amount 2026-10-13 15:52:57 -04:00
f481efb108 feat(contributions): add a reusable XP hint with a glint animation 2026-10-13 15:27:00 -04:00
076de5d60c feat(journals): animate the XP hint 2026-10-13 15:27:00 -04:00
88d674cff6 feat(journals): hint when a draft will earn XP 2026-10-13 15:20:59 -04:00
283cd3f4b2 chore(nav): relabel the contributions leaderboard entry to Contributions 2026-10-13 15:13:10 -04:00
420bc06f84 fix(journals): cut the card excerpt at the first paragraph 2026-10-13 15:02:23 -04:00
0a955035a1 fix(journals): preserve paragraph breaks in the card excerpt 2026-10-13 14:59:21 -04:00
f1634fb335 fix(editor): space paragraphs in the shared rich text editor 2026-10-13 14:59:21 -04:00
49bc918c67 feat(contributions): add staff moderation panel to grant and revoke XP 2026-10-13 14:46:10 -04:00
668c9f4ea6 feat(sidebar): add live in-universe clock under the logo 2026-10-13 13:20:16 -04:00
45c626bbd2 feat(journals): cap in-world date at present and add "days since awakening" subtitle
- Reject in-world dates after the current in-game date (now + 47,326 days)
- Default the date picker to the present in-universe date when composing
- Show a subtitle with the formatted date and days since the Awakening
2026-10-13 12:33:19 -04:00
b1dbf5569c feat(journals): min in-world date 2156-03-19 and main-ops-only related mission dropdown
- Reject any journal in-world date before March 19, 2156 in the
  create/update validation (server-side) and add min to the date picker.
- Filter the related-mission dropdown to operationType = "main" only.
2026-10-13 12:13:49 -04:00
e1cfdd3329 feat(dashboard): apply the tactical dossier style to the remaining widgets
Wallet, Negotiations, My Tickets, Notifications, Upcoming Missions,
Active Campaigns and Recent Events were still conventional shadcn Item
cards while Service Summary, Mission Briefing and Situation Report already
used the dossier primitives. Wrap them in the shared TacticalFrame so the
whole dashboard reads as one board:

- classification strip naming the domain (Logistics // Banking,
  Helpdesk // Tickets, and so on), with a REF code on the wallet
- squared corners, corner brackets and the faint grid texture
- an inner header row of icon + uppercase title + action link, matching
  the Service Summary widget
- squared (rounded-sm, bordered) status pills for tickets and campaigns
- a ReadoutFooter on the wallet (account id + status) via the shared
  ReadoutFooter primitive

Empty and self-hiding states are preserved, and the wallet's no-account
path still returns the conventional MyWalletCard CTA. Also drops a dead
CLOSING_STATUSES import from MyTickets.
2026-10-13 11:08:56 -04:00
9bfe43ad71 fix(dashboard): drop the mission widget header row
The Operations // Last Mission widget carried a header row whose left side
repeated the mission code name already shown on the card below, and after
that duplication was removed the row held only a lone right-aligned
"View all" link floating in an empty band. Remove the row entirely: the
frame strip names the section and the mission card carries its own
"View details" affordance.
2026-10-13 10:38:45 -04:00
6be2af2f86 fix(banking): render currency emblem inline to stop the hydration mismatch
CurrencyAmount returned a div, but callers place it inside p and span
(wallet hero balance, account cards, unit funds), which is invalid nesting:
the browser's parser closes the p early, so server and client markup differ
and React reports a hydration error on the banking pages. An inline-flex
span renders identically in all four call sites and is valid in each.
2026-10-12 23:04:29 -04:00
9c3870cf79 fix(mobile): meet the 24px tap-target floor across the app
Session A measured 159 targets under the WCAG 2.5.8 minimum on 42 routes;
this brings that to zero. Mostly one-line spacing changes: small caption
labels and text links were 14-21px tall because shadcn Label/Button use
leading-none and bare text links carry no vertical padding.

- shared Dialog close button: p-1 with right-3/top-3 so the 24px hit box
  keeps the icon where it was
- tour card: Skip all tours (13 routes), All boards on standings cards (6)
- detail pages: 27 Back links, journals All journals, wiki category
  links, voiceover card titles, factions batch link
- dashboard: 7 View all / View full record links
- account preferences: mute rows min-h-6, radio and tours labels, plus
  contacts filter labels and the campaigns show-completed label
- ribbon studio: mirror label and stripe/module remove buttons
- helpdesk ticket titles, radio tick-sound label
2026-10-12 22:17:51 -04:00
55f6598569 fix(mobile): resolve horizontal overflow and touch-only affordances
Mobile audit (390x844) found overflow on 6 routes; all now clean.

- Tabs: TabsList is inline-flex and widened the page when several tabs
  were present (roster doc 639px, helpdesk 510px). It now scrolls
  (max-w-full + overflow-x-auto); TabsContent gets min-w-0 and the roster
  Tabs min-w-0 so the org tree's own scroller can clip instead of the
  page growing
- Item: ItemHeader/ItemFooter had flex-basis 100% with min-width auto, so
  a long title forced the card wider instead of shrinking. Shared min-w-0
- ResourceCard: the description rendered twice (once inside ItemContent,
  once as ItemDescription) and both fought for one flex line, crushing
  the content column to 27px. Single description, full-width rows,
  truncating title (min-w-0 + items-stretch so nowrap spans can clip),
  shrink-0 badges
- awards/design: stripe row wraps instead of exceeding the viewport
- leaderboards: flappy table and the shared StandingsTable scroll
  horizontally rather than widening the page
- blackjack: explicit grid-cols-1 (minmax(0,1fr)) so the arena's implicit
  track cannot outgrow the viewport
- campaigns: card readout was revealed only on hover, unreachable on
  touch; now always visible on coarse pointers and hover-revealed only
  on pointer-fine
2026-10-12 20:17:21 -04:00
25df38cdd3 fix(sidebar): match Banking and Market nav icons to their page headers
Banking used TrendingUp and Market used ShoppingBag in the sidebar while
the pages render Landmark and Store respectively; adopt the page icons
2026-10-12 16:21:05 -04:00
8a7d79c369 feat(journals): member-authored journal entries with author-owned publishing
- New Journals collection (Chronicle group): title, Lexical body, status
  draft/published, optional in-world date and mission link; authors read,
  edit, and delete their own entries at any status while every logged-in
  user reads published ones; journals:* staff permissions bypass ownership
  and gate the admin page (registered in the permission registry)
- /journals list with compose dialog and /journals/[id] reader reusing the
  Chronicle typography; edit/delete controls for authors and staff; drafts
  carry the DraftBadge and stay invisible to everyone but their author
- Server actions create/update/delete with ownership checks, publish-time
  journal:created and journal:deleted feed events (journals added to the
  GameEventLogs target collection enum via migration)
- Sidebar entry under Chronicle, command palette destination, admin panel
  icon; excerpt extractor as a pure module (src/lib/journals/excerpt.ts)
- Access-control integration spec covers draft privacy, publish visibility,
  non-author write blocking, and staff override (5 tests)
2026-10-12 14:39:48 -04:00
3604c1d146 feat(sidebar): pin Platform section to top during reorder
- normalizeSidebarOrder moves pinned sections (Platform) to the front, so
  even hand-crafted stored orders cannot displace it; enforced server-side
  in updateSidebarOrder via the same helper
- Customize mode renders Platform statically with a pin marker instead of
  a drag grip; only the remaining sections are sortable
- Spec updated: user order preserved after the pinned head, new pinning test
2026-10-12 14:02:21 -04:00
0ca35ec251 feat(sidebar): add server-persisted section reorder with customize mode
- preferences.display.sidebarOrder json field on Users + named migration
  add_sidebar_order_preference + regenerated types
- New pure helper src/lib/sidebar/order.ts (section ids, labels, default
  order, normalizeSidebarOrder) modeled on lib/dashboard/layout.ts, with
  tests/int/sidebar-order.int.spec.ts covering fallback/dupes/missing ids
- AppSidebar renders sections from the normalized order; feature-flagged-off
  sections skip their slot and keep stored positions
- Customize mode: dnd-kit sortable grips on group headers, save-on-drop via
  new updateSidebarOrder action, Reset clears the preference, Done exits;
  hidden while the sidebar is collapsed
- updateSidebarOrder sanitizes server-side and rewrites full preferences
- Fix sibling clobbering: saveDashboardLayout now preserves sidebarOrder,
  and updatePreferences now preserves both sidebarOrder and dashboard.layout
2026-10-12 13:46:48 -04:00
8fb97fdd1c feat(dashboard): demo tactical dossier styling on hero widgets
- New shared TacticalFrame/ReadoutFooter primitives (classification strip,
  corner brackets, faint grid texture, mono readout bar) following the
  campaign-card recipe; each piece separable per widget
- ProfileSummary: full frame + service-record readout footer (XP/level/rank/assignments)
- MissionBriefing: frame + codename line, inner MissionCard kept conventional
- QuickStats: hairline-separated situation-report readout bar
- Dense widgets (events, tickets, notifications, wallet, negotiations) stay
  shadcn so the tactical surfaces stand out
2026-10-12 13:26:21 -04:00
620c0a9d7d chore(call-for-fire-versus): use a hyphen for the empty impact placeholder 2026-10-12 00:02:48 -04:00
49782365c2 chore(call-for-fire-versus): finish place/structure wording in help and errors
Completes the terminology pass: the "How to place" help block and the
engine's user-facing error strings ("Missing structure", "Structures cannot
overlap", "Placement is closed", "The opponent has not placed their
structures") now match the place/structure/target vocabulary used elsewhere
in the duel. Also splits a comment that had been merged onto the scoreOf
declaration. Strings only; no behavior change.
2026-10-12 00:01:34 -04:00
c3d3c8c574 chore(call-for-fire-versus): replace emplace/bracket wording
- Intro, metadata, placement card, error strings, and lobby phase label now
  use place/target/structure instead of emplace/bracket
- Leave the "How to emplace" help block unchanged for now
- Refresh the registry blurb and add a data migration to update the seeded
  minigames description
2026-10-11 23:25:49 -04:00
6bcf229268 feat(command-palette): add missing destinations, queue shortcuts, mini XP toggle
- Add 11 destinations that exist in the app but were absent from the palette:
  World Map, Event Log, Operations, Ops Ledger, Reservations, Supply Boxes,
  Promotions, Leaderboard, Minigame Leaderboards, Chronicle, Surveys
- Show G N / G A shortcut labels for Notifications and Admin (chords were
  already wired in KeyboardShortcutsProvider but unlabelled)
- Add a Toggle Mini XP Display action mirroring the sidebar control
- Add an Open Unassigned Tickets queue shortcut and point Create Support
  Ticket at the compose deep link
- Teach /helpdesk to open the create dialog via ?compose=1 and to preselect
  a filter tab via ?view=unassigned
2026-10-11 23:06:36 -04:00
16e4b9f60d feat(minigames): rotate the L ammo depot around its fixed elbow anchor
The L now pivots on its elbow (corner) cell instead of being re-laid-out in
its bounding box, so rotating keeps that one cell in place instead of
shifting the whole piece. Orientation 0 is the L look with the elbow at the
bottom-left and arms up and to the right.

Cells are the anchor plus two arm vectors rotated in quarter-turns, so the
anchor is always occupied. The editor recovers a stored emplacement's
(anchor, rotation) by matching its cells against every candidate, and the
engine test asserts the anchor cell is present in all four orientations.
2026-10-11 22:46:36 -04:00
c8f625b12c feat(minigames): make the Ammo Depot an L-shaped block with four-way rotation
The Ammo Depot is now a 3-cell L (a 2x2 box minus one corner) instead of a
2-cell line. Emplacement orientation becomes quarter-turns (0-3) so the L
can turn through all four; lines still use 0/1, the square ignores it.

The editor seeds an emplacement's rotation by matching its stored cells
against each orientation, the rotate toggle shows "Rotate 90°" for the L,
and the engine/rotation tests cover the four L orientations.
2026-10-11 22:36:51 -04:00
8afbf00805 feat(minigames): add procedural SFX and hit explosions to the versus duel
Sound is synthesized with the Web Audio API (no new assets): a launch
thump on fire, noise-burst impacts (splash for a miss, a bigger double
boom for a destroyed emplacement), a chime when the turn passes to you,
and victory/defeat fanfares. A mute button and volume slider live in the
match header; the setting persists per browser
(polaris:call-for-fire-versus-sound).

Adds a one-shot explosion VFX on hit and destroyed cells on both boards
(larger burst for a destroyed emplacement), suppressed under
prefers-reduced-motion. Only shots that arrive while watching animate, so
loading a match does not replay every past hit.
2026-10-11 22:28:10 -04:00
a1a2dbdcac feat(minigames): highlight the selected emplacement and add rotation controls
Ring the selected emplacement's grid cells and document the controls in
the editor help text. Rotate a placed emplacement in place by
double-clicking it or by pressing the Horizontal/Vertical toggle (the
toggle also sets the orientation for a new placement, and is disabled for
the fixed 2x2 Command Post).

Fix: moving an emplacement after rotating it kept the default orientation
instead of the rotated one, so the rotation was lost on the next click.
placeAt now preserves the emplacement's stored orientation when moving it.
2026-10-11 22:18:20 -04:00
d4bf0e9742 fix(minigames): pick up placed emplacements on click instead of overwriting
Clicking a grid cell always placed the currently selected emplacement
there and silently deleted whatever it overlapped, so clicking an
earlier emplacement (after selection auto-advanced) clobbered it. Now
clicking a placed emplacement selects it so it can be moved, and placing
onto an occupied cell is refused with a message instead of deleting the
other emplacement. Adds the pick-up hint to the editor copy.
2026-10-11 22:12:04 -04:00
3ce9677fd0 fix(minigames): square versus grid cells and make the Command Post a 2x2 block
The placement and battle grids inherited a 32px line-height, so any cell
holding the emplacement glyph grew taller than its square width (29x34),
making the row gaps look inconsistent once emplacements were placed. Set
leading-none on the grids so cells stay square.

Add a shape to emplacements ("line" | "square") and lay out the Command
Post as a 2x2 block (size 4) instead of a 3-cell line. cellsForFob resolves
cells per definition; the placement editor, preview, and tests use it.
2026-10-11 22:09:09 -04:00
065018cf3c feat(minigames): color-code versus emplacements and shrink the duel board
Give each emplacement type its own color (Command Post amber, Ammo Depot
rose, Radar Site sky, FOB violet) so it is obvious what is placed where:
the picker chips carry a matching swatch, placement cells and the
in-battle "your fire bases" board use the type color, and struck enemy
cells use the struck type's color. The shot view now carries the struck
assetId so the enemy sector can be colored too.

Cap the board at a compact width (max-w-sm) instead of stretching to fill
the panel, so the 10x10 grid no longer dominates the screen.
2026-10-11 22:01:15 -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
6d6a5fb0ce feat(minigames): add Call for Fire artillery observer game
Bracket hidden artillery targets across patrol/checkpoint/compound
difficulties. Pure rules in src/lib/minigames/call-for-fire.ts (compass
bearing observer reports, ADD/DROP + RIGHT/LEFT corrections, scoring,
distance-to-target accuracy, injected rng) with a 23-case spec.

Wires the game into the minigame ecosystem: submit action validates the
run, updates the profile callForFire group, pays out XP and chips, emits
minigame:call-for-fire, and records the period ledger entry (accuracy is
distance-to-target on a win, null on a loss). Adds the game page with
period standings and an all-time board, a command palette entry, the
Target icon, and the profiles XP aggregation.

The registry row and regenerated payload types land with the minigame
registry changes in a separate commit.
2026-10-11 18:18:02 -04:00