Skip to content

Fix Effort scale ignored on Today hero gauge (#45)#1

Open
digitalerdude wants to merge 2 commits into
mainfrom
meine-erste-aenderung
Open

Fix Effort scale ignored on Today hero gauge (#45)#1
digitalerdude wants to merge 2 commits into
mainfrom
meine-erste-aenderung

Conversation

@digitalerdude

Copy link
Copy Markdown
Owner

Summary

  • The Today screen's Effort hero circle always showed the raw internal 0-100 value regardless of the Effort scale preference (Settings -> Units), so choosing WHOOP's 0-21 scale still showed numbers like 47.
  • HeroScoreCell also hardcoded its vessel-fill fraction to score/100.

Fix

Convert the Effort score via the existing UnitFormatter.effortValue(_:scale:) at the call site, and give HeroScoreCell an optional maxValue (default 100, so Charge/Rest are unaffected) so the fill and the displayed number agree on both scales.

Fixes ryanbr#45.

The Today screen's Effort hero circle always showed the raw internal
0-100 value regardless of the Effort scale preference (Settings ->
Units), so choosing the WHOOP 0-21 scale still displayed numbers like
47 instead of a 0-21 value. HeroScoreCell also hardcoded the vessel
fill fraction to score/100.

Convert the Effort score with UnitFormatter.effortValue(_:scale:) at
the call site and give HeroScoreCell an optional maxValue (default
100, unaffected for Charge/Rest) so the vessel fill matches the
displayed number on both scales.
main already shipped an equivalent (and more complete) fix for the
same Effort-scale hero bug, adding decimal-place support and
unrelated later fixes (ryanbr#74, #1013) to the same view. Take main's
version of LiquidTodayView.swift wholesale since it fully supersedes
this branch's change.
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.

The Effort scale setting doesn't seem to be applied to the Today screen. (UI)

1 participant