fix(activity-log): map legacy WX / ⚠️ Road Incident prefixes to Weather/Traffic + backfill residual orphans (#100)

Extends TEXT_HINTS with three missing legacy prefixes so NULL-source audit rows
render the correct family label in the Activity Log UI:
-  (U+23F3) → Weather  (legacy composer weather-watch: " WX: …")
- 🌡️ → Weather  (NWS heat-alert format added in PR #96)
- ⚠️ Road Incident (U+26A0+FE0F) → Traffic  (legacy incident_handler rows)

Placed more-specific prefix before shorter variants to avoid false matches.
DB backfill: 0 residual NULL rows found (all rows already tagged after PR #99);
no audit-table writes performed. No mesh transmission.

Co-authored-by: Matt Johnson <mj@k7zvx.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
malice 2026-07-08 16:53:40 -06:00 committed by GitHub
commit 0857b92788
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,14 +62,20 @@ const TABLE_LABELS: Record<string, string> = {
// hydro.py → "🌊 …"
// swpc.py → "🧲 …" | "☀️ …"
// quake.py → "🌐 …"
// nws.py / composer (legacy) → "⏳ WX: …" | "🌡️ …" (heat, PR #96)
// incident_handler.py (legacy) → "⚠️ Road Incident …"
// NOTE: more-specific prefixes must appear before shorter ones that share a leading char.
const TEXT_HINTS: Array<[string, string]> = [
['🔥', 'Fire'],
['🚧', 'Traffic'],
['⚠️ Road Incident', 'Traffic'], // legacy incident rows (⚠️ = U+26A0+FE0F)
['⛷', 'Avalanche'],
['🌊', 'Hydro'],
['🧲', 'Space Wx'],
['☀️', 'Space Wx'],
['🌐', 'Quake'],
['⏳', 'Weather'], // legacy weather-watch rows: "⏳ WX: …"
['🌡️', 'Weather'], // legacy heat-alert rows (PR #96 NWS heat format)
]
// Type/family tag derived from source_event_table, with text-prefix fallback