Skip to content

fix: warn when weather data belongs to a different location and clearer labels#2

Merged
giancarloerra merged 1 commit intomainfrom
fix/weather-data-labels
Mar 10, 2026
Merged

fix: warn when weather data belongs to a different location and clearer labels#2
giancarloerra merged 1 commit intomainfrom
fix/weather-data-labels

Conversation

@giancarloerra
Copy link
Owner

Summary

Show a warning on the Location card when the configured observer location differs from
the location of the currently downloaded weather data.

Motivation

After changing location in Settings and navigating back to the Weather Dashboard, the
displayed coordinates belong to the previous download — which is confusing. Instead of
a static "Location Downloaded" label, the card now detects the mismatch and prompts the
user to refresh.

Changes

  • Fetch /api/location on dashboard mount to get the configured observer coordinates
  • Compare configured location with weatherData.metadata (>0.01° threshold)
  • When mismatched: amber border on the Location card, amber globe icon, and a small
    inline warning with a clickable "refresh" link
  • When matching: card looks exactly as before (label reverted from "Location Downloaded"
    back to "Location")
  • Import AlertTriangle icon from lucide-react

Testing

  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • Verified manually in dev / built production mode

Breaking changes

  • No breaking changes

Screenshots (if applicable)


By submitting this pull request I confirm that my contribution is made under the terms of the GNU Affero General Public License v3.0 or later.

@giancarloerra giancarloerra self-assigned this Mar 10, 2026
@giancarloerra giancarloerra merged commit 8c794da into main Mar 10, 2026
3 checks passed
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