1
0
Fork 0
Commit graph

144 commits

Author SHA1 Message Date
6df285e2e8 feat(changelog): render section headers as Discord markdown headings 2026-10-11 17:27:51 -04:00
e59e16344e test(minigames): e2e smoke for the leaderboards page and document periods
Phase 8 of the minigame periods feature:

- e2e smoke: the unified leaderboards page shows the period boards, the Core
  game tabs and the achievements section; switching to All-Time reveals the
  cardtable games; a game page shows its anchored period standings card.
  (Passes with the bundled Chromium via E2E_BROWSER_PATH; Vivaldi crashes under
  automation, as the root guide warns.)
- Integration coverage already added alongside each phase: entry recording,
  the close pipeline and awards, month/year windows, the registry, the read
  model and the in-app notifications, plus a pure bot renderer test.
- Document the periods, achievements and registry invariants in the minigames
  AGENTS guide.
2026-10-11 17:06:52 -04:00
a1ab247b7b feat(minigames): notify winners and announce achievements on Discord
Phase 6 of the minigame periods feature:

- Muteable `minigame:achievement` notification type; the close pipeline now
  notifies each winner in-app, but only when the achievement row is newly
  written, so a re-run or a concurrent closer never double-sends.
- New bot service `achievementAnnouncements` polls achievements with no
  announcedAt, groups them by window, posts ONE embed per window to
  DISCORD_ANNOUNCE_CHANNEL_ID, then stamps announcedAt + discordMessageId.
  A failed post leaves the rows unannounced so the next tick retries them.
- Pure, testable renderer (bot/lib/achievementRender.ts) for grouping and the
  embed shape; window labels reuse the period/calendar helpers.
- Register the service in the bot registry and add
  DISCORD_ACHIEVEMENT_POLL_MS (default 60s).
- Tests: renderer grouping/ordering/fallbacks and the in-app notification
  path (including idempotency).
2026-10-11 17:06:52 -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
5cf245b855 feat(minigames): crown player of the month and year
Phase 3 of the minigame periods feature:

- Record each ledger row's own instant (`occurredAt`, server clock at
  submit) so calendar windows score runs that actually happened in them.
  Backfilled from createdAt for existing rows.
- Pure UTC calendar windows (lib/minigames/periods/calendar.ts): completed
  month and year windows, with the first window of each kind partial because
  it begins at the anchor, and nothing crowned until the window has ended.
- Close pipeline extended: after the period sweep it crowns Player of the
  Month and Player of the Year for every completed window, scored with the
  same placement ladder as the period champion. Idempotent like the period
  close (achievement unique key plus an existence check).
- period-tick logs the crowned windows; integration tests cover window
  enumeration, both crowns and idempotency.
2026-10-11 17:06:52 -04:00
ccdeebbd35 feat(minigames): close anchored periods and grant period awards
Phase 2 of the minigame periods feature:

- Pure board + award math (lib/minigames/periods/boards.ts): best-performer
  boards from the ledger, a fixed top-N placement ladder summed across the
  five Core boards, and the five period awards (Period Champion, Diligence,
  Dedication, Precision, Most Improved) with the locked tie-break (raw
  period score, then earliest submission).
- Close pipeline (lib/minigames/periods/lifecycle.ts): computes boards for a
  period, writes its achievement rows, and marks it closed. Idempotent: the
  status is re-checked before committing and the achievements unique key
  makes a duplicate close insert nothing, so the tick and the admin override
  cannot double-grant.
- Shared rules resolver (lib/minigames/periods/rules.ts), now used by both
  the entry recorder and the close pipeline.
- New period-tick bin (registered in payload.config.ts) closes every due
  period and materializes the current one, mirroring the mission tick.
- Admin close/reopen route (POST /api/minigame-periods/close), gated on the
  minigame-periods:close permission. Reopen removes the period's awards so a
  future close can re-grant them.
- Integration tests for the pure math and the full close/reopen cycle, plus a
  clean-slate guard so the two minigame specs stay order-independent.
2026-10-11 17:06:52 -04:00
997ae39a59 feat(minigames): record completed runs in the period ledger
Phase 1 of the minigame periods feature:

- Shared server-side recorder (lib/minigames/periods/record.ts) writes one
  minigame-entries row per completed scored run, lazily creating the
  anchored period it belongs to (unique startDate makes it race-safe).
  Failures are swallowed so a ledger hiccup can never break a submission.
- Pure anchored-period math (lib/minigames/periods/derive.ts).
- Wire the recorder into all five Core submit actions after their profile
  update: flappy (passes > 0), EOD (win), radio (>= 1 correct message),
  aim trainer and OPORD (any completed round).
- Server-validated durations for every game: flappy and radio watch now
  report durationMs (with bounds), aim trainer reports its run duration
  (clamped to the 30s course), EOD derives it from seconds, OPORD from
  timeMs.
- Integration test covering derivation, lazy period creation, pre-anchor
  null period and the never-throw guarantee.
2026-10-11 17:06:52 -04:00
88d1d1f6f1 feat(changelog): fall back to a generic line for empty entries and sections 2026-10-11 16:41:04 -04:00
32b63d9061 fix(bot): shorten /changelog option description to unblock bot startup, register /rollcall 2026-10-11 16:12:05 -04:00
dda9f08f33 feat(bot): add /rollcall to force-send or refresh a mission roll-call 2026-10-11 15:26:17 -04:00
6bc7413cd7 fix(bot): acknowledge /changelog immediately and surface post-defer errors
Defer the reply before the permission check (uncached member fetch + DB
lookups) so a slow preamble no longer trips Discord's 3-second window and
shows "The application did not respond". Wrap all post-defer work in one
try/catch that editReplies an error, and make channel resolution catch fetch
errors so an unreachable DISCORD_CHANGELOG_CHANNEL_ID replies clearly instead
of hanging the interaction.

Also export compareVersions and make the shipped-file test assert
newest-first rather than a hardcoded version.
2026-10-10 15:57:51 -04:00
eed33de2e9 fix(missions): default new main ops to the upcoming Saturday
The startDateTime default in the Missions collection and the weekly
generate-mission bin both forced the date at least a week out by adding 7
days to the offset to the next Saturday. Generated midweek that landed on
the Saturday AFTER the coming one (a Tuesday generation went 11 days out
instead of 4), which also pushed the bot's roll-call (posted within 3 days
of start) days into the future and read as a missing roll-call.

Add nextSaturdayStart() to the unit-timezone date helpers: the nearest
upcoming Saturday at 20:00 America/New_York, rolling a week only once
today's 20:00 has passed. Use it for the collection default and the
generator, derive the generator codeName datestamp in unit time, and cover
the boundary cases in tests/int/next-saturday-start.int.spec.ts.
2026-10-10 14:54:06 -04:00
9a0b78fcf0 feat(bot): support version ranges in /changelog
/changelog now accepts an inclusive range via from..to notation: v0.3.0..v0.5.0
(an inclusive slice, output oldest-to-newest), either end open (v0.3.0.. to the
latest, ..v0.5.0 from the oldest), and reversed ranges are normalized. Each
version posts as its own amber embed. Ranges over 10 versions warn but proceed.
2026-10-10 13:13:55 -04:00
2e23d074a4 feat(bot): add /changelog command to post release notes to Discord
Posts a CHANGELOG.md release entry to #releases (new DISCORD_CHANGELOG_CHANNEL_ID,
falls back to the announce channel). /changelog targets the latest entry;
/changelog <version> targets a specific version for catch-up.

Rendering is a pure, tested module (bot/lib/changelogRender.ts): entries are
split on "# vX.Y.Z" headers, ### sections become bold, bullets become the
bullet glyph, and entries over Discord's 4096-char limit are split across
messages at section/bullet boundaries with the header re-attached to each
chunk. Guild-scoped, staff-only command.
2026-10-09 19:01:21 -04:00
eff7aea914 test(wiki): cover index view helpers and curation mapping
Add tests for buildExcerpt (markdown stripping, truncation), filterWikiPages (category/tag/excerpt), sortWikiPages (recent/oldest/title), groupWikiPagesByCategory, collectTagCounts (dedupe/count/sort), selectFeatured (ordering, FEATURED_CAP), CATEGORY_META coverage, and mapWikiPageToEntry (System fallback, curation passthrough).
2026-10-09 17:56:17 -04:00
3a2ae34b83 feat(contributions): add crowdsourced XP reward system
Reward users for helping build the app: wiki pages, mission planning
markers (queued until the mission completes), surveys, and manual awards.
Contribution XP folds into the existing virtual profile total, so it
flows into the level ladder, sidebar XP display, dashboard, and profile.

- contribution-entries ledger collection + profile progression.contributions.xpEarned bucket
- src/lib/contributions service (record/grant/expire/revoke, caps, idempotency, leaderboard) with a pure rules module
- per-mission planning-map delegation (missions:update grants) and a completed/cancelled map lock
- wiki, survey, and marker action/hook integration
- contribution:* event types, muteable notifications, permissions group, event targets
- profile Contributions section and /contributions leaderboard
- migration, reconcile tool, and integration tests
2026-10-09 16:30:05 -04:00
37d7297b1a feat(notifications): add staff toggle to show only your own notifications
Staff with read-all oversight (superuser / system:admin-access) see everyone's
notifications in the bell. Add a "Show all users" switch inside the dropdown,
rendered only when the caller can view others, that narrows the feed to the
caller's own notifications. The choice is remembered per browser (localStorage)
and the unread badge follows the selected scope.

The inbox route now reports canViewOthers and honors scope=all|mine; non-staff
callers are always forced to their own regardless of the param.
2026-10-09 14:43:12 -04:00
b0ce171c2e test(voiceover): add per-script submission count test 2026-10-09 13:14:35 -04:00
9f9257cadf test(notifications): add per-recipient read-scope test 2026-10-09 13:14:35 -04:00
8469502e9f fix(bot): compute Friday ops slot window in Eastern time, not server clock
The open-slot notice fired for a claimed slot because upcomingFridayRange
built its query window from the server-local calendar. On the UTC deploy
container, Wednesday 8 PM ET is already Thursday, so the window became
Fri 00:00Z-23:59Z (Thu 8 PM ET - Fri 8 PM ET) and any op starting Friday
evening Eastern fell outside it: hasMissionOnFriday said open,
getFridayClaimant found no claimant, and the dedup token rendered the
wrong date (October 8 instead of October 9).

The window is now Friday 00:00-23:59:59.999 America/New_York computed
from the Eastern calendar date, identical on any server timezone. When it
is already Friday Eastern, that day itself is the slot, keeping the dedup
token stable from Wednesday through the op day so late claims still
credit. Tests use explicit UTC instants plus a regression case for the
prod scenario, verified under TZ=UTC and America/New_York.
2026-10-08 14:01:07 -04:00
cc9d3b8073 fix(missions): only accept Arma 3 Launcher preset exports as mod lists
Root cause of the upload failures: the launcher writes an
<?xml version="1.0"?> prologue, Payload sniffs uploads with
fileTypeFromBuffer, and the collection mimeTypes allowlist lacked
application/xml, so every genuine launcher export was rejected with
'Invalid MIME type: application/xml'.

- Add application/xml to the mod-lists upload mimeTypes (the document is
  still stored as text/html; verified end to end).
- New pure parser src/lib/modlistPreset.ts validates the launcher export
  structure (arma:Type=preset meta + data-type=ModContainer rows) and is
  shared by the server action (authoritative) and CreateSideOpDialog
  (instant client-side feedback).
- Plain-text lists are no longer accepted anywhere: dialog accept/hint,
  collection mimeTypes, and the action now agree on HTML presets only.
- Upload name defaults to the preset's own arma:PresetName.
- Tests: tests/int/modlist-preset.int.spec.ts (9 cases).
2026-10-08 13:25:08 -04:00
8e42077c1f fix(uploads): store upload collections under the persistent media volume
VoiceSubmissions, ModLists and MissionFiles relied on Payload's default
upload staticDir (the collection slug resolved from cwd), so prod wrote
their files to /app/<slug> instead of the mounted /app/media volume and
every redeploy wiped them (voice takes returned 500 on play/download).
Pin all three under media/ subdirs like story Voiceovers already does,
add regression guards, and fix the audio-preview fallbacks that pointed
at the media collection's file route instead of the owning collection.
2026-10-08 12:14:46 -04:00
0370df6c2d feat(game-structures): add Labor Crew admin panel for staffing writes
Wire the previously orphaned LaborCrewPanel into the game-structures
editor so staff can set actual headcount and per-worker wage for a
labor classification. Adds a laborCrewPanel ui field on the edit view,
a POST route under /api/game-structures that authenticates and gates on
game-structures:update, delegates to the canonical setLaborHeadcount
service (enforcing caps and wage logic), and an integration test
covering auth, validation, and cap enforcement.
2026-10-07 23:28:35 -04:00
02307aa2ee fix(npc-dialogue): split countdown units into controlled-gap cells
The countdown rendered each time unit with a raw monospace space,
which reads wide and odd when inline with proportional text. Split the
value into per-unit inline-flex cells separated by a CSS gap so spacing
stays consistent, and cover the new markup in the interpolate
integration test.
2026-10-07 23:28:31 -04:00
f97912f1c1 fix(mcp): gate API-key collection with system:admin-access so superusers can issue keys
The MCP plugin's key collection was gated by hasRoles(), which reads only
the legacy roles enum column. All current admins authenticate through
dynamic roleDocs superuser roles, so nobody could create an MCP API key
and every client of /api/mcp got 401. Both override blocks (MCP keys and
the AI plugin instructions) now use requirePermission('system:admin-access'),
and the sync-only admin.hidden checks were dropped in favor of the read
gate, matching the repo's requireAdminPageAccess pattern.

Adds tests/int/mcp-api-keys.int.spec.ts covering the plain-user rejection,
dynamic-superuser key creation with HMAC index resolution (mirroring the
plugin's resolveAccessSettings), explicit system:admin-access grants, and
read visibility.
2026-10-07 18:21:06 -04:00
a96eddf32c feat(npc-dialogue): bigger flow handles + delete edges via Delete
- Enlarge flow-editor wire handles from size-2 (8px) to size-3 (12px) so
  they are easier to click and grab.
- Select an edge by clicking it, then remove it with the Delete key.
  Selection is tracked in state and the highlight renders through BaseEdge
  stroke props so the chosen line stands out.
- Edges are a derived projection, so deletion scrubs the hop from the
  source node data via a new pure removeHopFromNode() helper in dialogue.ts
  (choice row, condition branch, or single continuation).
- Add tests/int/npc-dialogue-remove-hop.int.spec.ts (4 tests).
2026-10-07 14:25:14 -04:00
538b7d4c4c feat(npc-dialogue): reorder choices in the dialogue editor
Choice rows in the dialogue node editor now have up/down buttons so a
choice can be moved up or down into the desired order, which is the
order shown to the player. The swap lives in a pure reorderChoice
helper (no-op at the edges, input not mutated) with a focused test.
2026-10-07 14:01:00 -04:00
f643028638 feat(npc-dialogue): let event flag effects target self, global, or a specific user
Event node flag effects previously always wrote the active participant's
flag. A flag's identity is (owner, key), so the same key can hold
independent values for different owners, but there was no way to target
them from the editor.

- Add flagTarget ("self" | "global" | "user") + flagTargetUserId to
  NpcDialogueEffect. "self" (default) keeps current behavior.
- Add resolveFlagOwner (flags.ts) to map a scope onto the player-flags
  user column; "user" with no id falls back to the participant so a
  misconfigured effect never nudges the global flag.
- Move applyFlagEffect into flags.ts, parameterized by resolved owner;
  the runtime action resolves the owner and delegates.
- Add a Target control (+ user picker) to the event node editor and
  validateGraph enforcement for the "user" scope.
- Integration tests cover owner resolution and self/global/user writes.
2026-10-07 13:33:52 -04:00
e0f305b026 feat(tickets): allow staff to archive tickets, hiding them from the front-end
Archived tickets disappear from every front-end surface for all users
(staff included): helpdesk list, detail page 404s, dashboard widget, and
project board/sprints/releases/search views. They remain fully visible in
the Payload admin panel, where un-archiving restores them. The collection
hook stamps archivedAt and appends an activity entry on each toggle; the
archiveTicket server action is tickets:staff gated and emits a
ticket:archive event. Edits and votes on archived tickets are rejected.
2026-10-07 01:22:51 -04:00
38e6b3d89f feat(reinforcement-pools): store per-pool balances and sync to the game bridge
New Game collection reinforcement-pools (name, faction, armaFactions,
available, enabled) with manual-edit audit via reinforcement:adjust. The
events hook applies reinforcement.spawn/.refund deltas (soft limits, no
floor, idempotent by eventId) before the game's next pull, and a new GET
/api/arma/v1/reinforcements endpoint serves enabled pools to the server.
2026-10-07 00:28:42 -04:00
565e190c7e test(arma-locker-sync): scope locker.apply assertions to this run
The helper counted arma-commands DB-wide, so any spec file that leaves a
game-server online (operation-*, supply-*, respawn-tickets) made later
web-originated locker edits leak into the count once vitest's timing-based
file order put those files first. Filter commands by this run's instance
refs, and mark the grid-metadata fixture write with the lockerSyncOrigin
context flag so it stops enqueuing an echo command of its own.
2026-10-06 23:31:38 -04:00
8cda724e21 feat(event-log): configurable per-event visibility with permission gates
- game-event-logs gains visibility (public|restricted) + requiredPermissions
  (any-of gate from the permission registry); read access becomes a Where
  clause: public OR actor-is-me OR held permission; superusers and
  game-event-logs:update staff see all; admin panel gate unchanged
- src/utils/event-log/visibility.ts: per-type policy map consumed by
  emitGameEvent, with per-emit overrides; npc:dialogue and flag:set start
  restricted, everything else stays public
- PlayerFlags hooks emit restricted flag:set audit events on every flag
  write (admin edits and dialogue effects alike)
- fix dashboard RecentEvents leaking events: local API find now runs as
  the viewer with overrideAccess false
- SSE broadcast sends an opaque nudge for restricted events instead of
  type/actor metadata
- /events table marks restricted rows with a lock badge
- migration 20261007_025942_add_event_log_visibility + regenerated types
- tests/int/event-log-visibility.int.spec.ts (8 cases)
2026-10-06 23:31:30 -04:00
6d2cde88db fix(npc-dialogue): content-only flow hashing for NEW badges
Rearranging nodes on the canvas (positions, edge ids, styling) no longer
changes the flow hash, so tidying a conversation in the editor does not
re-badge it as NEW for every player. The hash now covers node identity,
type, data, and edge source/target with order-independent serialization;
real text or branching edits still re-flag.
2026-10-06 17:15:34 -04:00
f595828c99 feat(npc-dialogue): stacked markup, link popups, new badges, locked choices, timed flags
- DialogueText rewritten as a recursive parser so markup accumulates
  ({green}**bold green**{/} and friends nest freely, colors close inner-first)
- [label](url) dialogue links open in an iframe popup dialog so
  conversation progress survives; only http(s)/relative urls render
- NEW badges: Converse button + choice buttons badge unread paths via a
  per-browser seen map (ptf:npc-dialogue-seen) keyed by flow hash, so GM
  edits re-flag the conversation
- choices gain lockedHint: failing conditions can show the choice disabled
  with a rich tooltip instead of hiding it (evaluateNpcDialogueChoices now
  returns ChoiceGate pass/showLocked pairs)
- player flags gain activatesAt/expiresAt time windows honored by readFlag,
  flag effects gain flagDelayMinutes for slow-burn writes, and
  {{countdown:key}} tokens tick live toward activation (done/missing states)
- migration 20261006_add_flag_time_windows; spec extended to 33 tests
2026-10-06 17:06:27 -04:00
c1e13e5dc9 feat(npc-dialogue): entry gates and priority for multi-conversation selection
- npc-dialogues gains priority + entryGate (flag key/op/amount) fields
- contact page offers the highest-priority conversation whose gate
  passes (ungated = fallback, ties by oldest); only the winner's flow
  leaves the server so locked story content never reaches clients
- extract shared flag reads (readFlag/evaluateCondition) to
  lib/npc-dialogue/flags and pure selection to lib/npc-dialogue/selection
- migration 20261006_203217_add_dialogue_entry_gate; spec covers
  ordering, gating, fallback, and storage round-trip
2026-10-06 16:42:56 -04:00
43cf29c6f4 test(npc-dialogue): cover inline images and choice tooltips 2026-10-06 16:21:53 -04:00
c7be90f689 test(npc-dialogue): cover flag interpolation and text flags 2026-10-06 16:09:10 -04:00
efab41ba29 refactor(flow): share the edge shape builder between both flow canvases
Extract the dialogue canvas's routing upgrades into routeEdge() in the
shared lib: perpendicular handle stubs, candidate scoring (Z-step vs
straight for forward edges, top/bottom bus corridors for back edges),
per-edge detour lane spreading, and multi-pass obstacle clearing. The
NPC dialogue RoutedFlowEdge becomes a thin renderer over it, and the
tech tree RoutedEdge now inherits the same logic while keeping its own
features intact: manual waypoints route verbatim (and define the
add-a-bend base), per-source stepPosition lanes feed the Z-step, and
its fixed right/left handles map to the new direction params.

New pure spec covers the Z-step shape, blocked-forward detouring,
back-edge bus routing, per-id lane spread, and waypoint pass-through.
2026-10-06 14:47:14 -04:00
665992a7ea feat(evaluations): mark mission evaluable after scheduled window
isMissionEvaluable now considers the full scheduled window (start +
estimated duration) rather than the start alone, so evaluation reminders
fire once a mission's window has genuinely closed. Extends the profile page,
the remindEvaluations command and the evaluationReminders service to match,
and adds integration tests. Updates the bot evaluation-reminders docs.
2026-10-05 03:36:12 -04:00
5963082f9d feat(arma-bridge): sync limited-arsenal locker stock with the game
New locker-sync bridge: web-originated storedAssets edits enqueue a
locker.apply command sent to the game, and game-side locker.sync merges
feed back into the member UI. Position/equipment layout is preserved across
merges. Adds the lockers service, LockerStorages + ArmaSyncEvents wiring and
integration tests. Docs in docs/arma-bridge/locker-sync.md.
2026-10-05 03:17:59 -04:00
12cb62b487 feat(map): add Arma-style coordinate grid config, overlay and mission-map wiring
Per-map grid config (gridEnabled, easting/northing origin, spacing, label
digits, over-lines) rides on the Maps collection and surfaces via
/api/map-features. Pure math in src/lib/map/grid.ts mirrors CfgWorlds Grid
(floor truncation, mod-10^digits wrapping, nested levels). GridLayer renders
hairlines + edge labels on the world map and mission planning maps, and
armaGridRef now delegates to gridRef. Migration 20261005_001212_add_map_grid_config.
2026-10-05 03:17:52 -04:00
ef7295c0d4 fix(intel): show the intelligence section to anyone with read access
v0.2.33 tightened hasIntelligenceQualification to write permissions for wiki
moderation, but the same check also gated navigation: regular members lost the
Intelligence sidebar section, command palette entries, keyboard shortcuts,
dashboard widgets, and tour steps. Add canViewIntelligence (intel read
permissions, with the strict qualification as a fallback) and use it for those
visibility surfaces. Wiki moderation, the tech tree, and division admin pages
keep the strict qualification.
2026-10-04 02:53:24 -04:00
1f230c0868 feat(missions): add a per-mission planning map with Arma markers
- New mission-map-markers collection (permission-gated, removed with its
  mission via a Missions beforeDelete hook) plus an opt-in
  classification.planningMapEnabled flag on missions.
- The mission page gains a planning section: place and edit Arma markers
  (icons, ellipses, rectangles, polylines) with debounced saves, an SQF copy
  export, and an Arma grid readout. Everyone who can read the mission sees the
  plan once enabled; editing requires missions:update or mission ownership.
- Base layers come from GET /api/map-features?layers=base, which skips the
  structure, node and shipment queries; marker icons render tinted by color
  exactly like in-game.
- Includes the hand-written migration, the missionMap service lib, server
  actions emitting mission:map-marker-* events, and integration plus e2e
  coverage.
2026-10-04 02:53:21 -04:00
80ad24580a fix(tech-tree): save canvas positions in one request so auto-arrange cannot overload the server
Every canvas position write (Auto-arrange, Save positions, drags, freeze pins)
used to send one PATCH per technology, all at once. On a large tree that was
dozens of concurrent full document updates, which exhausted the database pool
and could crash the server.

- Add POST /api/tech-tree/positions: validates `{ positions: [{ id, x, y }] }`
  (null x/y clears a pin, capped at 2000) and applies every position in a
  single UPDATE on the tree position columns. Access mirrors the technologies
  update rule (technologies:update or Intelligence membership).
- Route all canvas position writes through it; failures now surface in the
  toolbar instead of being swallowed.
- Auto-arrange is optimistic: the canvas re-lays out on click and the pins
  are restored if the save fails. A spinner status chip shows while a layout
  save runs, and layout controls and dragging are locked until it finishes.
- Integration tests for validation and the bulk write; the e2e checks the busy
  indicator and that no per-node PATCHes are sent.
2026-10-03 04:08:29 -04:00
d4f9051b17 feat(arma): extract catalog icons and extend the import library
- Add an `icons:arma` tool (extractArmaIcons.ts) that pulls inventory icons
  out of the game's PBOs and materializes the .paa files the catalog needs.
- Extend the catalog import library with the matching planning and upsert
  support, and cover it with integration tests.
2026-10-03 03:29:58 -04:00
74564afb2b feat(missions): auto-start and auto-complete ops, plus side-op scheduling
- The mission tick now runs two idempotent sweeps: auto-start flips Scheduled
  missions whose start time has arrived to Active, and auto-complete sets
  missions whose scheduled window (start plus duration) has fully passed to
  Completed with a stamped completedAt.
- Side ops are created as quiet Ready drafts and committed with a "Mark as
  Scheduled" control, which is what posts the Discord roll-call and hands the
  op to the lifecycle above.
- Daily schedule reminders nudge the creator to set a draft live (web
  notification plus Discord DM).
- Adds the mission lifecycle/commit event types and the matching notification
  labels, and updates the bot docs.
2026-10-03 03:29:35 -04:00
62573f74e6 feat(promotions): add promotion nominations and leadership transfers
- Promotion nominations: members can nominate a peer for promotion from their
  profile, and a new /personnel/promotions page lets staff review and action
  the nominations (with an optional note on each).
- Leadership transfers: a member's leadership can be handed over to another
  member, surfaced on the transfers page and in the roster (which also gains a
  staff remove-member dialog).
- Adds the PromotionNominations and LeadershipTransfers collections (registered
  in the Payload config), their service libs, the migration, and integration
  coverage.
2026-10-03 03:29:24 -04:00
d43b2ef658 feat(tech-tree): drag groups, snap to grid, and route edges around nodes
Round out the canvas editing experience.

- Dragging one card of a multi-selection now moves and persists the whole
  selection (React Flow hands the full dragged set to onNodeDragStop).
- A category band is draggable by its header, which moves every technology in
  that band; the band body stays click-through.
- A "Snap: On/Off" toolbar toggle (default on, remembered per browser) snaps
  dragged cards to a 46px grid that divides the column and row steps, so
  snapped cards line up with the automatic layout.
- Connection lines are adjustable: select an edge to reveal "+" handles at each
  segment's midpoint (click to add a bend), drag bends to reroute, and
  double-click a bend to remove it. Routes persist per browser.
- Edges route around technologies they are not connected to, and corners are
  rounded, so lines no longer cut through unrelated cards.
- Ctrl/Cmd-clicking to multi-select no longer pops the side panel over the
  canvas.
2026-10-03 03:28:27 -04:00
64d92bf848 refactor(arma): extract catalog import logic into lib/arma-import
Move the record contract, planning, and upsert logic out of the CLI script
and into src/lib/arma-import/catalog.ts so it can be unit-tested and reused.
The CLI (importArmaLibrary.ts) becomes a thin wrapper. Records are upserted
into assets (keyed by className) and vehicles (by classname); thumbnails are
materialized from .paa inventory icons, and fuel config is resolved per
record type. Adds integration coverage for the catalog import path.
2026-10-01 10:04:38 -04:00