Add a superuser-authored objective layer (defend, assault, secure, etc.) shown as labelled map markers on both the world map and mission planning map, with per-layer toggles on the planning map. - collection: MapObjectives (map_objectives table, enums, FKs) - lib: objectives service + objectiveTypes + permissions + event emit - actions/api: create/update/delete objectives server actions - UI: feature-layer toggles, objective picker dialog, world/plan markers, SQF export, dossier dialog integration - generated: regenerate payload schema + types for map_objectives - tests: 10 integration specs + e2e spec - docs: CHANGELOG, map-system, AGENTS guides
5.1 KiB
5.1 KiB
AGENTS.md: Mission Planning Map (Arma 3 Markers)
Parent:
../../../AGENTS.md(root guide: commands, Server Actions convention, domain guide index).
Optional per-mission planning layer: the mission's own map (classification.map) rendered on the mission page with Arma 3 map markers that belong to that mission only (never on the shared world map).
- Marker assets:
bun run markers:arma(src/tools/arma/extractMarkers.ts, needs the game install +hemtt; default game root/mnt/LData/SteamLibrary/steamapps/common/Arma 3, override--game). ScansDta,Addonsand every DLCaddonsdir (skips@mod folders), parses + mergesCfgMarkers/CfgMarkerColors/CfgMarkerBrushes/CfgMarkerClasseswith inheritance, resolves$STR_names via stringtables, converts icons to PNG inpublic/arma/markers/(committed, so prod needs no game files) and regeneratessrc/lib/arma-markers/catalog.generated.ts(never edit by hand). Side-color expressions resolve to Arma's default profile colors (BLUFOR 0,0.3,0.6 etc.). - Catalog lib (
src/lib/arma-markers/, pure, client-safe):index.ts(case-insensitivemarkerTypeOf/markerColorOf/markerBrushOf,resolveMarkerRgbawhere colorDefault= the type's own config color,markerTypesByCategory),missionMarkers.ts(marker model mirroring Arma: shape icon/rectangle/ellipse/polyline + type/color/brush/text/size/direction/alpha/points;normalizeMarkerInputvalidation;areaOutline(direction = degrees clockwise from north, size = half-extents likemarkerSize);hatchSegmentsfor pattern brushes;armaGridRef;markersToSqfexport, y flipped against world height). - Collection:
mission-map-markers(src/collections/intelligence/MissionMapMarkers.ts, permission group "Mission Map Markers", REST access permission-gated). Missions gainedclassification.planningMapEnabled(opt-in) and abeforeDeletehook that removes the mission's markers (the FK is NOT NULL, so Payload's default ON DELETE SET NULL would fail the delete). Migration20261003_190000_add_mission_map_markers(hand-written; matches the generated schema). - Rules: read = anyone who can read the mission (user-scoped
findByID). Two edit tiers insrc/lib/intelligence/missionMap.ts: curators (missions:updateor the mission'screatedBy) manage the whole plan (toggle, clear, edit/delete any marker); delegates (classification.planningMapDelegates, set per mission bymissions:updateholders viasetMissionPlanningDelegates) may place markers and edit/delete only their own. The map locks for everyone (isMissionPlanLocked) once status is Completed/Cancelled. Placing a marker queues 2 contribution XP that grants only if the marker survives to completion (seesrc/lib/contributions/AGENTS.md). Servicesrc/lib/intelligence/missionMap.ts; server actionssrc/app/(frontend)/intelligence/missions/mapActions.ts(setMissionPlanningMap,setMissionPlanningDelegates,getMissionMapMarkers,saveMissionMapMarker,deleteMissionMapMarker,clearMissionMapMarkers; eventsmission:planning-map-toggle/mission:planning-delegates/mission:map-marker-*/mission:map-markers-clear, targetmissions). Max 1000 markers per mission. - UI:
src/components/frontend/intelligence/missionMap/(tactical dossier section above the mission detail grid).MissionPlanningMap(state, debounced per-marker saves, 30s background refresh of markers and the map's shared objectives, Delete/Escape keys, SQF copy that includes visible objectives, Arma grid readout, Layers popover persisted in localStorage: objectives/structures/nodes/shipments/ranges plus grid/roads/zones),MissionMapCanvas(Leaflet, basemap + roads/zones viaGET /api/map-features?mapId=&layers=base, which skips structures/nodes/shipments until one of those reference layers is switched on; then the full feed loads),PlanningFeatureLayers(read-only structure/node/shipment/range reference markers with links back to the owning records),MarkerToolPanel(tools, type picker, colors, brush, text, scale/size, direction, opacity),markerIcon.ts+iconStyle.ts(icons render as texture MULTIPLIED by the marker color and masked by the texture alpha, exactly like Arma: white glyphs take the color, flags keep theirs; both moved to the sharedsrc/components/frontend/markers/folder alongsideMarkerTypePicker). Editors see an "Enable planning map" card until it is on; non-editors see nothing until enabled. Superusers (system:admin-access) can also place and amend the map's strategic objectives from the planning map through the sharedObjectiveDialog/ObjectiveLayer, independently of mission-marker curation. - Gotchas: leaflet click/dblclick/mousedown/mouseup fire faster than React re-renders, so draft line vertices and the area drag start live in refs (state only drives the preview). URLs inside divIcon HTML must use single quotes (
url('...')): a double quote ends thestyleattribute and the glyph silently disappears. Radix Select keepspointer-events: noneon<body>briefly after closing (affects scripted drags right after choosing a brush). Tests:tests/int/mission-map.int.spec.ts,tests/e2e/mission-planning-map.e2e.spec.ts.