Skip to content

Weather: manual location setting with city search (fixes #177) - #187

Open
starbrightlab wants to merge 1 commit into
mainfrom
feat/177-weather-location
Open

Weather: manual location setting with city search (fixes #177)#187
starbrightlab wants to merge 1 commit into
mainfrom
feat/177-weather-location

Conversation

@starbrightlab

Copy link
Copy Markdown
Owner

Problem (issue #177)

Weather location comes from IP geolocation, resolved once and cached forever, with no override and no refresh. When the ISP's exit node geolocates to the wrong city (common), the weather chip, forecast widget, sunrise/sunset times, and ISS passes are all permanently wrong with nothing the user can do about it.

Fix

  • Manual override in Weather: manual_lat/lon/city in the existing immortal_weather prefs, taking precedence over the auto cache in location() and cachedCity(). redetectAutomatically() clears both the override and the cached IP answer, so re-detection starts from scratch instead of reviving a stale first answer.
  • City search via Open-Meteo's keyless geocoding API (consistent with the house no-keys rule). The response parse is pure and covered by three new unit tests.
  • WeatherLocationActivity: search field, tappable result rows ("Boston, Massachusetts, US"), a "Detect automatically instead" action that re-resolves and shows what it found, and Done. Mirrors the AlbumUrlEntryActivity look and the tvFocusable interaction pattern.
  • Registry: a NavSpec row ("Weather location") in the immortal domain next to the temperature unit, showing the pinned place or "Auto: " as its value. No persisted registry fields added (NavSpec navigates only), so the domain tripwires are untouched.

Testing

  • Full unit suite green, including the new geocoding parse tests.
  • Geocoding endpoint verified live (Boston -> US + GB matches with the expected fields).
  • Needs an on-device pass: search flow, pinning a city, re-detect, and that the weather chip/forecast pick up the new coordinates on their next refresh.

Fixes #177.

🤖 Generated with Claude Code

Weather location came from IP geolocation, resolved once and cached forever
with no override and no refresh — so when the ISP's exit node geolocated to
the wrong city (common), the weather chip, forecast widget, sunrise/sunset
times, and ISS passes were all permanently wrong with no way to correct them.

- Weather gains a manual override (manual_lat/lon/city in the existing
  immortal_weather prefs) that takes precedence over the auto cache in
  location() and cachedCity(); redetectAutomatically() clears both the
  override and the cached IP answer so re-detection starts from scratch.
- City search via Open-Meteo's keyless geocoding API (matches the house
  no-keys rule); the response parse is pure and unit-tested.
- WeatherLocationActivity: search field + result rows + "Detect automatically
  instead", mirroring the AlbumUrlEntryActivity look. Registered per the
  settings rules as a NavSpec row ("Weather location") in the immortal
  domain, next to the temperature-unit setting.

No persisted registry fields added (NavSpec navigates only), so the domain
tripwires are untouched. Full unit suite green.

Co-Authored-By: Claude Fable 5 <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.

Weather reporting wrong? Location issue maybe

1 participant