Skip to content

feat(contacts): add reverse geocoding for node locations#238

Open
mikewren wants to merge 2 commits intoAvi0n:devfrom
mikewren:feature/contact-row-locality
Open

feat(contacts): add reverse geocoding for node locations#238
mikewren wants to merge 2 commits intoAvi0n:devfrom
mikewren:feature/contact-row-locality

Conversation

@mikewren
Copy link

@mikewren mikewren commented Feb 26, 2026

Summary

  • Adds City, State display for nodes that advert with GPS location enabled using Apple Maps reverse geocoding
  • Geocode results are cached to disk so lookups survive app restarts and avoid redundant network calls
  • Requests are queued sequentially to respect CLGeocoder's single-request limitation
  • Adds a "Node Location Lookup" toggle in Settings > Location — when disabled, no new network lookups occur but previously cached locations still display
  • Fixes singular/plural for "1 hop" vs "n hops"
  • Removes green location icon from contact rows (replaced by city/state text)
  • Removes redundant contact type label from detail profile header (already shown in navigation title)
  • Removes top whitespace in contact detail view

Changes

  • New: ReverseGeocodeCache.swift — actor-based geocode cache with disk persistence and sequential request queue
  • New: GeocodingSettingsSection.swift — toggle + explanatory footer in Settings > Location
  • Modified: ContactRowView.swift — shows "City, ST · n hops" in subtitle, singular/plural hop fix
  • Modified: ContactDetailView.swift — shows "City, ST · n miles away" under contact name, star/blocked moved inline with name
  • Modified: LocationSettingsView.swift — includes new geocoding section
  • Modified: Contacts.strings / Settings.strings / L10n.swift — new localization strings

Test plan

  • Verify nodes with GPS locations show "City, ST" in contact list and detail view
  • Verify nodes without locations show only the route label as before
  • Toggle "Node Location Lookup" off — confirm no new lookups, but cached locations still display
  • Kill and relaunch app — confirm cached locations persist
  • Verify "1 hop" (singular) vs "2 hops" (plural) displays correctly
  • Verify distance shows as "n miles away" in contact detail view

🤖 Generated with Claude Code

mikewren and others added 2 commits February 26, 2026 18:16
Add City, State display for nodes that advert with GPS location enabled.
Uses Apple Maps CLGeocoder with an actor-based cache that persists to
disk, so lookups survive app restarts and avoid redundant network calls.
Requests are queued sequentially to respect CLGeocoder's single-request
limitation.

- Add ReverseGeocodeCache actor with disk persistence and sequential queue
- Show "City, ST · n hops" in contact row subtitle
- Show "City, ST · n miles away" in contact detail profile
- Add geocoding toggle in Settings > Location with explanatory footer
- When disabled, cached lookups still display but no new network requests
- Fix singular/plural for hop/hops
- Remove green location icon from contact rows (replaced by city/state)
- Remove redundant contact type label from detail profile (already in nav title)
- Remove top whitespace in contact detail view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Distance away is already shown in the contact detail view, so it's
redundant in the compact row.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant