Make live weather explicitly opt-in - #76
Conversation
Code Review ✅ Approved 1 resolved / 1 findingsAdds explicit opt-in consent for live weather to avoid unintended network requests. Consider removing the Weather widget from the strip when disabling—currently it leaves a dormant tile that users must manually delete, creating inconsistent behavior with the symmetric enable operation.
✅ 1 resolved✅ Quality: Disabling Live Weather leaves the Weather widget in the strip
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ecf9f482b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if enabled && contains(.weather) == false { | ||
| updatedItems.append(.builtIn(.weather)) | ||
| } | ||
| applyConfiguration(items: updatedItems, weatherEnabled: enabled) |
There was a problem hiding this comment.
Prevent refresh completion after disabling weather
When the user turns off Enable Live Weather while a location or WeatherKit request is awaiting completion, this keeps the Weather widget in the layout and causes the controller to call stop(), which sets the model to idle. However, the in-flight refreshNow() has no cancellation or isRunning check before publishing its result, so it can subsequently replace the idle state with a cached/loaded snapshot or a cancellation error; tasks spawned by the location-change subscriber are not canceled by stop() either. The still-visible widget can therefore continue showing weather or an error after opt-out instead of “Weather Off”; ensure all refresh completion paths are ignored after the model stops.
Useful? React with 👍 / 👎.
No description provided.