Back to Developer Logs

Build Log — March 11, 2026

Build Log — March 11, 2026

What We Shipped

  • Garmin allDayRespiration webhook support — Respiratory rate was stuck on "Syncing..." for users whose Garmin sent allDayRespiration events instead of (or in addition to) sleep respiration data. Added a proper type definition, a custom aggregator that groups by user+date using startTimeInSeconds + offset, merges all timeOffsetEpochToBreaths maps, and upserts as one record per day. The health/range API now fetches both respiration and allDayRespiration from garmin_health_daily_raw and prefers whichever source has more samples. That should cover the remaining cases where HR was showing but respiration wasn't.

  • AI Coach knowledge base — A big batch of training methodology files landed under ai/knowledge/: 80/20 polarized training, Higdon, Pfitzinger, Maffetone and aerobic base, VDOT/Daniels, race preparation, injury prevention, and general training principles. This gives the coach real grounding in major methodologies instead of hallucinating training advice. Also added a welcome email template for training plan imports.

  • AI Coach dock widened — Dock width bumped from 280→320px (lg) and 320→360px (xl), with message gap increased from 3→4. Small change, noticeably less cramped.

  • Stale suggestion toast fix — AI suggestions with past dates were being restored from localStorage on every page load, triggering a "pending suggestion" toast indefinitely — for workouts that weren't even visible since the calendar defaults to the current month. Now filters out anything dated before today, clears localStorage silently when all suggestions are stale, and updates the toast copy from "Swipe up to dismiss" → "Tap to view" since it actually navigates somewhere.

What We Learned

The allDayRespiration fix is a good reminder: Garmin's webhook API is a choose-your-own-adventure — the same data can arrive via multiple payload types and you need to handle all paths. "Prefer the source with more samples" turns out to be a solid heuristic for this kind of dual-source health data.

What's Next

The knowledge base gives the AI coach a lot more to work with. Next focus is likely wiring those methodology files into coaching context selection — so the coach actually uses the right methodology for a given athlete's plan, not just generic advice.