1
0
Fork 0
Commit graph

620 commits

Author SHA1 Message Date
4845084c1c feat(analytics): add Microsoft Clarity analytics
Add usage analytics via @microsoft/clarity across the frontend app and the
login page. ClarityAnalytics loads the tracking script only in production
builds (never local dev), keyed by NEXT_PUBLIC_CLARITY_ID; unset disables it.
Mounts it in both the (frontend) root layout and the standalone login layout
so both surfaces are covered without touching the admin panel.
2026-10-01 10:04:45 -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
73cae3defd feat(arma): sync in-game shop money events to bank accounts
Route the game's `money.delta` events into the web banking system so a
player's personal bank account tracks their in-game wallet.

- New `processMoneyEvent` (src/lib/arma-bridge/money.ts) applies a parsed
  money delta to the player's personal account: debits go to the unit
  treasury (or leave if no treasury), refunds hit the treasury first and
  fall back to a plain deposit, and rewards/grants deposit directly.
- Wire the handler into ArmaSyncEvents and add a `POST /api/arma/v1/balances`
  route (get_balances) that returns personal balances for Steam IDs, omitting
  unlinked IDs so the game keeps its own stored value.
- Events dedupe by serverId+eventId so a retried delivery never
  double-charges, and the whole path never throws.
2026-10-01 10:04:32 -04:00
89482798f4 feat(tech-tree): add admin tech tree editor view
Add a custom admin view over the technologies collection so staff can model
prerequisites as a left-to-right tree instead of a flat list.

- React Flow v12 canvas with category bands, OR-prerequisite edges, a
  lite side-panel editor, and a quick-create dialog.
- Propagating layout: a technology with prerequisites lands one column right
  of its parents at their average row; uncategorized roots fill a catalog
  grid keyed by each tech's rank among all uncategorized technologies, so
  promoting one into the tree leaves an empty slot instead of re-shuffling
  the grid.
- Stability contract: connecting or removing edges never moves a card (the
  connected node is pinned to its current spot), and a "Save positions"
  control commits every on-screen node so the arrangement survives reload;
  "Auto-arrange" clears manual positions and restores the ordered layout.
- Progression-path edge colors and per-source lanes keep overlapping edges
  readable. Wire the view and its nav entry into payload.config.ts and add
  dark React Flow / scrollbar styling.
2026-10-01 10:03:58 -04:00
15f2d0c573 feat(tech-tree): add tech-categories collection, permissions, and treePosition
Add the tech-categories collection that gives technologies a home off the
flat uncategorized pool, plus the schema support the admin editor needs.

- New `tech-categories` collection (unique name, timeline `position`,
  optional hex `color`) with a `Technologies.category` FK (ON DELETE set
  null) so deleting a category just unfiles its technologies.
- Add `Technologies.treePosition {x,y}` so the canvas can pin a node's
  manual position; clearing it uses `{x:null,y:null}`.
- Register the two hand-written migrations (tech-categories + treePosition)
  and regenerate payload-types, the drizzle schema, and the admin importMap.
- Register the `tech-categories:*` permission group and grant Intelligence
  division members admin-panel access, mirroring technologies.
2026-10-01 10:03:49 -04:00
d16e721ccc test(e2e): seed e2e user, serialize workers, and deflake specs
The suite could not pass on the test database: global setup now seeds the shared dev/Test123 login with a superuser Roles doc and the dashboard rank, and points its own Payload connection at the test database. Playwright runs one worker with generous test and expect timeouts because first navigation to a route triggers a cold webpack compile, and gains E2E_BROWSER_PATH to swap the browser binary when the installed Vivaldi crashes under automation. The landing page gains the missing h1 the guest specs assert, login flows wait for the redirect to land, strict-mode locator collisions get exact or level-scoped matches, the session banner test re-signs the login claims with a short expiry using the runtime secret, and the reservation dialog click forces the dispatch and verifies the dialog opened (the trigger goes aria-hidden behind the modal mid-click, which stranded the retry loop).
2026-09-30 18:43:29 -04:00
8b79c1379d feat(tours): add permission-aware guided tours with replay and device opt-out
Pages declare brief tours in code, keyed to stable data-tour anchors. The layout resolves each visitor's access signals (intelligence and logistics qualifications, admin-panel access, feature flags) and step filtering hides what a user cannot reach, mirroring the sidebar. A tour auto-starts the first time a browser visits its page; dismissals are remembered per browser in localStorage. The header gains a replay control for on-demand runs on toured routes, the tour card gains Skip all tours on this device to opt a browser out of auto-starts, and the Account page holds the re-enable toggle. The card and spotlight get a distinct overlay treatment (glow, accent strip, outlined target).
2026-09-30 18:43:21 -04:00
fdb6ee120a fix(wiki): vertically center callout icons
The note and warning icons were pinned at a fixed top offset and drifted off the text line inside short callouts. They now center vertically in the callout box.
2026-09-30 18:42:48 -04:00
780d2bd8f0 feat(wiki): show System as author for seeded documentation pages
Seeded Documentation pages have no lastEditor; the index cards and the detail header now read 'System' instead of 'Unknown editor' for those. Other categories keep the old fallback.
2026-09-30 18:41:13 -04:00
c9a3d23f96 feat(wiki): add Documentation category restricted to admins and developers
New in-depth, non-developer guides for the core systems: logistics and storage rules, banking, market and negotiation, shipments, base management, and the map. Read stays open to any logged-in user; create and edit require admin or developer roles (enforced in the collection access functions and the wiki server actions, since the service layer runs with overrideAccess). Category escalation via update is blocked too. Ships the enum migration, regenerated schema/types, and the idempotent seed script with its markdown sources.
2026-09-30 18:41:07 -04:00
4224096b62 chore(db): register migrations and regenerate schema/types 2026-09-30 14:50:40 -04:00
f8f09057bc feat(ai): switch compose model to Gemma 4 26B and patch AI plugin field-path handling
Default compose model moves to unsloth/gemma-4-26B-A4B-it-qat-GGUF (migration rewrites plugin_ai_instructions columns + enum). Strip markdown code fences from plain-text fallbacks so Gemma's JSON-flavored answers still render as prose. Pin a bun patchedDependencies patch for @ai-stack/payloadcms (activeFieldPath context) which requires the patches/ directory alongside package.json and bun.lock. Note: the change_ai_model migration also carries the new map permission enum values from the map permission split.
2026-09-30 14:50:32 -04:00
190ddac41f feat(missions): role sign-ups with FCFS waitlist and rich-text role descriptions
Players meeting a role's minimum rank and MOS can queue for mission roles before op time. Slot holders are recomputed statelessly from signup order plus current RSVP (first N committed signups hold the role); attendance writes diff holders around the write so RSVP changes auto-promote, with notifications and events. Adds mission-role-signups collection, roleSignups/missionTime libs, sign-up panel, role slots + rich-text descriptions (with RoleDescription renderer), orphan-pruning hook, migrations, tests, and AGENTS.md docs.
2026-09-30 14:50:26 -04:00
56fb6ac26a feat(map): gate feature authoring and structure placement behind dedicated permissions
Replace the maps:create/update/delete catch-all for map features: roads, zones, and nodes each take a per-collection author permission, structure placement takes maps:place (still co-gated with the logistics qualification), and GeoJSON import requires all three author permissions. The map view page keys edit UI per feature type; admin role seed grants the new values. Tests updated for the permission split.
2026-09-30 14:50:14 -04:00
0b956a3beb chore(permissions): add map authoring, placement, and role sign-up permissions
Additive registry entries: maps:place, map-roads/zones/resource-nodes:author, and the mission-role-signups permission group.
2026-09-30 14:49:57 -04:00
9b90377f50 feat(story): swipe page turns in book view
Touch drags flip pages: the page follows the finger live, the axis locks
on first movement so vertical pans never flip, and edge drags get
rubber-band resistance. Swipes starting on interactive controls are
ignored. Swipe intent lives in bookSwipeDirection with unit tests.
2026-09-25 15:55:21 -04:00
f074149f6c feat(story): order chapters by creation date and show newest first
Chapter numbers now follow the order beats were written: sortBeats
defaults to creation date ascending, treats occurredAt as display-only,
and lets an explicit Order value curate the sequence. The /story page
shows the newest chapter on top with correct numbering, and switches to
exact hand-sequenced book mode when any beat is ordered.
2026-09-24 19:23:46 -04:00
e113a33c87 feat(story): add two-page flip book view reader
Fullscreen reader alongside Immersive view: paginated two-page spread
with no vertical scroll, chevron and arrow-key page turns, and a page
indicator. Chapters always render in reading order (Chapter 1 first).
Layout knobs (spine gap, single-column breakpoint, book max width) live
in lib/story/bookLayout with unit-tested paging math.
2026-09-24 19:23:42 -04:00
d00a5980a5 feat(story): add voiceover support for story beats
- Introduced voiceover relationship to StoryBeats with AI-generated flag.
- Added BeatVoiceover component for playing audio narrations with a minimal interface.
- Updated StoryPage, StoryViewer, and StoryTableOfContents to display and handle voiceovers.
- Created Voiceovers collection for uploading and managing audio narrations for beats.
- Included migration script to support voiceover functionality in the database.
2026-09-24 17:35:17 -04:00
2837518b3b fix(styles): improve text wrapping and layout for tooltips and captions
- Added `overflow-wrap: anywhere` to prevent text overflow in tooltips
- Adjusted tooltip width and wrapping for better responsiveness
2026-09-24 13:44:07 -04:00
1e1fc33b6a fix(session): dismiss expiry warning toast when signed out or extended
The one-shot heads-up toast used duration:Infinity with no id, so it
lingered after auto sign-out (when the banner unmounts) and its Extend
button 403'd on the expired token. Give the toast a stable id and
dismiss it when the banner leaves the warn window or unmounts, matching
the MissionReminderToasts pattern.
2026-09-24 12:04:58 -04:00
cbb12e281c feat(surveys): periodic reminder toasts for pending surveys
- getPendingSurveys resolves open + eligible + unsubmitted surveys (single eligibility path shared with the list page)
- GET /api/surveys/pending poll endpoint (cookie auth)
- SurveyReminderToasts in the frontend layout: polls every 5 min, toasts at most once per 15 min, action deep-links into the modal
- integration coverage for the pending resolution
2026-09-23 21:07:13 -04:00
d56af60366 feat(surveys): open surveys in a scrollable modal, fix page layouts
- list page and detail page use the standard site page wrapper (icon + title + subtitle)
- card click opens the survey in a scrollable shadcn Dialog; submitting removes the card on close
- detail page matches the helpdesk pattern: back link, title block, form in a card
- /surveys?open=<id> deep link auto-opens the modal; SurveyForm gained onSuccess
2026-09-23 21:07:07 -04:00
20b65d08fc feat(surveys): add survey system with audience targeting on plugin-form-builder
- forms collection: targeting group (all/users/roles/qualifications), activeFrom/activeUntil window, radio/date field blocks enabled
- form-submissions: server-side user attribution, expiry and audience gates, one attempt per user
- forms/submissions permissions in the Surveys registry group + admin role seed grants
- frontend /surveys list and /surveys/[id] take page with client block renderer
- register the pending role permission enum values migration
2026-09-23 18:17:29 -04:00
8cbf1820e3 fix(migrations): write sidecar index columns in drizzle object format 2026-09-23 18:17:24 -04:00
962064a5a4 feat(session): add pre-expiry warning banner with extend button
- SessionExpiryBanner: live countdown, warn 15min early, one-shot toast, Extend button
- countdown.ts: pure countdown helpers (timeUntilExpiry, sessionExpiryPhase, formatCountdown)
- useSessionExpired: added unlock handler for SESSION_EXTENDED_EVENT
- useGameTick: exported SESSION_EXTENDED_EVENT for session extension
- unit tests: 14/14 pass for countdown helpers
- e2e test: banner renders with countdown + extend button
2026-09-23 15:02:10 -04:00
f4fbcc80fa fix(import): align asset types with the Assets enum and honor export mod 2026-09-22 21:09:02 -04:00
d51c8445bb feat(map): tile-mode basemap mosaic previews on map picker cards 2026-09-22 21:09:02 -04:00
8c95c1ee82 feat(announcements): add announcements system with roleDocs targeting and richText
- announcements collection: info/success/warning/error variants, banner/modal/dialog/toast display types, up to 3 action buttons, dismissible flag, activeFrom/activeUntil windows, audience targeting (all/users/roles) and path include/exclude matching copied from the Shims pattern
- pure client-safe evaluation lib (enabled, time window, audience via roleDoc IDs, path match) plus per-browser localStorage dismissals
- AnnouncementHost mounted in the (frontend) layout: banners render inline, toasts via sonner custom markup, modals and confirmation dialogs queue one at a time
- permissions announcements:create/read/update/delete + admin:announcements:manage
- description is Lexical richText rendered via RichText/lexical-content on all surfaces; role targeting uses the dynamic Roles collection
- hand-written migrations with snapshot sidecars (collection, roleDocs targeting, description richtext conversion) + integration tests (12 passing)
2026-09-22 21:08:46 -04:00
bfe26d76c1 feat(operations): drop attendance from readiness scoring 2026-09-22 18:14:44 -04:00
8135c9850b feat(test): run tests against a dedicated truncated database
Bootstrap a per-run test database (ensure, push schema, truncate, seed baselines, repair sequences), wire vitest/playwright globals, and gate schema push behind DB_PUSH. Serial test files share the one database.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-09-22 17:58:17 -04:00
858cce4c40 docs: record permission tier, panel gate, and field access gotchas 2026-09-22 14:52:48 -04:00
529a9573b2 feat(admin): hide compose settings and API keys from non-superusers 2026-09-22 14:52:48 -04:00
239e95c462 feat(server): allow GM respawn ticket adjustments with permission-gated access 2026-09-22 14:52:44 -04:00
a6b5b19807 fix(operations): move page container responsibility out of PageShell 2026-09-22 14:52:44 -04:00
213a8c106f feat(banking): inline currency emblem display with optional label hiding 2026-09-22 14:52:44 -04:00
ae4ed8402d feat(game): admin feature flags for zone pressure, statistics, and helpdesk 2026-09-22 14:52:40 -04:00
8213d76816 chore(technologies): describe research cost resource logistics requirement 2026-09-22 14:50:46 -04:00
0617794da7 fix(access): reserve approval final states for the superuser tier, gate admin panel entry on page permissions 2026-09-22 14:50:40 -04:00
5883990577 feat(dev): confirm gate before navigating to the dashboard in dev
- DevDashboardGate intercepts left-clicks on links resolving to / and asks
  before navigating; the dev-mode dashboard render takes ~100s while the
  browser aborts at ~60s, so links otherwise look like a hang
- mounted only when NODE_ENV is development and a user is logged in;
  modifier-clicks, new-tab and download anchors bypass the gate
- layout now imports canAccessAdminPanel from divisionAccess
2026-09-21 20:48:17 -04:00
4dde790aa8 feat(access): division-scoped admin page access
- scopedAdminPageAccess replaces requireAdminPageAccess: technologies pass for
  intelligence division members, assets/resources/vehicles for logistics;
  everyone else still needs admin:<slug>:manage
- technology approval is stripped from create/update below admin so division
  members can never self-approve; technologies access moves to the
  intelligence permission
- assets/resources/vehicles move to logistics division permissions
2026-09-21 20:48:08 -04:00
5fb619a5cf fix(operations): move page data helpers to surface modules
Satisfies the Next 16 rule that page files only export page fields:
getSupplyBoxDetail/getSupplyBoxList and getReservationList/getReservationDetail
move to reservations/surface.ts and pages import from it.
2026-09-21 20:47:57 -04:00
8c10719124 feat(banking): currency emblem image with CurrencyAmount display wrapper
- GameRules currencySymbol switches from text to a media upload
- new CurrencyAmount/CurrencySymbol components; render sites across banking,
  base management, dashboard, market, campaigns and profiles are wired to
  show the emblem inline with amounts
- migration 20260921_140000 (text column out, media fk in); registers the
  five pending migrations in the migrations index
2026-09-21 20:47:52 -04:00
9bbe44d38d feat(map): world map picker entry, intel fields, node icons, generic markers
- Maps gain worldMap flag, description, freeform weather, latitude/longitude,
  easeOfAccess and factionControl; picker cards render them as stat tags
- resource-nodes gain a shared icon set and may exist with no resources as
  plain marker nodes (placement ignores marker-only nodes)
- sidebar gains the World Map entry; Infrastructure section gets defaultOpen
- migrations 20260921_120000/123000/130500/134000; includes the generated
  types/schema sweep (currency emblem fields land in the next commit)
2026-09-21 20:47:46 -04:00
679a0f7879 feat(logistics): supply box management surface 2026-09-21 08:19:33 -04:00
f895f75317 feat(operations): reservation actions, surfaces, and cancel flow 2026-09-21 07:46:27 -04:00
f2bd5418b2 feat(operations): supply-box sync store and handler 2026-09-21 07:40:44 -04:00
42066e9d13 feat(operations): reservation creation flow
Add the create-reservation dialog and its option sources for todo 3 of
ops-reservations-and-crate-sync.

- src/lib/operations/reservationOptions.ts: server-only option pool
  (listReservationOptions) returning upcoming unit-visible missions, idle
  unreserved vehicles, operational structures, budget accounts (no
  balances), per-origin stock, and a capped roster.
- src/components/frontend/operations/reservations/CreateReservationDialog.tsx:
  client dialog with core fields, personnel/vehicle multi-picks, cargo
  line repeater, budget + expiry; client pre-validation mirrors the
  server validator; engine errors render verbatim.
- Mount the dialog on the reservations list page, server-gated by
  operation-reservations:create + hasLogisticsQualification.
- Integration tests for the option scopes; e2e spec written (run in F3).

tsc clean; 5/5 integration tests pass.
2026-09-21 04:39:09 -04:00
c0563dae30 chore(generated): regenerate types and schema, register operation migrations
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-09-20 02:45:00 -04:00
37d28893de chore(operations): rollout controls, reconciliation, and bridge recovery
Env kill switch with raw-evidence retention, idempotent backfill, in-place dead-letter replay with reconciliation notes, command lease recovery on pull, ack terminal-state guards, and an operations runbook.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-09-20 02:45:00 -04:00