Skip to content

test: cover release #783 gaps in Stage, Base and piezo views - #790

Merged
ng merged 7 commits into
devfrom
test/release-783-coverage
Oct 8, 2026
Merged

ng merged 7 commits into
devfrom
test/release-783-coverage

Conversation

@ng

@ng ng commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Adds tests for the patch-coverage gaps Codecov flagged on release #783 (patch 92.8%, 186 lines missing), plus one small alarm fix from reviewing the release diff.

Fix

  • fix(alarm): keep the snooze when the tap's clear write fails (src/hardware/gestureActionHandler.ts). When a snooze or dismiss tap came in while the DAC was unreachable, client.connect() or client.clearAlarm() threw. That skipped alarm.ended(), and for a snooze it also skipped alarm.snooze(). The firmware has already stopped the vibration on the tap, so the snoozed alarm never came back and the side stayed marked vibrating. The clear write is now best-effort and logged on failure, and the alarm bookkeeping always runs.

Coverage added (statements measured locally with v8, per file)

  • Stage/TempStage.tsx: 180/211, 36 branches missed → 210/211, 0 branches missed. Covers keyboard edge cases (modifier keys, input focus, toggling selection), every panel action (power, warmer and cooler, dial, resume, close, stepper tabs and phases), the 2D fallback card callbacks, the panel scope for away and presence, link and unlink, the preview pill, and the fallbacks for room, health and status.
  • Stage/stageScene.ts, StageTimeline.tsx, heatTexture.ts: now 100% of statements. Covers linked hover, missing label refs, labels behind the camera, a zero-size canvas, a frame that fires after dispose, scrubbing (secondary button, zero width, empty lane) and the knit when there is no 2D context.
  • Sensors/PiezoWaveform.tsx: 338/360 → 356/360. Covers the replay draw and hover readout, no 2D context, empty frames, a missing rate, a flat signal, an all-NaN signal, and the cursor at the end of a pass. The tests don't assert time-of-day strings, so they hold up under feat(settings): 24-hour time format, stored on the pod #788.
  • ThermalBed/thermalScene.ts: 259/266 → 266/266. Covers pill placement in the overview, a theme flip with no reading yet, a class change that leaves the theme as it was, and orbit-drag redraws. Also adds tests for ThermalCanvas mount failure, ThermalBedCard with a stored surface, heating and unfocus, and the thermalData invalid timestamp and legend.
  • Base/BasePage.tsx: 88/93 → 93/93. BaseSchedules.tsx: 35/39 → 39/39. Also BedView3D, bedLook, bedOrbit, and a new controls.test.tsx for the storage-denied preference.
  • TempScreen/TempScreen.tsx: every patch line is now covered: the sleeper-line variants, the return date, and the Thermal view and Stage toggles.
  • Settings/SideSettingsForm.tsx: the return date's local display, clearing it, and a blur with no change. AppearanceSettings camera-return toggle. BedSetupSettings refresh after save.

Review notes (not fixed here, larger or judgment calls)

  • dacTransport.ts sendCommand waits through a whole reconnect cycle while holding the side lock.
  • snoozeManager.ts drops a snoozed alarm when setAlarm fails.
  • jobManager.ts keeps the held power-off after an alarm only in memory, so a restart loses it.
  • autoOffWatcher.ts doesn't account for the follow mirror zone.
  • device.ts setPower(on) releases the held power-off before the power-on command succeeds.
  • dacMonitor.instance.ts has a race between the onServerFrame subscription and shutdown.

Test plan

🤖 Generated with Claude Code

🛏️ Beam this PR onto a sleepypod ✨

Pick the snippet that matches your pod. Already-installed pods can't use the curl bootstraps below — sleepypod's egress firewall DROPs github.com, and the script that knows how to unblock WAN is the very file curl is trying to fetch. Use sp-update instead; it's on disk and opens WAN as its first step.

🔄 Already on a sleepypod (most common — review a PR on a running pod):

sudo sp-update test/release-783-coverage

🚀 Fresh pod / first install — bootstraps from GitHub, rebuilds every push:

curl -fsSL https://raw.githubusercontent.com/sleepypod/core/test/release-783-coverage/scripts/install \
  | sudo bash -s -- --branch test/release-783-coverage

🎯 Pin to this exact build (run 37728557461 · 5ef5fd9) — fresh-pod path, locked to one CI artifact for reproducible review:

curl -fsSL https://raw.githubusercontent.com/sleepypod/core/5ef5fd9f01cc3187398dcd65440e699515a40048/scripts/install \
  | sudo bash -s -- \
      --branch test/release-783-coverage \
      --artifact-url 'https://nightly.link/sleepypod/core/actions/runs/37728557461/sleepypod-core.zip'

🧊 Artifact: sleepypod-core · self-destructs in 30 days 💥

@vercel

vercel Bot commented Oct 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sleepypod-demo Ignored Ignored Oct 8, 2026 4:39am UTC

@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc132b56-ae22-4c25-919a-23374033425a
📥 Commits

Reviewing files that changed from the base of the PR and between d6e8806 and 5ef5fd9.

📒 Files selected for processing (21)
  • src/components/Base/tests/BasePage.test.tsx
  • src/components/Base/tests/BaseSchedules.test.tsx
  • src/components/Base/tests/BedView3D.test.tsx
  • src/components/Base/tests/bedLook.test.ts
  • src/components/Base/tests/bedOrbit.test.ts
  • src/components/Base/tests/controls.test.tsx
  • src/components/Sensors/tests/PiezoWaveform.test.tsx
  • src/components/Settings/tests/AppearanceSettings.test.tsx
  • src/components/Settings/tests/BedSetupSettings.test.tsx
  • src/components/Settings/tests/SideSettingsForm.test.tsx
  • src/components/Stage/tests/StageTimeline.test.tsx
  • src/components/Stage/tests/TempStage.test.tsx
  • src/components/Stage/tests/heatTexture.test.ts
  • src/components/Stage/tests/stageScene.test.ts
  • src/components/TempScreen/tests/TempScreen.test.tsx
  • src/components/ThermalBed/tests/ThermalBedCard.test.tsx
  • src/components/ThermalBed/tests/ThermalCanvas.test.tsx
  • src/components/ThermalBed/tests/thermalData.test.ts
  • src/components/ThermalBed/tests/thermalScene.test.ts
  • src/hardware/gestureActionHandler.ts
  • src/hardware/tests/gestureActionHandler.test.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@ng
ng enabled auto-merge October 8, 2026 04:40
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@ng
ng added this pull request to the merge queue Oct 8, 2026
Merged via the queue into dev with commit c7fbe0c Oct 8, 2026
9 checks passed
@ng
ng deleted the test/release-783-coverage branch October 8, 2026 04:48
ng added a commit that referenced this pull request Oct 8, 2026
…tions, 3D temperature Stage and experimental Base (#783)

Promote `dev` to `main`: power-off and alarm fixes, hardware recovery and diagnostics, a 24-hour time option, keeping temperature after a schedule ends, a 3D temperature Stage, hosted demo mode, and experimental adjustable-base controls.

OFF now clears the side's active firmware timer before resetting its temperature level, and reports a failure if the timer cannot be cleared (#713). This addresses the hub continuing to regulate after OFF.

## Release scope

- **Alarms:** fix snooze, the wake window and warm-up (#766, #779). A snooze is no longer lost when the firmware write that confirms a tap fails (#790).
- **Hardware:** DAC connections recover after firmware restarts (#782); pump stalls are no longer reported falsely during startup (#786); the installer separates socket discovery from hardware identity (#785).
- **Settings:** a pod-wide 12-hour / 24-hour time format, used by every clock, chart and time editor (#788). Solo bed setup is now separate from partner away mode (#767).
- **Schedules:** "After schedule ends" can keep the final temperature instead of turning the Pod off. There is a device default and a per-curve choice, and the setting is available over REST/tRPC and MCP (#789).
- **Temperature:** a 3D thermal bed, a temperature Stage view and a sweep-mode piezo waveform (#787).
- **Performance and diagnostics:** piezo vitals are suppressed while the bed reads empty; the temperature controller does less work; the firmware probe is cached; V8 and native memory counters are reported (#768, #772, #770, #773).
- **Demo:** a hosted demo mode (#765, #781).
- **Base (experimental):** controls, presets, schedules and a 3D bed view with a 2D fallback (#780, #784). Physical movement is unverified, and independent per-side movement stays locked until the firmware is validated.
- **Tests:** coverage for the Stage, ThermalBed, Base and piezo views (#790), plus automation and sensor-stream tests.

**Database migrations:**
- `0017_majestic_enchantress`
- `0018_amazing_captain_marvel`
- `0019_closed_psynapse`
- `0020_mature_puff_adder`: schedule end action, which defaults to `turn_off`
- `0021_device_time_format`: `time_format`, which defaults to `12h`

The iOS companion change for end actions is sleepypod/ios#51. It should be merged after this deploy.
ng added a commit to ng/core that referenced this pull request Oct 10, 2026
…s and activity on its timeline (sleepypod#793)

## Summary

Follow-up to sleepypod#787. The Temperature screen now opens on the 3D Stage, and
the old timeline's information moves into the Stage.

- **Stage is the default view.** `temp.view` defaults to `stage`. A
**Cards | Stage** segmented switch (`ViewSwitch`) replaces the Thermal
view and Stage buttons, so the choice reads as a mode, not an action,
and the choice is remembered.
- **Stage timeline carries the old timeline's detail.** Both schedule
curves are coloured by temperature tone (left solid, right dashed). A
dot marks the next set point, and a dashed line marks neutral. Each side
gets rows for powered and in-bed stretches, with schedule mismatches
bracketed ("bed empty while warming · 1h 0m", "in bed 20m past
schedule").
- **Power bar stops at now.** Thermal-history buckets are widened by
half a bucket on each side. Without a cap, the last powered stretch
could draw up to half a bucket past the now marker.
- **ThermalBedCard removed.** The Stage replaces the thermal card on the
Temp screen, and so does the pod-health pill in the Stage header.
- **Merged with dev.** The 24-hour time setting (sleepypod#788) now runs through
the reworked Stage timeline: now and preview labels, hour ticks, and
activity tooltips. The tests sleepypod#790 added for the removed Thermal view
toggle and health pill are gone.

## Test plan

- [x] `tsc --noEmit` clean
- [x] `vitest run`: 317 files, 5532 passed
- [x] `eslint` clean on the changed files
- [x] Deployed `c9a10f5` to Pod 5 (`eight-pod`): the Temp screen opens
on the Stage, and Cards | Stage switches and is remembered across
reloads
- [ ] On the pod, the timeline shows power and in-bed rows per side, and
the powered bar ends at the now marker
- [ ] Switching Settings → 24-hour time changes the Stage now marker,
preview pill and hour ticks to `HH:MM`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- sleepypod:install-start -->
<!-- 🛑 AUTO-GENERATED — sleepypod-bot owns this block.
     Hello fellow agent / curious human! Anything between the
     sleepypod:install-start and sleepypod:install-end markers
     gets overwritten on the next CI run. Want to change what's
     here? Edit .github/workflows/build.yml instead. 💤 -->
<details open>
<summary>🛏️ <strong>Beam this PR onto a sleepypod</strong> ✨</summary>

Pick the snippet that matches your pod. **Already-installed pods can't
use the curl bootstraps below** — sleepypod's egress firewall DROPs
github.com, and the script that knows how to unblock WAN is the very
file curl is trying to fetch. Use `sp-update` instead; it's on disk and
opens WAN as its first step.

🔄 **Already on a sleepypod** (most common — review a PR on a running
pod):
```bash
sudo sp-update feat/bed-temperature-3d
```

🚀 **Fresh pod / first install** — bootstraps from GitHub, rebuilds every
push:
```bash
curl -fsSL https://raw.githubusercontent.com/sleepypod/core/feat/bed-temperature-3d/scripts/install \
  | sudo bash -s -- --branch feat/bed-temperature-3d
```

🎯 **Pin to this exact build** ([run
37838347527](https://github.com/sleepypod/core/actions/runs/37838347527)
· `75ff47d`) — fresh-pod path, locked to one CI artifact for
reproducible review:
```bash
curl -fsSL https://raw.githubusercontent.com/sleepypod/core/75ff47d77e421e571c3dc0e3d3034caac707ed0f/scripts/install \
  | sudo bash -s -- \
      --branch feat/bed-temperature-3d \
      --artifact-url 'https://nightly.link/sleepypod/core/actions/runs/37838347527/sleepypod-core.zip'
```

🧊 Artifact:
[`sleepypod-core`](https://github.com/sleepypod/core/actions/runs/37838347527/artifacts/11577060977)
· self-destructs in 30 days 💥
</details>

<!-- sleepypod:install-end -->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added a switch between Cards and Stage views, with the selection saved
for future visits. Press **V** to switch from Cards to Stage; keyboard
shortcuts are ignored while editing text.
* Expanded the Stage timeline with temperature trends, time markers, and
available power, in-bed, and schedule-mismatch activity.
* The stepper view now displays the temperature and time-of-day
backdrop.
* **Changes**
  * Removed the thermal-bed card from the Cards view.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant