Skip to content

refactor(settings): remove trend arrow toggle and trend code - #42

Merged
Juuro merged 1 commit into
mainfrom
refactor/remove-trend-arrow
Sep 19, 2026
Merged

Juuro merged 1 commit into
mainfrom
refactor/remove-trend-arrow

Conversation

@Juuro

@Juuro Juuro commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove the "Show trend arrow" toggle from iOS and watchOS settings (the trend arrow no longer exists in the UI).
  • Delete the code behind it: TrendArrowPreferences, SettingsKey.trendArrowEnabled, WeightTrendArrow, WeightTrendEvaluator, WeightTrendDirection, WeightTrendCache, and their tests.
  • Delete the now-unused localization strings in all 11 locales: Show trend arrow, Display, Trending up, Trending down, Weight stable.
  • WidgetTimelineRefresh.syncEntryStoreAndReloadWidgets now fetches only the latest weight (limit: 1); it only used weights.first.

Notes

  • Existing installs keep a stale logweight_cached_trend_direction / logweight_trend_arrow_enabled value in defaults. Harmless; no cleanup added.

Test plan

  • Tools/check-localizations.sh: 117 keys in 11 locales
  • swift test in Packages/LogWeightCore: 103 tests, 0 failures
  • iOS and watchOS builds succeed
  • Screenshot scenes not run (settings-default will show the smaller Settings screen)

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

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.

Comment thread App/Watch/Views/WatchSettingsView.swift
@Juuro
Juuro merged commit 6a03d2f into main Sep 19, 2026
5 checks passed
@Juuro
Juuro deleted the refactor/remove-trend-arrow branch September 19, 2026 09:58
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.

2 participants