Skip to main content

Mobility & Cardio

Status: ✅ Complete
Last Updated: 2026-01-25

Overview​

Complete mobility and cardio tracking system with lunch slot rule enforcement and override tracking.


User Guide​

What is Mobility & Cardio Tracking?​

The Mobility & Cardio system helps you:

  • Track mobility/recovery sessions
  • Log cardio workouts
  • Enforce recovery through the lunch slot rule
  • Monitor training balance

Key Rule: You can do either Mobility or Cardio at lunch, but not both. This enforces recovery and prevents overtraining.

Mobility Sessions​

What is mobility? Recovery work, stretching, foam rolling, yoga, or any movement focused on recovery and flexibility.

How to log a mobility session:

  1. Go to Mobility page
  2. Select exercises - Choose from your exercise catalog (shared with gym workouts)
  3. Set duration - How long the session lasted
  4. Select focus area - What you focused on (full body, lower body, upper body, etc.)
  5. Add notes - Optional notes about the session
  6. Choose time slot - Select lunch or evening
  7. Save - Session is logged and linked to today's day

Mobility Features:

  • Exercise selection from shared catalog
  • Duration tracking
  • Focus area selection
  • Time slot selection (lunch/evening)
  • Session notes

Cardio Sessions​

What is cardio? Cardiovascular training like running, cycling, swimming, rowing, etc.

How to log a cardio session:

  1. Go to Cardio page
  2. Select type - Running, cycling, swimming, rowing, etc.
  3. Set duration - How long the session lasted
  4. Select intensity - Low, moderate, high
  5. Optional metrics:
    • Distance (with unit selector: km/miles)
    • Heart rate (average, max)
    • Calories
    • Elevation gain
    • Start/end time
    • Pace (auto-calculated from distance and duration)
  6. Choose time slot - Select lunch or evening
  7. Add notes - Optional notes about the session
  8. Save - Session is logged and linked to today's day

Cardio Features:

  • Type selection (running, cycling, etc.)
  • Duration and intensity tracking
  • Optional distance, heart rate, calories, elevation
  • Auto-calculated pace
  • Time slot selection (lunch/evening)
  • Statistics view with totals and breakdowns
  • Historical view with filtering and sorting

The Lunch Slot Rule​

What is it? A rule that enforces recovery: You can do either Mobility or Cardio at lunch, but not both.

Why this rule? Prevents overtraining and ensures you have time for recovery. The lunch slot is for one activity only.

How it works:

  • If you log mobility at lunch, you cannot log cardio at lunch (and vice versa)
  • System shows warnings when rule is violated
  • You can override the rule if needed (with reason and notes)

Override the rule:

  • If you need to do both (rare circumstances), you can override
  • System tracks overrides with reason and notes
  • Overrides are logged for review and pattern analysis

Time Slots​

Lunch Slot:

  • Typically 30-60 minutes
  • Either mobility OR cardio (not both)
  • Enforced by the lunch slot rule

Evening Slot:

  • Can be longer sessions
  • No restrictions (can do both mobility and cardio if desired)
  • Separate from lunch slot

Statistics & Analytics​

Cardio Statistics:

  • Total distance, duration, sessions, calories
  • Average pace and heart rate
  • Breakdown by type (running, cycling, etc.)
  • Historical view with filtering and sorting

Mobility Tracking:

  • Session frequency
  • Duration tracking
  • Focus area distribution
  • Exercise usage patterns

Integration with Training​

Shared Exercise Catalog:

  • Mobility sessions use the same exercise catalog as gym workouts
  • Same exercises, different context (recovery vs strength)
  • Unified tracking across all training types

Training Balance:

  • System tracks all training types (gym, mobility, cardio)
  • View overall training load and balance
  • Identify patterns and imbalances

Best Practices​

  1. Respect the lunch slot rule - Use it for recovery, not intense training
  2. Log immediately - Don't wait, log right after your session
  3. Be consistent - Track all sessions to build a complete picture
  4. Use overrides sparingly - Override only when truly necessary
  5. Review patterns - Check if you're overtraining or under-recovering

Common Questions​

Q: Can I do both mobility and cardio in the same day?
A: Yes, but not both at lunch. You can do one at lunch and one in the evening, or both in the evening.

Q: What if I need to do both at lunch?
A: You can override the rule, but this should be rare. The system tracks overrides for pattern analysis.

Q: Do I need to log all the optional cardio metrics?
A: No, only type, duration, and intensity are required. Distance, heart rate, calories, etc. are optional but provide richer analytics.

Q: Can I edit sessions after logging?
A: Yes, you can edit any mobility or cardio session to update metrics, notes, or time slot.

Q: How does the system calculate pace?
A: Pace is automatically calculated from distance and duration. You can see it in the cardio form and statistics.

Q: What's the difference between mobility and cardio?
A: Mobility is recovery-focused (stretching, foam rolling, yoga). Cardio is cardiovascular training (running, cycling, etc.). Both are important for overall fitness.


Implementation Details​

Core Features​

  • ✅ Mobility session UI (MobilityPage with exercise selection, duration, focus area)
  • ✅ Cardio session UI (CardioPage with intensity/type selectors)
  • ✅ Lunch/Evening rule enforcement (UI indicators for rule compliance)
  • ✅ Override tracking and warnings (RuleOverride model, backend service/routes, frontend override option)

Cardio Tracker Enhancement ✅ Complete​

Enhanced cardio session tracking with comprehensive stats similar to workout tracking:

Backend Enhancements:

  • ✅ Database schema: All optional fields present (distance, pace, averageHeartRate, maxHeartRate, heartRateZones, calories, elevationGain, startTime, endTime)
  • ✅ CardioService enhancements: Updated createSession() to accept new optional fields, added updateSession() method, added getSessionStats() for aggregate statistics, calculate derived metrics (pace from distance/duration)
  • ✅ API routes: PUT /cardio/sessions/:sessionId (update), GET /cardio/sessions/stats (statistics), DELETE /cardio/sessions/:sessionId (delete), updated POST /cardio/sessions to accept new optional fields

Frontend Enhancements:

  • ✅ Enhanced cardio session form: Distance input (with unit selector: km/miles), heart rate inputs (average, max), calories input, elevation gain input, start/end time pickers, auto-calculate pace from distance and duration
  • ✅ Cardio statistics view: Totals (distance, duration, sessions, calories), average pace and heart rate, breakdown by type
  • ✅ Cardio session list enhancements: Display additional stats in session cards, filter by type, sort by date, distance, duration
  • ✅ Historical view: Cardio history page with all sessions, session details view with all stats, edit/delete functionality

Override System​

  • ✅ Database schema (RuleOverride model with ruleType, reason, notes)
  • ✅ Backend service (RuleOverrideService with createOrUpdate, getByDayAndRuleType, getByDay, delete)
  • ✅ API routes (POST /api/rule-overrides, GET /api/rule-overrides/day/:dayId/:ruleType, GET /api/rule-overrides/day/:dayId, DELETE /api/rule-overrides/day/:dayId/:ruleType)
  • ✅ Backend tests (12 service tests, 11 route integration tests, all passing)
  • ✅ Frontend integration (TodayTraining component shows override option when lunch slot rule is violated)
  • ✅ Frontend tests (7 tests, all passing)
  • ✅ Override option added to MobilityPage and CardioPage (6 new tests for MobilityPage, 6 new tests for CardioPage, all passing)

API Endpoints​

  • /api/mobility - Mobility session CRUD
  • /api/cardio - Cardio session CRUD
  • /api/rule-overrides - Rule override management

Frontend Pages​

  • Mobility Page (/mobility)
  • Cardio Page (/cardio)