Regenerated the Payload admin import map to pick up the LaborCrewField
admin component. Unrelated to the campaign/notifications changes; kept in
its own commit so the feature commits stay focused.
Read state is personal to the recipient. Marking a notification read now
only ever flips the acting user's own rows — never another user's, even
when staff view it via read-all oversight (which would otherwise hide it
from its real owner).
- add /api/notifications/inbox endpoint that enriches each row with
ownerId, ownerName, and isMine so the bell can label "meant for
someone else" rows
- move mark-read logic into per-user lib helpers (markNotificationsReadForUser,
markAllNotificationsReadForUser) and have the actions delegate
- surface ownership in the bell UI and skip marking rows that aren't mine
Add a Campaign Status dropdown on the campaign detail page, gated by
campaign ownership or the campaigns:update permission (mirroring the
existing requireCampaignOwnership gate). Owners can set On Hold to pause
a campaign they are not actively running, and flip it back; admins act
through the same control. The editor optimistically updates the field,
toasts on success, refreshes the view, and reverts on failure.
- new CampaignStatusEditor client component (optimistic select + save)
- updateCampaignStatus server action (owner OR campaigns:update)
- render the editor on the detail page for authorized users
- add "On Hold" to the create dialog status options
- color + label the new status on cards and campaign rows (missions,
factions, dashboard) so it never renders as raw "onHold"
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).
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.
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.
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.
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.
- 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)
- 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
- 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
- Delete selected nodes with Del/Backspace (guarded against open dialogs,
menus, and focused form fields)
- Double-click the canvas to drop a dialogue node at the cursor; right-click
empty canvas for a New node menu with all six types; toolbar buttons now
place nodes at the viewport center instead of blind grid coordinates
- Choices support optional flag conditions evaluated server-side per player
(player flag first, global fallback); gated choices stay hidden until the
server confirms them, so forbidden options never flash on screen
- Litegraph-style per-output handles: one source handle per choice row plus
dedicated true/false handles on condition nodes, wired through derived
edges and handle-aware connections
- Brighten passive edge lines and edge labels on the dark canvas
- New dialogue nodes default to an empty speaker, rendering the NPC's name
Raise the default editor height from h-96 to 60vh (min 28rem) and add an
Expand/Shrink toolbar toggle that floats the whole editor over the document
form, filling the viewport right of the admin sidebar via the shell's
--nav-width/--app-header-height vars. Esc collapses it unless the node
dialog or context menu is open.
Finish the NPC dialogue flowchart work carried over from the base commit:
- Coloured NPC dialogue text via friendly names ({red}) or hex ({#ff00ff});
invalid names/hex render as literal text. Shared client-safe renderer
(DialogueText.tsx) used by both the admin canvas preview and the runtime.
- Player-flags feature: condition nodes branch on flags (evaluated
server-side), flag effects set/clear/adjust flags, PlayerFlags collection
+ migration, and event nodes can set flags.
- One-time ("once") choices: a choice flagged "Hide after picked" is hidden
for the rest of the current conversation only (per-session, resets on
begin()); GMs can persist across conversations with a condition flag.
- Admin editor: colour hint, once checkbox on choices, amber "once" badge.
Migration repair: the player_flags migration (20261005_185014) was sorting
before 20261006_000000, whose stale snapshot omitted player_flags, so any
future `migrate:create` re-emitted player_flags DDL. Restored 20261006_000000's
snapshot to the full current schema so it is the correct diff base.
Verified: `bun run payload migrate` clean, `migrate:create` reports no
schema changes, `tsc --noEmit` clean.
- GameNpcs: Narrative Activity group (weighted options, forced flag,
configurable reshuffle interval), level + richText levelDescription,
canMessage toggle
- New npc-dialogues collection with a purpose-built React Flow dialogue
editor (dialogue/choice/event/end nodes) in the admin panel
- Frontend: Currently-activity line and level description on the contact
profile page; NpcConversation messaging surface with a documented
(disabled) LLM extension seam
- Permissions: npc-dialogues CRUD + admin manage in a new NPC Dialogue
group; event types for dialogue triggers
- Migration 20261006_000000 (applied to dev DB) with full schema
snapshot sidecar
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.
Game NPCs gain an image upload and a Lexical rich-text bio (with data
migration that wraps existing plain text in a paragraph). NPC profile, card
and directory surface the portrait, a status-chip row and initials fallback;
contacts list and detail pages adopt the redesigned cards.
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.
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.
- 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.
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.
- 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.
- 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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
- 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.
- 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
- 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
- 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
- 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)
- 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
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.