1
0
Fork 0
Commit graph

398 commits

Author SHA1 Message Date
ee622ff6dd feat(mission-ratings): UI, page wiring, discord embed + button handler
- MissionRating.tsx star form + overview renderer, wired into missions/[id]
- Discord rating embed + ptf-rate action row, posted on mission Completed
- interactionCreate ptf-rate handler replies ephemeral with mission URL
2026-10-31 10:25:28 -04:00
502eef5228 fix(profile): label downward leadership ratings as rate subordinate
Seniors viewing a junior's profile saw 'Rate leadership', but that rating is
stored as a subordinate review. The section now passes the rank direction to
the dialog, which labels the trigger, title, copy and toast accordingly.
2026-10-31 02:23:29 -04:00
3bef63af33 feat(map-objectives): superuser-authored strategic objectives on mission maps
Add a superuser-authored objective layer (defend, assault, secure, etc.)
shown as labelled map markers on both the world map and mission planning
map, with per-layer toggles on the planning map.

- collection: MapObjectives (map_objectives table, enums, FKs)
- lib: objectives service + objectiveTypes + permissions + event emit
- actions/api: create/update/delete objectives server actions
- UI: feature-layer toggles, objective picker dialog, world/plan markers,
  SQF export, dossier dialog integration
- generated: regenerate payload schema + types for map_objectives
- tests: 10 integration specs + e2e spec
- docs: CHANGELOG, map-system, AGENTS guides
2026-10-27 02:12:31 -04:00
7430251adf feat(awards): render ribbon devices as vectors with tier-driven auto-layout
Introduce RibbonArt, a single shared SVG renderer used by both the production viewer and admin/studio preview so they can no longer diverge. Devices are now vector glyphs (star/oak leaf/campaign clasp/arrow up) instead of Unicode text, laid out as one centered cluster that shrinks to fit. Device count derives from advancement tier using the service-star convention (tier N shows N-1, cap 6; bare ribbon at tier 1 or for non-tiered awards). Legacy per-device x/y positions are stored but ignored, so no schema change. Designers add/remove/reorder device types and preview tiers.
2026-10-26 22:21:10 -04:00
f32afc6421 feat(logistics): restyle vehicle catalog cards in tactical dossier style
VehicleCard gains classification strip, corner brackets, squared corners, darkened cover imagery, faint grid texture and a permanent readout footer (matching CampaignCard). Fixes pre-existing defects: description rendered twice, category colors disagreed with the detail page, and stat accessors read nonexistent nested fields hidden by an 'as any' cast (now typed against Vehicle). Category color/label maps unified into src/lib/vehicles/categories.ts shared by card and detail pages.
2026-10-26 22:20:54 -04:00
acf47a75ea feat(operations): gate logistics extractions behind an officer review screen
Logistics operation-extraction effects now park as pending_action instead of auto-settling. Officers visit Operations > Extractions to keep, scrap, or expel each line; only kept lines deposit into HQ. A capacity failure leaves the effect retryable (pending_action) so a full HQ can free space and re-resolve. Adds resolveLogisticsExtraction/listPendingExtractions actions + ExtractionReview UI + tests.
2026-10-26 22:20:14 -04:00
282b313cd5 fix(modlists): send modlist files as downloads instead of inline views 2026-10-26 18:07:05 -04:00
1fdb6bf872 feat(vehicles): add 'static' and 'drone' vehicle categories 2026-10-26 03:39:38 -04:00
c5bd74f297 chore(locker): commit pending stock handling refinements 2026-10-25 21:23:40 -04:00
977f841056 feat(evaluations): gate leadership ratings by rank instead of squad assignments
Eligibility now requires a strict rank gap plus a yes-RSVP from at least
one side of the pair on an evaluable mission. Junior rates senior writes
leader-direct (feeds the anonymous aggregate); senior rates junior writes
subordinate; leader-indirect stays readable for legacy rows only.

- New src/lib/evaluations/ranks.ts ladder helpers shared by all call sites
- Profile page: eligible missions union viewer+subject attendance, dialog
  hidden without a rank gap, subordinate line visible to higher ranks
- Bot and in-app reminder planners pair co-attendees by rank, not squads
- isDirectLeaderOf/isAnyLeader removed; no schema change or migration
2026-10-25 02:53:49 -04:00
59460111fd chore(minigames): log Bomperator transport kind and raw ping samples in debug stats
The rtt fields in __bompDbg.stats() are the smoothed EMA (seeded at 100ms,
one WS sample per 2s), so short playtests read as 35ms+ even on a 5ms path.
Record every raw RTT sample and the active transport (logged on mount, not
only on fallback) so the next playtest shows the real numbers.
2026-10-21 20:50:40 -04:00
54efc9453f Revert "feat(minigames): make Bomperator own-seat movement server-authoritative"
This reverts commit 98d5ec63f8.
2026-10-21 20:25:38 -04:00
88f060cead feat(sidebar): move Contribute (Voiceover) out of account popover into sidebar above Minigames 2026-10-21 19:56:40 -04:00
98d5ec63f8 feat(minigames): make Bomperator own-seat movement server-authoritative
Four prediction generations shipped and production still disagreed with the
server: v0.12.16's ack-sized envelope, wall-clock catch-up with a 1s cap,
ghost parity in both sims, and a forward-only replay clock. The last playtest
(n=645, rtt 41-69ms) still read gapP50 1.26, gapP95 7.05, 30% of snapshots
easing, with frameMax 17ms and zero server-side jumps. A second simulation
cannot be kept in agreement with the server by tuning.

Remove the second simulation instead:

- own seat renders the server's snapshot position through the same one-pole
  ease as remote players (shorter constant, 0.6 vs 0.4 per frame, because
  easing reads as input lag), snapping only past 1.5 cells (respawn/reset)
- drop the pending ledger, ack drain, input-to-ack EMA, envelope, trim and
  ease correction, optimistic kick overlay, and the local movement copy
- drop ghosts stay as visual feedback, placed at the server's own copy of our
  cell so they align with where the charge will appear
- telemetry now reports the ease's own-seat trail, own/remote snaps, snapshot
  cadence, frame max, ghost rows and RTT
- delete bomperator/prediction.ts, its offline harness and the prod-RTT
  fixture: they covered a mechanism that no longer exists

Input stays level-triggered on the monotonic seq + 400ms keepalive path. Cost
is one tick of queue (~25ms) plus one-way latency, the explicit trade for a
render that cannot diverge from the server.

tsc clean; bomperator-registry 19/19.
2026-10-21 11:42:32 -04:00
a01ccaa7f1 fix(minigames): keep the Bomperator estimate replay clock moving forward
Root cause of the remaining jitter, and why stride tuning never touched it.
projectServerPosition replayed every unacknowledged input, then moved its
replay clock back to that input's receive time even when it predated the
snapshot. The trailing segment (targetMs - t) then included the input's
whole age, so a keepalive still in flight inflated the estimate by up to
the 400ms re-assert cadence: a phantom lead of 1-4 cells that the reconcile
then chased toward a position the server never occupied.

Prod telemetry fits exactly: gap p50 1.0, p95 4.12, max 4.5, 22% of
snapshots easing, frameMax 38ms, remoteSnaps 0, 13 ghost rows. No hitches,
no server-side jumps, just an estimator biased by pending input age. The
bias scale with ack latency, which is why the first match looked clean
(p50 0.18) and a match with RTT spikes to 53ms did not.

- clamp the replay clock: an input whose receive time is at or before `t`
  contributes its direction only, never a rewind
- the component now calls the shared projectServerPosition instead of
  keeping an inline copy of the same replay (one implementation, one fix)
- unit tests pin both behaviors (stale input adds no travel, newer input
  still advances); harness 12 scenarios plus the two new tests green
2026-10-21 01:40:50 -04:00
b51d4bc0d0 fix(minigames): stop Bomperator prediction losing time and disagreeing on ghosts
Prod telemetry (3291 snapshots, one match): gap p50 0.18 but p95 1.22,
max 4.19 cells and 43 eases. A 4-cell gap is ~0.6s of running, so these
are events, not latency noise. Tuning the correction envelope could only
change how they were presented.

- advance prediction by real elapsed time (1s sanity cap) instead of a
  100ms slice: the engine runs on wall clock, so every main-thread hitch
  over 100ms left a permanent gap that had to be eased back. The ease
  branch keeps its own 100ms slice so a catch-up frame cannot discharge
  a whole gap at once
- release held keys when the tab hides: input is level-triggered, so a
  backgrounded tab kept the technician running server-side and then
  snapped back on return
- replay optimistic ghost charges in the server estimate too; pred saw a
  charge the estimate did not, so every unconfirmed placement read as
  divergence while it was in flight
- telemetry: per-row longest frame and ghost count, frameMax/ghostRows in
  stats, so the next playtest attributes any remaining gap directly
- harness mirror: same 1s catch-up and 100ms ease slice; 12 scenarios green
2026-10-21 01:20:13 -04:00
e52cc83198 feat(interior): interiors screens, sidebar entry, and launch content seed 2026-10-20 18:33:43 -04:00
f62f5265fa feat(intelligence): export mission briefings to SQF
Add a briefing export dialog with a diary script and a structured text array. Convert Lexical formatting, including bold, code, underline, colors, headings, lists, and quotes, into Arma Structured Text. Scope the shared color palette to the briefing editors and render colors on the mission page.
2026-10-20 14:22:17 -04:00
3c774279aa feat(minigames): superuser developer console dock across all ten games
Adds a shared fixed-position debugging dock (Controls/State/Log tabs) gated
to dynamic superusers, mounted per minigame. Multiplayer games gain synced
server-authoritative admin commands with [dev-admin] audit logging: poker
(force fold, force street, per-viewer reveal-all, clock control, stack
adjust, force expire), blackjack (bankroll adjust, next-card injection,
dealer override, force expire), bomperator (pure applyAdminCommand: crates,
pickups, eliminate, freeze, sudden death, timer, end round; mirrored over
the arena REST path), and CFF Versus (reveal fleets, force shot outcome,
skip turn). Solo games get client-side tuning via persisted dev settings:
flappy physics sliders plus pause and invincibility, EOD layout reveal and
seeded boards, radio transcript view and timer freeze, aim trainer seed and
difficulty overrides plus hitbox overlay, OPORD answer reveal and study
window, call-for-fire target reveal, seeded grids, and free corrections.

Includes 26 new integration specs (command purity, gating, audit lines) and
a poker e2e smoke for the dock. Plan: Minigame Developer Console.
2026-10-20 12:48:27 -04:00
d15beb8e35 fix(minigames): end Bomperator WS jitter with ack-sized envelope and rate-limited trims
Prod telemetry (bompDebug, 783 snapshots): ping RTT of 3-24ms shrank the
correction envelope to ~0.75 cells while the real gap noise floor sat at
p95 1.0, so 13% of snapshots trimmed and each trim closed its whole
excess in one frame - constant micro-teleports.

- size the envelope from transport RTT plus the server-side component of
  measured input-to-ack latency (tick queue + snapshot turnaround),
  which ping/pong cannot see; HTTP behavior stays near the v0.12.6 tuning
- rate-limit trims to 0.35 cells per snapshot (a run-speed glide); the
  >2.5-cell ease branch remains the fallback for genuine divergence
- harness mirror updated: maxJump now capped at 0.35 across all 12
  scenarios, prod-trace pulls 162 -> 47, zero teleports throughout
2026-10-20 02:02:00 -04:00
1883a1aabe feat(minigames): powerup name tags, centered loadout pips, prediction telemetry probe
- drawDrop now renders the powerup name on a semi-opaque plate pinned to
  the cell bottom (no bob, stays readable while the drop animates)
- own loadout pip row centered above the play area
- opt-in client telemetry behind localStorage.bompDebug='1': one row per
  reconciled snapshot (gap, envelope, correction branch, rttAvg, snapshot
  delivery cadence, remote-player snaps) plus transport kind changes,
  exposed as window.__bompDbg.stats()/.table()/.dump() to diagnose the
  reported WS jitter with data instead of guesses
2026-10-20 01:16:31 -04:00
707c5f6c81 feat(event-log): hide routine tick events behind a toggle
Add a client-safe ROUTINE_EVENT_TYPES list (game:tick, economy:tick, market:auto-generate) and hide those types on /events behind an off-by-default Routine ticks switch. The dashboard always excludes them so real events fill the recent list.

Tick bins now skip no-op emissions: game tick requires shipment, construction, or production activity; market tick requires an expiry or generation; economy tick requires processed items or errors. Historical events stay in the database and remain visible via the toggle or the admin panel.
2026-10-19 20:03:51 -04:00
afa79b4be4 feat(tech): member-facing tech research system and tech tree
Add a research pipeline over the existing technology tree: Research
Facility blueprint fields copied to structure instances, tech-researches/
tech-ballots/tech-ballot-votes collections, Game Rules research config,
pure rules lib (capacity, duration math, eligibility, intel-weighted
tally with tie cascade), a timestamp-derived tech-tick bin that opens,
resolves, advances and completes research with notifications, vote
casting server actions, and a read-only member-facing tech tree page at
/intelligence/tech-tree with veil blackout and dossier-style panels.

Includes migration 20261019_184409_add_tech_research_system, permission
groups, event and notification types, sidebar entry, and integration
plus e2e coverage.
2026-10-19 17:28:26 -04:00
394db6dfa1 feat(arena): websocket match replication for Ordnance Disposal
Adds a dedicated Node 22 + ws arena server (src/arena) that owns live
Ordnance Disposal matches: drift-corrected 20Hz tick loop with capped
catch-up and tick-drift logging, per-socket snapshot fan-out, 30s jose
ticket auth, and awards via the idempotent results callback route.

Client gains a transport abstraction (transport.ts): WsTransport first
when NEXT_PUBLIC_ARENA_URL is baked into the bundle, HttpTransport
(today's actions + SSE + guarded poll, behavior unchanged) as automatic
fallback after two connection failures or a 5s setup timeout; absent
env var means pure HTTP (kill switch / rollback path). Next actions
proxy the match lifecycle to the arena when ARENA_SECRET +
ARENA_INTERNAL_URL are set; the in-process registry stays untouched as
the default backend.

Deploy wiring: runner-arena Dockerfile target, compose service, env
docs, DEPLOYMENT.md checklist. Tests: arena module suite (19), live
server WS suite (3), prediction harness ws-grade latency scenario.
2026-10-19 12:27:17 -04:00
923831ba82 feat(minigames): make period standings the primary board on game pages
The six period-scored game pages (flappy, eod, opord, radio,
qualification, call-for-fire) now render their current-period
PeriodStandingsCard directly under the game board, in the slot the
lifetime board used to occupy. Each game's all-time leaderboard moves
below it into a collapsed AllTimeLeaderboard disclosure (shadcn
Collapsible) that expands on click, so period standings are centered and
primary and the lifetime board is opt-in.

PeriodStandingsCard drops its period/all-time toggle and keeps the
current period only, now with the presence line the pages previously
omitted. The old "Anchored period standings" heading and card block are
removed from the six page.tsx files. The e2e spec covers the collapsed
all-time section on /minigames/flappy.
2026-10-19 12:14:57 -04:00
ce682becec feat(minigames): touch controls and responsive board for Bomperator
- Extract pressDir/releaseDir/stopAll edge callbacks; keyboard, D-pad and
  swipes all feed the same held-stack path (prediction, keepalives and the
  pending ledger stay input-source agnostic)
- BomperatorTouchControls: 4-way pad + stop center + plant button on coarse
  pointers, per-button pointer capture for hold-and-plant multi-touch
- Board gestures: dominant-axis swipe sets direction, quick tap stops
- Canvas scales via CSS (w-full h-auto, fixed internal buffer), so prediction
  is viewport-independent; touch-action/overscroll guards on the board
- Harness: backgrounded-tab scenario (4s rAF freeze under prod trace replay)
  proves resume never teleports (teleports=0, maxJump 0.43)
- E2E smoke at 390x844 hasTouch: page loads without horizontal overflow
2026-10-19 10:11:30 -04:00
a72f1bbe03 feat(call-for-fire-versus): resize fleet, add second FOB, charred destroyed cells with burn effect
Command Post becomes a 3x2 rect that flips wide/tall, the Ammo Depot L grows to four cells, the FOB becomes two cells, and a second FOB (Forward Operating Base II) joins the fleet for 16 cells across five structures. Fully destroyed structures now render charred black instead of red, and their cells burn with flame and ember particles for 45 seconds after destruction, driven by a new impact timestamp on each shot.
2026-10-19 09:34:40 -04:00
d3bb69ffbc fix(minigames): end Bomperator teleport-back with trace-proven envelope correction
Root cause: Node event-loop stalls drop the server's setInterval ticks with
no catch-up, so the sim permanently lags wall clock; the old all-inputs-acked
pull let that gap stack past the snap threshold and discharge as an instant
backward teleport (the reported complaint).

- Component: lead-aware correction envelope, trim on every snapshot,
  capped-rate ease (2.5x speed) past 2.5 cells; resets still snap via the
  ack-backwards branch. No latency-precision mechanisms (the v0.12.4 lesson).
- prediction.ts: drop the unused decision-nudge exports.
- Harness: replay recorded production HAR latency
  (tests/fixtures/bomperator-prod-rtt.json), model server tick stalls, add
  per-reconcile jump telemetry. A/B proof under trace+stalls: v0.12.3 policy
  teleports twice (max jump 2.59 cells); envelope policy zero (max 1.10).
2026-10-18 02:11:15 -04:00
a9f047f214 revert(minigames): roll back Bomperator prediction update after prod regression
Reverts 655407a (component + guide). Production HAR showed input POST
TTFB p50 87ms / p90 236ms / max 384ms (server pipeline variance, not
network). The nudges and ghost projection trusted rttAvg too tightly and
glitched under that variance; v0.12.3 behavior is restored.

Kept on purpose: bomperator/prediction.ts and the offline prediction
harness stay as test-only infrastructure for the re-fix, which will be
calibrated against the recorded production latency trace.
2026-10-18 01:40:44 -04:00
655407ab7d fix(minigames): stop Bomperator teleport-back with envelope correction and decision nudges
- Extract client prediction helpers to bomperator/prediction.ts (predStep/
  predAdvance port, alignDecisionToServer, projectServerPosition)
- Nudge prediction across cell boundaries at turn/stop edges so client and
  server commit to the same rounding decision; ghosts use the server's
  projected placement cell
- Stamp snapshot arrival time; event projections use measured age, reconcile
  estimate keeps the calibrated half-tick bias
- Replace pending-gated pull and instant 2.5-cell snap with a lead-aware
  correction envelope plus capped-rate ease (2.5x speed); resets still snap
  via the ack-backwards branch
- Add offline deterministic prediction harness (real engine + modeled network
  + frame-by-frame reconcile mirror), 9 scenarios incl. rAF stalls and a
  pre/post-fix ghost-mismatch comparison
2026-10-18 01:09:56 -04:00
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