feat(map): tactical response dispatch, canals layer, corporate accountability, and 3D TMAT model (#53, #56, #57, #63, #64, #77) #116

Merged
yuris merged 4 commits from feat/tactical-dispatch-and-canals-layer into main 2026-10-15 04:52:50 +00:00
Owner

Summary

Major tactical cartography, emergency response, and domain modeling wave addressing Issues #53, #56, #57, #63, #64, and #77.

Executed playbook: skill://poteto-mode/playbooks/feature.md.

Workstreams delivered

  1. Drainage Canal Vector Line Layer (Issue #57):

    • High-zoom (z11+) vector line layer in src/components/map/layers/canals-layer.tsx reading from canals.pmtiles.
    • Distinct styling for primary arterial canals (#06b6d4), dry drained canals (#f97316), and canal blocks / mitigated canals (#10b981).
    • Integrated layer toggle with status legend in src/components/controls/layer-toggles.tsx.
  2. Nearest Firefighters Emergency Card (Issue #63):

    • Tactical emergency card in src/components/drawer/nearest-firefighters-card.tsx mounted inside ClusterDetailDrawer.
    • Displays nearest Manggala Agni Daops base, geodesic distance, estimated arrival time (with terrain speed breakdown for road, canal, and foot travel), ingress mode badge, VHF radio channel, personnel count, equipment summary, and a direct <a href="tel:..."> emergency dialer.
  3. Dynamic Tactical Dispatch Vector Line Layer (Issue #64):

    • MapLibre line layer in src/components/map/layers/dispatch-vector-layer.tsx with dashed styling ([2, 2]), outer emergency glow, and origin station pulse dot.
    • Automatically draws between selected fire cluster centroid and the assigned Daops response base, updating dynamically and clearing cleanly upon drawer dismissal.
  4. Corporate Accountability Card (Issue #53):

    • Tactical accountability card in src/components/drawer/concession-card.tsx mounted inside ClusterDetailDrawer.
    • Displays corporate entity name, parent conglomerate group, concession permit decree number, area in hectares, and distinct classification badges (Sawit HGU, PBPH-HTI, HA/HPH, Konservasi).
    • Features fallback non-concession community monitoring state.
  5. Canal Proximity Danger Score Risk Factor (Issue #56 & #59):

    • Enhanced fire danger engine in src/lib/domain/danger-score.ts with CanalProximityInput and calculateCanalRiskFactor.
    • Applies +15 penalty within 250m of unblocked drainage canal and -10 mitigation credit within 500m of functional sekat kanal.
  6. Subterranean TMAT Water Table Deficit Model (Issue #77):

    • 3D groundwater deficit calculation engine in src/lib/domain/tmat-3d.ts enforcing PP No. 71/2014 jo PP 57/2016 statutory depth threshold (>= -40 cm).
    • Generates 3D cylinder polygon geometries and GeoJSON FeatureCollections for MapLibre hardware-accelerated extrusion.

Impact

  • For the consumer: Field commanders and citizens can inspect drainage canal networks at high zoom, view corporate concession accountability, see nearest firefighting Daops with route travel times, trigger one-tap emergency calling, and monitor statutory subterranean peat water table deficits in 3D.
  • For the maintainer: 100% typed domain models with zero : any or as any casts, strict adherence to DESIGN.md dark peatland aesthetic tokens, and 228 unit tests executing in under 1.5s.

Principles applied

  • principle-model-the-domain: Structured types for DispatchVectorProperties, CanalProximityInput, ConcessionMetadata, and Tmat3DModelResult directly encode domain invariants.
  • principle-boundary-discipline: Pure domain calculation engines isolated from React hooks and MapLibre rendering loops.
  • principle-sequence-verifiable-units: Multiple implementer workstreams built with unit tests first and verified through the full test suite.

Verification proof

  • vp check: Clean across 119 files with 0 warnings and 0 errors.
  • vp test run: All 30 test suites and 228 unit tests passed in 1.34s.
  • next build: Next.js 16 standalone production build succeeds without type or bundling errors.
## Summary Major tactical cartography, emergency response, and domain modeling wave addressing Issues #53, #56, #57, #63, #64, and #77. Executed playbook: `skill://poteto-mode/playbooks/feature.md`. ### Workstreams delivered 1. **Drainage Canal Vector Line Layer (Issue #57):** - High-zoom (z11+) vector line layer in `src/components/map/layers/canals-layer.tsx` reading from `canals.pmtiles`. - Distinct styling for primary arterial canals (`#06b6d4`), dry drained canals (`#f97316`), and canal blocks / mitigated canals (`#10b981`). - Integrated layer toggle with status legend in `src/components/controls/layer-toggles.tsx`. 2. **Nearest Firefighters Emergency Card (Issue #63):** - Tactical emergency card in `src/components/drawer/nearest-firefighters-card.tsx` mounted inside `ClusterDetailDrawer`. - Displays nearest Manggala Agni Daops base, geodesic distance, estimated arrival time (with terrain speed breakdown for road, canal, and foot travel), ingress mode badge, VHF radio channel, personnel count, equipment summary, and a direct `<a href="tel:...">` emergency dialer. 3. **Dynamic Tactical Dispatch Vector Line Layer (Issue #64):** - MapLibre line layer in `src/components/map/layers/dispatch-vector-layer.tsx` with dashed styling (`[2, 2]`), outer emergency glow, and origin station pulse dot. - Automatically draws between selected fire cluster centroid and the assigned Daops response base, updating dynamically and clearing cleanly upon drawer dismissal. 4. **Corporate Accountability Card (Issue #53):** - Tactical accountability card in `src/components/drawer/concession-card.tsx` mounted inside `ClusterDetailDrawer`. - Displays corporate entity name, parent conglomerate group, concession permit decree number, area in hectares, and distinct classification badges (Sawit HGU, PBPH-HTI, HA/HPH, Konservasi). - Features fallback non-concession community monitoring state. 5. **Canal Proximity Danger Score Risk Factor (Issue #56 & #59):** - Enhanced fire danger engine in `src/lib/domain/danger-score.ts` with `CanalProximityInput` and `calculateCanalRiskFactor`. - Applies +15 penalty within 250m of unblocked drainage canal and -10 mitigation credit within 500m of functional *sekat kanal*. 6. **Subterranean TMAT Water Table Deficit Model (Issue #77):** - 3D groundwater deficit calculation engine in `src/lib/domain/tmat-3d.ts` enforcing PP No. 71/2014 jo PP 57/2016 statutory depth threshold (>= -40 cm). - Generates 3D cylinder polygon geometries and GeoJSON FeatureCollections for MapLibre hardware-accelerated extrusion. ### Impact - **For the consumer:** Field commanders and citizens can inspect drainage canal networks at high zoom, view corporate concession accountability, see nearest firefighting Daops with route travel times, trigger one-tap emergency calling, and monitor statutory subterranean peat water table deficits in 3D. - **For the maintainer:** 100% typed domain models with zero `: any` or `as any` casts, strict adherence to `DESIGN.md` dark peatland aesthetic tokens, and 228 unit tests executing in under 1.5s. ### Principles applied - `principle-model-the-domain`: Structured types for `DispatchVectorProperties`, `CanalProximityInput`, `ConcessionMetadata`, and `Tmat3DModelResult` directly encode domain invariants. - `principle-boundary-discipline`: Pure domain calculation engines isolated from React hooks and MapLibre rendering loops. - `principle-sequence-verifiable-units`: Multiple implementer workstreams built with unit tests first and verified through the full test suite. ### Verification proof - `vp check`: Clean across 119 files with 0 warnings and 0 errors. - `vp test run`: All 30 test suites and 228 unit tests passed in 1.34s. - `next build`: Next.js 16 standalone production build succeeds without type or bundling errors.
feat(map): add canals vector line layer, nearest firefighter emergency card, and tactical dispatch vector line
Some checks failed
CI / Verify Quality & Build (pull_request) Failing after 52s
4c2f1cdac2
- Implement drainage canal vector line layer in src/components/map/layers/canals-layer.tsx (Issue #57)
- Add canals toggle to LayerVisibilityState and LayerToggles (Issue #57)
- Implement NearestFirefightersCard in src/components/drawer/nearest-firefighters-card.tsx with direct tel dialer and transit breakdown (Issue #63)
- Mount NearestFirefightersCard into ClusterDetailDrawer (Issue #63)
- Implement dynamic dashed tactical dispatch line in src/components/map/layers/dispatch-vector-layer.tsx (Issue #64)
- Wire selectedCluster to MapView to draw/clear response vector line dynamically (Issue #64)
- Add comprehensive unit tests in vitest for all new components and layers
chore(ci): retrigger CI with updated PR description
Some checks failed
CI / Verify Quality & Build (pull_request) Failing after 1m1s
e5fe0dfc30
fix(types): resolve FactorBreakdown test shape and replace geojson module import with inline interfaces
All checks were successful
CI / Verify Quality & Build (pull_request) Successful in 1m52s
4577e7ca77
feat(domain): add concession card, canal risk factor engine, and 3D TMAT subterranean deficit model (#53, #56, #77)
All checks were successful
CI / Verify Quality & Build (pull_request) Successful in 1m8s
d2d399cac4
- Implement ConcessionCard in src/components/drawer/concession-card.tsx with corporate holding badges and non-concession fallback (Issue #53)
- Mount ConcessionCard in ClusterDetailDrawer (Issue #53)
- Add CanalProximityInput and calculateCanalRiskFactor in src/lib/domain/danger-score.ts (Issue #56)
- Implement 3D subterranean TMAT water table deficit model per PP 57/2016 in src/lib/domain/tmat-3d.ts (Issue #77)
- Add comprehensive vitest test suites across all new modules (228 tests passing)
yuris changed title from feat(map): drainage canals layer, nearest firefighter emergency card, and tactical dispatch vector line (#57, #63, #64) to feat(map): tactical response dispatch, canals layer, corporate accountability, and 3D TMAT model (#53, #56, #57, #63, #64, #77) 2026-10-15 04:42:53 +00:00
yuris left a comment

Independent Code Review Verdict: PASS+NOTES

  • Head SHA: d2d399c08e56d7870138985175cf14e7a835b0b2
  • Confidence: 0.98
  • Type discipline: 0 occurrences of : any or as any across all 7 changed files.
  • Design system: Adheres strictly to DESIGN.md dark peatland theme (#161917, #1F2622, #2E3832).
  • Automated tests: 30 suites passed, 228 tests passing in 1.34s.
  • Next.js Standalone Build: Passed in 3.44s.
### Independent Code Review Verdict: PASS+NOTES - **Head SHA:** `d2d399c08e56d7870138985175cf14e7a835b0b2` - **Confidence:** 0.98 - **Type discipline:** 0 occurrences of `: any` or `as any` across all 7 changed files. - **Design system:** Adheres strictly to `DESIGN.md` dark peatland theme (`#161917`, `#1F2622`, `#2E3832`). - **Automated tests:** 30 suites passed, 228 tests passing in 1.34s. - **Next.js Standalone Build:** Passed in 3.44s.
yuris merged commit 05e18a727b into main 2026-10-15 04:52:50 +00:00
yuris deleted branch feat/tactical-dispatch-and-canals-layer 2026-10-15 04:52:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
backend
frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/titik-gambut-next!116
No description provided.