Skip to content

Smart sleep profiles#26

Merged
ng merged 1 commit intomainfrom
feat/smart-profiles
Mar 19, 2026
Merged

Smart sleep profiles#26
ng merged 1 commit intomainfrom
feat/smart-profiles

Conversation

@ng
Copy link
Copy Markdown
Contributor

@ng ng commented Mar 19, 2026

Summary

Replace the Cool/Balanced/Warm intensity picker with persona-based sleep profiles. Closes #22.

Profiles

Profile Icon Intensity Min/Max Description
Hot Sleeper 🔥 Cool 66-82°F Aggressive cooling for warm sleepers
Cold Sleeper ❄️ Warm 74-88°F Gentle cooling, warmer baseline
Balanced Balanced 70-85°F Science defaults
Recovery 🏃 Cool 65-84°F Extended deep-cold for exercise

Changes

  • SmartProfile model with curve generation parameters per persona
  • Horizontal scroll profile cards replace segmented picker
  • Selecting a profile updates intensity + min/max temps
  • Curve preview updates live

Test plan

  • Tap each profile, verify curve changes shape
  • Apply Hot Sleeper → verify lower min temp in schedule
  • Apply Recovery → verify extended cold valley

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Introduced smart sleep profiles for temperature preference management, replacing basic intensity selection
    • Added four preset profiles: hot sleeper, cold sleeper, balanced, and recovery
    • Profile selection now automatically adjusts temperature range and cooling intensity in a single action

Replace Cool/Balanced/Warm intensity picker with persona-based profiles:
- Hot Sleeper: aggressive cooling, deeper valley, lower min
- Cold Sleeper: gentle cooling, warmer baseline, higher min
- Balanced: science defaults
- Recovery: extended deep-cold for exercise recovery

Profiles are horizontal scroll cards that set intensity, min/max temps
when selected. The curve updates live to preview the profile's effect.

Also filed roadmap issues:
- core#236: Adaptive temperature engine with shadow mode
- core#237: Notification relay via WebSocket
- core#238: Pooled anonymized data export
- ios#22: Smart profiles (this PR)
- ios#23: AI-prompted curve design
- ios#24: Adaptive engine iOS integration
- ios#25: Dry run / simulation framework

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ng ng merged commit 5deb0a5 into main Mar 19, 2026
1 of 2 checks passed
@ng ng deleted the feat/smart-profiles branch March 19, 2026 07:43
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ad6ab047-9cf6-451f-87f0-945e3b362082

📥 Commits

Reviewing files that changed from the base of the PR and between 69751ab and db0101c.

📒 Files selected for processing (3)
  • Sleepypod.xcodeproj/project.pbxproj
  • Sleepypod/Models/SleepProfile.swift
  • Sleepypod/Views/Schedule/SmartCurveView.swift

📝 Walkthrough

Walkthrough

Added SmartProfile model representing user personas for sleep temperature preferences with curve generation logic. Introduced four built-in profiles (Hot Sleeper, Cold Sleeper, Balanced, Recovery). Updated SmartCurveView to replace the raw CoolingIntensity picker with a SmartProfile selector that atomically updates multiple temperature and intensity parameters.

Changes

Cohort / File(s) Summary
Xcode Build Configuration
Sleepypod.xcodeproj/project.pbxproj
Added SleepProfile.swift to the project's source build phase for the Sleepypod target.
Sleep Profile Model
Sleepypod/Models/SleepProfile.swift
New SmartProfile struct conforming to Identifiable and Sendable with metadata (id, name, icon, description, detail), curve generation parameters (intensity, minTempF, maxTempF, duration multipliers), and a generateCurve(bedtime:wakeTime:) method. Added extension with four static built-in profiles and allProfiles collection.
SmartCurveView UI Update
Sleepypod/Views/Schedule/SmartCurveView.swift
Replaced the CoolingIntensity picker with a horizontally scrollable SmartProfile selector. Profile selection now atomically updates selectedProfile, intensity, and temperature bounds. Descriptive text displays selectedProfile.description instead of intensity description.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Profiles hop into view, so neat and tidy,
Hot, cold, balanced—pick your vibe quickly!
No more slider slips, just tap and glide,
Your sleep curve dreams manifest with pride! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/smart-profiles
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Smart sleep profiles (Hot/Cold/Balanced/Recovery)

1 participant