Skip to content

v0.4.0 — Ferber Mode

Choose a tag to compare

@liviro liviro released this 21 Apr 23:13
· 125 commits to main since this release

What's new

Ferber mode — graduated-interval sleep training

  • Opt-in per night at Start Night: toggle Ferber mode and pick the night number (1-7); "night 8+" clamps to night 7 intervals
  • New Learning state: countdown to the next check-in with live mood (quiet / fussy / crying) and Settled / Give Up actions
  • New Check In state: mood-change or return-to-learning, server tracks check-in count and time-to-settle
  • Graduated interval table lives server-side (reports.IntervalFor); the client is a pure subtracter of two timestamps
  • Mood metadata is validated at the domain layer on every Ferber entry (put_down_awake_ferber, baby_stirred_ferber, mood_change)
  • "Start night" form remembers your last Ferber night and suggests night N+1 for tonight

Ferber stats and charts

  • Per-night Ferber panel on Night Detail: sessions, check-ins, avg time-to-settle, cry / fuss / quiet time
  • Three new trend charts (cry time, check-ins, time-to-settle) surface only once you have Ferber data
  • Sage-green markers highlight Ferber nights on every non-Ferber trend chart so you can see both axes at a glance

Architecture

  • Dedicated POST /api/session/start for starting a night (only action that creates a row, only action taking typed config)
  • Session response carries nested ferber?.current? with server-computed checkInAvailableAt — presence encodes state ("Ferber night" / "in session" / "Learning specifically")
  • Unified NightHourChart replaces the feed-scatter and bedtime charts with one primitive; consolidated ~100 LOC
  • Single-interval useNow hook shared across components (was: per-component timers drifting against each other)

Other UI improvements

  • Sentence-case button labels everywhere
  • Tracker states got per-state layout polish (awake, feeding, resettling, checking-in)
  • ESLint with react-hooks/exhaustive-deps as an error

State machine: 13 states, 41 transitions