Skip to content

Detected workouts: guess the type, learn from answers, notify after sync - #58

Merged
gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd
Nov 4, 2026
Merged

gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd

Conversation

@gabrielbr

Copy link
Copy Markdown
Owner

Phase 1 of docs/activity-recognition-plan.md: Oura-style automatic activity detection.

  • Guessing the type. ActivityClassifier ranks every type (walk, run, cycle, gym, sport and the rest). It works from step cadence, how bursty the steps are, and how high and how uneven heart rate ran.
  • Learning from answers. Confirmed answers are stored with their features and carried in the backup. Once there are earlier answers close to a new stretch, they outweigh the rules.
  • Detection:
    • Step stretches and raised-heart-rate stretches merge into one window per activity, so a run is no longer also offered as cardio.
    • "Not this" now holds by overlap, so a re-detection with shifted bounds or a changed guess can't bring a dismissed stretch back.
  • After each sync: one notification per new suggestion from the last 12 h, for example "Looks like strength training · 45 min at 18:10". Tapping it opens the Activity tab. It has its own channel and its own switch in Settings → Notifications.
  • Today and Activity.
    • Today shows the newest suggestion as one line.
    • On the Activity card the guess is selected and the other types follow in order of likelihood, as 48dp chips and buttons.
  • Nothing is ever logged without a tap.
  • Tests: ActivityClassifierTest covers the rules, the learning, the features, merging, the dismiss-by-overlap rule and the encoding of stored answers.
  • Translations and docs: pt-BR strings and a note in AGENTS.md.
  • Design canvas: the Activity board's detected card and the line on the Today board are updated.

Generated by Claude Code

Plan in docs/activity-recognition-plan.md. Phase 1:
- ActivityClassifier ranks every type (walk, run, cycle, gym, sport, …)
  from cadence, step burstiness, heart-rate level and unevenness; the
  user's own confirmed answers outweigh the rules once close ones exist.
- Detection merges step and heart stretches into one window per activity,
  guesses its type, and keeps "Not this" by overlap so a re-detection
  can't resurface a dismissed stretch.
- After each sync, ActivityDetectionNotifier posts one notification per
  new suggestion from the last 12 h ("Looks like strength training · 45
  min at 18:10"), opening the Activity tab; own channel and switch in
  Settings → Notifications.
- Today shows the newest suggestion as one line; the Activity card selects
  the guess and offers the rest in order, with 48dp chips and buttons.
- Learned answers ride in the backup.

Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
@gabrielbr
gabrielbr merged commit c8c8677 into main Nov 4, 2026
2 checks passed
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