Skip to content

fix: demo sensor stream, lowercase app name#29

Merged
ng merged 2 commits intomainfrom
fix/demo-sensor-stream-branding
Mar 22, 2026
Merged

fix: demo sensor stream, lowercase app name#29
ng merged 2 commits intomainfrom
fix/demo-sensor-stream-branding

Conversation

@ng
Copy link
Copy Markdown
Contributor

@ng ng commented Mar 22, 2026

Summary

  • Simulated sensor stream for demo mode — piezo waveforms, capSense presence, bed temps, freezer health all animate on the Sensors tab without a real pod
  • Timeline canvas below the pipeline DAG now renders demo frame dots
  • App display name changed to lowercase "sleepypod" (was "Sleepypod")
  • "Sleepypod Intelligence" label changed to "sleepypod"

Test plan

  • Fresh install → Explore Demo → Sensors tab → verify waveforms animate, timeline shows dots, pipeline DAG pulses
  • Verify app name under icon on home screen shows "sleepypod" (lowercase)
  • Biometrics → sleep stages → verify "sleepypod" label (not "Sleepypod Intelligence")

Summary by CodeRabbit

  • New Features

    • Added demo mode for sensor data streaming with simulated readings for testing and preview purposes.
  • Style

    • Updated branding text in the sleep stages timeline view.

- Simulated sensor stream in demo mode (piezo, capSense, bedTemp, frzHealth)
- Timeline canvas now renders demo frame dots via trackDemoFrame()
- App display name changed to lowercase 'sleepypod'
- 'Sleepypod Intelligence' → 'sleepypod'
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

Warning

Rate limit exceeded

@ng has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 96877751-a535-4e0e-b78e-ede8b37488bd

📥 Commits

Reviewing files that changed from the base of the PR and between 36e01a0 and 9b05eb1.

📒 Files selected for processing (2)
  • Sleepypod/Services/SensorStreamService.swift
  • Sleepypod/SleepypodApp.swift
📝 Walkthrough

Walkthrough

Project configuration updated to Xcode 16.2 standards with revised build metadata. Demo mode functionality added to sensor stream service with periodic synthetic data generation. Minor UI text updates made to project strings.

Changes

Cohort / File(s) Summary
Project Configuration
Sleepypod.xcodeproj/project.pbxproj
Updated Xcode project format (objectVersion 77→63), adjusted file reference metadata (explicitFileType vs. lastKnownFileType), upgraded compatibility check (2600→2620), added asset/string catalog build settings, changed display name to lowercase.
Sensor Demo Mode Implementation
Sleepypod/Services/SensorStreamService.swift
Added demo streaming capability with periodic async loop (500ms ticks) generating synthetic sensor data (FPS, capacitive sense, piezo waveforms, device status, health, bed temperature). Introduced demoTask, startDemoStream(), stopDemoStream(), and trackDemoFrame() for managing demo lifecycle and frame tracking.
UI & Documentation Updates
Sleepypod/SleepypodApp.swift, Sleepypod/Views/Data/SleepStagesTimelineView.swift
Added explanatory comment documenting demo stream initialization flow; updated section header text from "Sleepypod Intelligence" to "sleepypod".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hop through the demo streams we go,
Synthetic sensors in a periodic flow,
With frames tracked neat and timings tight,
Sleepypod demos work just right! 💤✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: implementing demo sensor stream functionality and updating branding to lowercase app name.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/demo-sensor-stream-branding

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Sleepypod/Services/SensorStreamService.swift`:
- Around line 112-119: The connect() method currently guards on isConnected
before checking demo mode, causing a race where an active real WebSocket won't
be torn down when switching to demo; update connect() to check
APIBackend.current.isDemo first and if demo mode is requested ensure any
existing real connection is stopped (call disconnect()) before invoking
startDemoStream(), otherwise proceed with the normal connection flow; reference
symbols: connect(), isConnected, APIBackend.current.isDemo, disconnect(),
startDemoStream().

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e61254c-fca0-4e9e-b3a2-4cfa64de4320

📥 Commits

Reviewing files that changed from the base of the PR and between 76e5ec3 and 36e01a0.

📒 Files selected for processing (4)
  • Sleepypod.xcodeproj/project.pbxproj
  • Sleepypod/Services/SensorStreamService.swift
  • Sleepypod/SleepypodApp.swift
  • Sleepypod/Views/Data/SleepStagesTimelineView.swift

Comment thread Sleepypod/Services/SensorStreamService.swift
- Remove 'Search for sleepypod' button (auto-connect runs automatically)
- Show 'Retry' only after failure
- Fix demo stream race: check demoTask before isConnected guard
@ng ng merged commit 9f85709 into main Mar 22, 2026
2 checks passed
@ng ng deleted the fix/demo-sensor-stream-branding branch March 22, 2026 01:29
@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.

1 participant