Back to Developer Logs

Build Log — January 27, 2026

Build Log — January 27, 2026

Context / Focus for Today

Major AI coach UX improvements, native Garmin repeat steps, workout time/distance estimates, and cleaning up chat clutter.


Things I Got Done Today

Native Garmin WorkoutRepeatStep (Major Feature)

Repeat Blocks in Garmin Connect

  • Added support for sending repeat blocks as native WorkoutRepeatStep
  • Creates "X Times" grouping in Garmin Connect instead of flattening into individual steps
  • Feature flag system (GARMIN_USE_NATIVE_REPEATS env var) - off by default
  • Automatic fallback if Garmin rejects the native format
  • Added 12 unit tests for native repeat functionality

New Types

  • GarminWorkoutRepeatStep type and GarminRepeatType enum
  • repeatBlockToGarminRepeatStep converter
  • calculateTotalDuration for mixed step types

AI Coach UX Overhaul

Expanded Chat as Overlay

  • Chat now overlays on calendar instead of hiding it
  • Semi-transparent backdrop with blur effect
  • Centered fixed overlay (max-w-3xl)
  • Click backdrop to collapse chat
  • Integrated with global modal escape system

Fixed Height Panel

  • Chat panel now has fixed 800px height
  • Compact header matching weekday header height
  • Removed subtitle text for cleaner look
  • Panel stays fixed regardless of calendar content

Smarter Responses

  • AI coach now knows about its pending workout suggestions
  • Follow-up questions like "which day did you add it to?" now work correctly
  • Added truncation detection for Vercel timeout/token limit
  • Shows toast + warning when response gets cut off
  • Reduced plan chunking from 4 weeks to 2 weeks to avoid timeouts

Prompt Variety

  • Expanded prompt pools: 6 planning, 6 adjustment, 12 question prompts
  • Daily rotation using date-based seed
  • Prompts stay consistent within a day but change each day

Duration Mode Emphasis

  • Moved Garmin duration mode rule to be first and most prominent
  • Prevents AI from mixing time-based warmups with distance-based intervals

Workout Time & Distance Estimates

Smart Estimation

  • WorkoutCard shows both time AND distance using pace-based estimation
  • Time-based workouts: exact time + estimated distance (~X mi)
  • Distance-based workouts: estimated time (~X min) + exact distance
  • Workout builder shows both metrics with ~ prefix for estimates
  • WeekSummaryCell uses same estimation for accurate weekly totals
  • Auto-populate plannedDurationSeconds and plannedDistanceMeters from steps

Intervals.icu Connection

API Key Input

  • Replaced OAuth-only flow with API key input dialog
  • Users enter API key directly from intervals.icu/settings
  • Test API key before saving
  • Store in localStorage for client-side auth

UX Cleanup: Toasts vs Chat

Chat Reserved for Coaching

  • Removed redundant chat messages that duplicated toast notifications
  • Strava sync status → toast only
  • Garmin import status → toast only
  • Workout move/delete operations → toast only
  • Plan applied confirmations → toast only
  • AI chat now focused on actual coaching conversations

Trial Banner

Dismissible Banner

  • Added X button to dismiss when not urgent (>7 days left)
  • Dismissal stored in localStorage for 3 days
  • Banner auto-shows when urgent (≤7 days left)
  • Expired banners cannot be dismissed

Import Modal Quick Dates

  • Added "Last 30 days", "Last 60 days", "Last 90 days" buttons
  • Available in both Garmin and Strava import modals

Bug Fixes

  • Fixed duplicate workouts when accepting AI suggestions (reordered state updates)
  • Fixed 401 polling loop on stale browser tabs (stop on auth failure)
  • Fixed daily summary upsert conflict (use user_id,calendar_date)
  • Fixed garmin_user_id being wiped during OAuth reconnection
  • Fixed workout builder modal overlap with close button
  • Renamed "Duration" to "Workout Type" for clarity
  • Fixed beforeEach/afterEach placement for Vitest 4.x

Commits Today

  • 27 commits covering features, fixes, and refactors
  • Major: Native Garmin repeat steps (e5c2ccb)
  • Major: AI coach overlay on calendar (e9fd924)
  • Feature: Time/distance estimates (d3be3e6, 99e91ad)
  • Feature: Intervals.icu API key (da95769)
  • AI: Pending suggestions context (940d591)
  • UX: Toast cleanup (13b624c, c15b99b, 3921a1b, 3989e7b)

In Progress

  • Testing native Garmin repeat steps with feature flag
  • Vitest 4.x/jsdom compatibility issue investigation

Targets for Tomorrow

  1. Garmin repeat testing — Enable feature flag and test end-to-end
  2. Vitest fix — Investigate "No test suite found" errors
  3. Vercel Pro — Consider upgrading to avoid 10s timeout on AI responses

Notes / Observations

  • Native Garmin repeat steps create much cleaner workout structure in Garmin Connect
  • The toast vs chat cleanup made a big difference - chat feels more conversational now
  • Vercel Hobby plan's 10s timeout is a real constraint for AI streaming responses
  • Date-based prompt rotation is a nice touch for returning users

Momentum Score: 9 / 10

Highly productive day! The AI coach overlay is a major UX win - users can see their calendar while chatting. Native Garmin repeats complete a long-requested feature. The toast/chat cleanup significantly improves the feel of the app.