refactor(settings): remove trend arrow toggle and trend code - #42
Merged
Merged
Conversation
The trend arrow no longer exists in the UI, so drop the "Show trend arrow" setting on iOS and watchOS along with everything behind it: - TrendArrowPreferences, SettingsKey.trendArrowEnabled, WeightTrendArrow view - WeightTrendEvaluator, WeightTrendDirection, WeightTrendCache and tests - unused localization strings in all 11 locales (Show trend arrow, Display, Trending up, Trending down, Weight stable) Entry widget sync now fetches only the latest weight (limit 1). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The watch unit picker updates only standard defaults, so widgets/complications that read units from the App Group can show a stale unit until restart.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Removes the (now unused) trend-arrow feature end-to-end: settings toggles, core evaluation/caching code, widget UI, tests, and related localization keys, while simplifying widget refresh to fetch only the latest weight sample.
Changes:
- Removed trend-arrow settings from iOS + watchOS settings, along with the underlying preferences key/mirroring.
- Deleted trend-arrow computation/caching types and their unit tests from
LogWeightCore. - Removed the related localization keys across all locales, and simplified widget refresh to query
recentWeights(limit: 1).
| File | Description |
|---|---|
| project.yml | Removes WeightTrendArrow.swift from watch widget target inputs. |
| Packages/LogWeightCore/Tests/LogWeightCoreTests/WeightTrendEvaluatorTests.swift | Deletes tests for the removed trend evaluator. |
| Packages/LogWeightCore/Tests/LogWeightCoreTests/WeightTrendCacheTests.swift | Deletes tests for the removed trend cache. |
| Packages/LogWeightCore/Tests/LogWeightCoreTests/TrendArrowPreferencesTests.swift | Deletes tests for the removed trend-arrow preference mirroring. |
| Packages/LogWeightCore/Sources/LogWeightCore/Widget/WeightTrendCache.swift | Removes cached trend direction persistence for widgets. |
| Packages/LogWeightCore/Sources/LogWeightCore/Settings/TrendArrowPreferences.swift | Removes trend-arrow enablement/mirroring logic. |
| Packages/LogWeightCore/Sources/LogWeightCore/Settings/SettingsMigrator.swift | Stops mirroring the removed trend-arrow preference. |
| Packages/LogWeightCore/Sources/LogWeightCore/Settings/SettingsKeys.swift | Removes SettingsKey.trendArrowEnabled. |
| Packages/LogWeightCore/Sources/LogWeightCore/Models/WeightTrendEvaluator.swift | Deletes trend direction + evaluator implementation. |
| App/Watch/Views/WatchSettingsView.swift | Removes trend-arrow toggle and related widget reload logic. |
| App/Shared/Widget/WidgetTimelineRefresh.swift | Fetches only the latest weight (limit: 1) and drops trend-cache update. |
| App/Shared/Widget/WeightTrendArrow.swift | Removes the widget/history trend arrow view. |
| App/Shared/Views/SettingsView.swift | Removes the “Show trend arrow” toggle and its mirroring/reload side effects. |
| App/Shared/Resources/zh-Hant.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/zh-Hans.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/pt-BR.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/nl.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/ko.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/ja.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/it.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/fr.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/es.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/en.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
| App/Shared/Resources/de.lproj/Localizable.strings | Removes now-unused trend-arrow related keys. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
TrendArrowPreferences,SettingsKey.trendArrowEnabled,WeightTrendArrow,WeightTrendEvaluator,WeightTrendDirection,WeightTrendCache, and their tests.Show trend arrow,Display,Trending up,Trending down,Weight stable.WidgetTimelineRefresh.syncEntryStoreAndReloadWidgetsnow fetches only the latest weight (limit: 1); it only usedweights.first.Notes
logweight_cached_trend_direction/logweight_trend_arrow_enabledvalue in defaults. Harmless; no cleanup added.Test plan
Tools/check-localizations.sh: 117 keys in 11 localesswift testinPackages/LogWeightCore: 103 tests, 0 failuressettings-defaultwill show the smaller Settings screen)🤖 Generated with Claude Code