diff --git a/drb-c2-core/app/internal/incident_correlator.py b/drb-c2-core/app/internal/incident_correlator.py index d184af8..c45d65f 100644 --- a/drb-c2-core/app/internal/incident_correlator.py +++ b/drb-c2-core/app/internal/incident_correlator.py @@ -1223,7 +1223,7 @@ async def _update_incident( talkgroup_name or (f"TGID {talkgroup_id}" if talkgroup_id else inc.get("title", "").split(" — ")[-1]) ) - if primary_tag and best_location and primary_tag.lower() != best_location.lower(): + if primary_tag and best_location and best_coords and primary_tag.lower() != best_location.lower(): updates["title"] = f"{primary_tag} at {best_location}" elif primary_tag and tg_label: updates["title"] = f"{primary_tag} — {tg_label}" @@ -1271,7 +1271,7 @@ async def _create_incident( # Build a descriptive title from tags + location when available content_tags = [t for t in tags if t != "auto-generated"] primary_tag = _tag_to_title(content_tags[0]) if content_tags else None - if primary_tag and location and primary_tag.lower() != location.lower(): + if primary_tag and location and location_coords and primary_tag.lower() != location.lower(): title = f"{primary_tag} at {location}" elif primary_tag: title = f"{primary_tag} — {tg_label}" diff --git a/drb-frontend/components/MapView.tsx b/drb-frontend/components/MapView.tsx index cf574b4..5871280 100644 --- a/drb-frontend/components/MapView.tsx +++ b/drb-frontend/components/MapView.tsx @@ -518,51 +518,59 @@ export default function MapView({ nodes, activeCalls, incidents = [], lastUpdate const color = INCIDENT_COLORS[inc.type ?? "other"] ?? INCIDENT_COLORS.other; const age = inc.started_at ? timeAgo(new Date(inc.started_at)) : null; const unitCount = inc.units?.length ?? 0; + const baseClass = "w-full text-left bg-gray-950/85 backdrop-blur-sm border rounded-lg px-3 py-2 text-xs font-mono hover:brightness-110 transition-all"; + const cardBody = ( + <> +
+ + + {inc.type ?? "other"} + +
+

+ {inc.title ?? "Incident"} +

+ {inc.location && ( +

{inc.location}

+ )} +
+ {age && {age}} + {unitCount > 0 && ( + {unitCount} unit{unitCount !== 1 ? "s" : ""} + )} +
+ {!inc.location_coords && ( +

View details →

+ )} + + ); + if (inc.location_coords) { + return ( + + ); + } return ( -
- - - View details → - -
+ {cardBody} + ); })} @@ -580,22 +588,39 @@ export default function MapView({ nodes, activeCalls, incidents = [], lastUpdate
{incidents.map((inc) => { const color = INCIDENT_COLORS[inc.type ?? "other"] ?? INCIDENT_COLORS.other; - return ( - + + ); + if (inc.location_coords) { + return ( + + ); + } + return ( + + {label} + ); })}