Skip to content

fix: correct widget weather, steps, battery sync and refresh animation - #122

Merged
LeanBitLab merged 1 commit into
mainfrom
fix/audit-findings
Dec 5, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
fix/audit-findings

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Fixes found in a repo audit, plus three user reports (battery out of sync, Events/Tasks animating on every refresh, small switch arrow).

Changes

  • Weather: warnings named the wrong day. Gadgetbridge forecasts start the day after the payload timestamp (Breezy drops today). Old payloads are now shifted by their timestamp.
  • Steps: turning steps off now stops the service. show_steps is no longer mirrored into global prefs; the service checks each placed widget's prefs with global fallback. Step state is saved on flush and once a minute with the screen off, not on every sensor event.
  • Battery sync: without keep-alive the battery could be 10-17% behind (inexact 15-min alarm, up to 75% late). It is now a one-shot alarm re-armed on every update, 5 min by default and 1 min while charging.
  • Events/Tasks animation: the launcher re-applies all cached actions on each partial update, and ViewFlipper replays its animation on every setDisplayedChild. Full renders now pick the page by visibility; only the tap switch animates, followed by a full update.
  • Tasks: undated tasks go last; an empty list shows "No open tasks" (new string in 11 languages); a read failure stays blank.
  • UI: colour pickers were hidden on Android 8-11; the next alarm follows a chosen date colour; tapping the events block reloads events; larger tap area for the switch arrow; links no longer crash without a browser.
  • Cleanup: removed dead code (checkLimit, world clock branches, validateToggle, test-only wrappers, usage permission copies, two unused strings).

Testing

  • ./gradlew --offline testDebugUnitTest: all pass, including new tests for weather days, next alarm colour, charging refresh and the flipper page. New tests were checked to fail on the old code.
  • lintDebug: 0 errors. scripts/check_strings.py: OK. assembleRelease (R8): OK before the last three changes.
  • On a phone (Android 16): refresh alarm window=+1m0s, re-armed every minute while charging; the Events block no longer animates on refreshes and still animates on tap; the larger arrow tap area works.

Weather and data
- Weather warnings named the wrong day: Gadgetbridge forecasts start
  tomorrow, and old payloads are now shifted by their timestamp
- Tasks without a due date no longer push due tasks off the list;
  an empty list shows "No open tasks", a read failure stays blank
- The next alarm follows a chosen date color

Background work
- Steps could never be switched off: show_steps is no longer mirrored
  into global prefs, and the service checks each widget's own prefs
- Step state is saved on flush and once a minute with the screen off,
  not on every sensor event
- Battery fell 10-17% behind without keep-alive: the refresh is a
  one-shot alarm re-armed on every update, 5 min by default and every
  minute while charging
- Screen time no longer stays hidden after granting usage access
- Events/Tasks no longer replay their page animation on every tick:
  full renders pick the page by visibility

UI
- Color pickers were hidden on Android 8-11
- Tapping the events block now reloads events
- Larger tap area for the Events/Tasks switch arrow
- Links no longer crash when no browser is installed

Cleanup
- Remove dead code: checkLimit, world clock branches, validateToggle,
  test-only wrappers, usage permission copies, two unused strings
@LeanBitLab
LeanBitLab merged commit 0d95853 into main Dec 5, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/audit-findings branch December 5, 2026 10:06
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