1
0
Fork 0
Commit graph

844 commits

Author SHA1 Message Date
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
59fe616024 feat(npc-dialogue): rich hover tooltips on player choices 2026-10-06 16:21:53 -04:00
1e0df82725 feat(npc-dialogue): render inline images in dialogue markup 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
f20f57de66 feat(npc-dialogue): interpolate flag values into conversation text 2026-10-06 16:09:10 -04:00
38eb8ff771 feat(npc-dialogue): add text flag type to player flags 2026-10-06 16:09:10 -04:00
3b33c45df0 docs: backfill v0.5.0 and v0.5.1 changelog entries 2026-10-06 15:09:09 -04:00
3d93ecafb3 docs: add v0.5.2 changelog entry 2026-10-06 14:56:36 -04:00
94ef0fa2bb v0.5.2 - dialogue flow editor UX pass, routed edges, position persistence 2026-10-06 14:54:51 -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
28bb08f43e fix(npc-dialogue): bus-route return edges and spread detour lanes
Two routing defects on the dialogue canvas:

- Return edges entering the same handle detoured through identical
  corners, stacking into one thick bundle on the left of the target.
  Each edge now derives a stable lane offset from its id, so parallel
  detours run in visibly separate lanes.
- Long leftward runs relied on greedy corner-hopping alone, which could
  still leave a segment cutting under a card. Back edges now try
  structured bus routes (corridor above or below every card, then swing
  in to the entry handle) and score candidates by residual crossings,
  picking the first clean shape. The router also re-runs until clean
  (bounded to three passes) instead of trusting one greedy pass.

Verified on doc #2: all seven edges route with zero card crossings and
no stacked lanes; tech-tree edge-routing specs still pass.
2026-10-06 14:38:42 -04:00
3c70fa70d8 fix(npc-dialogue): persist node drags into the flow field value
Dragging a card updated the canvas but never wrote to the Payload
field, so document Save persisted stale positions. Wrap onNodesChange
and serialize once a drag settles (the final position change with
dragging === false), keeping the write off the mousemove hot path.
Selection and in-progress-drag flags are stripped before serializing
so clicking a card never marks the document dirty.
2026-10-06 14:28:18 -04:00
46f1abd4da feat(npc-dialogue): selection ring, draft-cancel removal, snap-to-grid toggle
- Selected node cards gain a gentle cyan ring so selection state is
  obvious without fighting the per-type border colors.
- A node created via double-click/toolbar/pane menu opens straight into
  its dialog; closing that dialog with Cancel (or Escape/backdrop/X)
  now discards the empty draft instead of persisting it. Saving clears
  the draft marker, so cancelling a later edit never deletes anything.
- New Snap toggle in the editor toolbar enables React Flow grid
  snapping (20px, matching the background dots); the preference is
  remembered per browser like the tech tree's.
2026-10-06 14:20:21 -04:00
5a9bd0052b feat(npc-dialogue): route flow edges around node cards
Crossing Bezier connectors made return edges (a choice looping back to
an earlier line) impossible to trace on the dialogue canvas. Extract
the tech tree's obstacle-avoidance router into a shared pure lib
(src/lib/flow-edge-routing.ts, plus rounded path building and a new
polylineMidpoint for label placement), leave re-export shims where the
tech tree imported it, and render dialogue edges through a new
RoutedFlowEdge type: perpendicular stubs at each handle, an orthogonal
base for forward edges, full-card detouring for back edges, arrowheads,
and condition labels as chips at the path midpoint.
2026-10-06 14:13:13 -04:00
1f7729c509 feat(npc-dialogue): select nodes on click, edit on double-click
- Single click now only selects a node; the edit dialog opens on
  double-click so the Del-to-delete flow is never interrupted by a modal
- Guard the canvas double-click handler so double-clicking a node can
  never also spawn a new dialogue node behind the dialog
- Update the editor hint text to describe the new click model
2026-10-06 13:56:46 -04:00
089246def8 feat(npc-dialogue): flow editor UX pass for authoring dialogue flows
- 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
2026-10-06 13:44:01 -04:00
0cadd1e062 feat(npc-dialogue): taller flow canvas plus expand-to-screen toggle
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.
2026-10-06 12:43:02 -04:00
78dc4945f7 v0.5.1 - global flags on NPC dialogue condition/flag system 2026-10-06 11:59:11 -04:00
035dd49149 feat(npc-dialogue): add global flag support (nullable user on player-flags) 2026-10-06 11:58:54 -04:00
4c2fc86ecb v0.5.0 - coloured NPC dialogue text, one-time choices, condition/flag branching, player flags 2026-10-06 01:19:14 -04:00
ac6415d034 feat(npc): complete dialogue feature and fix migration snapshot base
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.
2026-10-05 16:02:53 -04:00
2a3ad57bce feat(npc): add weighted activity, level, and dialogue conversations
- 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
2026-10-05 12:51:59 -04:00
76ca0e1d72 docs: add OpenChamber browser tab hygiene guidance to agent protocol 2026-10-05 12:40:47 -04:00
d21b36612f docs: add v0.4.1 player-facing changelog 2026-10-05 03:56:42 -04:00
d5bbf86e04 v0.4.1 - coordinate grid, locker sync, item storage, NPC portraits/bio, eval window, flappy ambient layers, /announce role mention 2026-10-05 03:39:43 -04:00
3e9d54486f chore(ui): replace em-dash placeholders with hyphen in NPC readouts
The 'Goods' readout cell rendered an em-dash when the NPC was not a vendor;
dash-sanitize gate requires a plain hyphen on user-facing surfaces.
2026-10-05 03:39:23 -04:00
6959a5ca0d docs: remove stale AI compose changelog entry 2026-10-05 03:37:20 -04:00
9b6935314d feat(bot): auto-mention a role in /announce when unset
Adds DISCORD_ANNOUNCE_MENTION_ROLE_ID; when set, /announce without a message
(compose dialog) posts the announcement with that role mentioned. Documented
in config, env example and the bot design guide.
2026-10-05 03:37:15 -04:00
c626ca3ccc feat(minigames): add drifting clouds and V-flock ambient layers to flappy
Adds drifting cloud layers and a V-flock of ambient birds to the flappy
bird arena for a more lived-in feel, without affecting gameplay.
2026-10-05 03:37:07 -04:00
4b9d231ba5 chore(ui): drop grid-texture hover fade
Remove the hover-only brightening of the tactical dossier grid texture so it
keeps a constant opacity across EmploymentCard, CampaignCard, and the
operations surfaces (OperationSections, StrategicSummary, tokens).
2026-10-05 03:36:38 -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
f4a0c8e378 chore(types): regenerate payload-types and generated schema 2026-10-05 03:29:34 -04:00
d530de315b chore(migrations): register grid, item storage and NPC migrations
Register 20261005_001212_add_map_grid_config,
20261005_051452_add_game_structure_item_storage and the two game-npc
migrations in the migration index, and normalize trailing commas on the
preceding entries.
2026-10-05 03:27:14 -04:00
755bd04875 feat(personnel): add NPC portraits and rich bio, redesign contact cards
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.
2026-10-05 03:22:11 -04:00
4755cb681a feat(game-structures): add item storage model with per-structure access control
New item storage (limited-arsenal stock) on game-structures: a unique
storageSlug identifying the structure to the game bridge, an Item Storage
Access group (anyone / specific roles / specific users) backed by
canAccessStructureStorage, a storedAssets array (asset, quantity, grid
position, rotation, per-instance attachments/skin/custom name) with a
storedAssetCount rollup, and a beforeChange hook that pushes a locker.apply
command to the game whenever web-originated stock changes. Migration
20261005_051452_add_game_structure_item_storage.
2026-10-05 03:19:32 -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
84939cc839 v0.4.0 - add mission planning maps, restore intelligence nav visibility 2026-10-04 02:53:34 -04:00
9865aa63b7 docs(changelog): add v0.4.0 changelog 2026-10-04 02:53:34 -04:00
d08ea8929c docs: document the intelligence visibility access layer 2026-10-04 02:53:24 -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
838c5035a4 docs: document the mission planning map 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
54e9a787cb feat(arma): extract the marker catalog from game files
- Add bun run markers:arma (src/tools/arma/extractMarkers.ts), which scans the
  game install and every DLC addons dir, merges CfgMarkers, CfgMarkerColors,
  CfgMarkerBrushes and CfgMarkerClasses with inheritance, resolves stringtable
  names, and converts marker icons to PNG.
- Commit the converted PNGs under public/arma/markers so production needs no
  game files.
- Add the pure, client-safe catalog lib in src/lib/arma-markers: generated
  catalog, case-insensitive lookups, the Arma marker model with validation,
  and SQF export helpers.
2026-10-04 02:53:15 -04:00
063fadd87d v0.3.1 - fix tech tree auto-arrange overloading the server 2026-10-03 04:10:43 -04:00
e8f5043020 docs(changelog): add v0.3.1 changelog 2026-10-03 04:10:43 -04:00
98cc860299 docs: document bulk tech tree position writes 2026-10-03 04:08:29 -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
47b2988ae7 v0.3.0 - promotion nominations, leadership transfers, mission lifecycle, tech tree editing 2026-10-03 03:36:02 -04:00