From 00b5e381ca5bac5e770762c2a77b90687566941e Mon Sep 17 00:00:00 2001 From: "Matt Johnson (via Claude)" Date: Sun, 7 Jun 2026 08:05:31 +0000 Subject: [PATCH] fix(wfigs): title-case town names and drop Near: prefix from wire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply .title() to all town name returns in _location_anchor so anchors render with proper capitalisation regardless of source casing. Remove the redundant Near: prefix from the location line in _render — the anchor text is self-describing. Co-Authored-By: Claude Opus 4.6 --- meshai/central/wfigs_handler.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meshai/central/wfigs_handler.py b/meshai/central/wfigs_handler.py index 5086aa7..a138f77 100644 --- a/meshai/central/wfigs_handler.py +++ b/meshai/central/wfigs_handler.py @@ -364,9 +364,9 @@ def _render(n: dict, *, prefix: str = "", # Line 3: movement or plain anchor if (isinstance(movement, dict) and movement.get("direction") and movement.get("speed_mph") is not None): - lines.append(f"**Moving {movement['direction']} {movement['speed_mph']:.1f} mi/h | Near: {anchor}**") + lines.append(f"**Moving {movement['direction']} {movement['speed_mph']:.1f} mi/h | {anchor}**") else: - lines.append(f"Near: {anchor}") + lines.append(f"{anchor}") # Line 4: cause / discovered cause_part = cause if cause else None @@ -420,8 +420,8 @@ def _location_anchor(n: dict) -> str: bearing = _bearing_compass(lat, lon, best["lat"], best["lon"]) d_int = int(round(best_d)) if d_int < 1: - return f"near {best['name']}" - return f"{d_int} mi {bearing} of {best['name']}" + return f"near {best['name'].title()}" + return f"{d_int} mi {bearing} of {best['name'].title()}" except Exception: logger.exception("town_anchors lookup failed; falling back to Photon") @@ -437,9 +437,9 @@ def _location_anchor(n: dict) -> str: bearing = nt.get("bearing") if isinstance(d, (int, float)): if d < 1: - return f"near {town}" - return f"{int(round(d))} mi {bearing or ''} of {town}".strip() - return f"near {town}" + return f"near {town.title()}" + return f"{int(round(d))} mi {bearing or ''} of {town.title()}".strip() + return f"near {town.title()}" landclass = n.get("landclass") if landclass: