Skip to content

fix(base): prevent 2D fallback flicker during 3D loading - #784

Merged
ng merged 2 commits into
devfrom
fix/base-loading-flicker
Oct 6, 2026
Merged

ng merged 2 commits into
devfrom
fix/base-loading-flicker

Conversation

@ng

@ng ng commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Opening Base briefly showed the 2D bed before the first 3D frame. Keep the existing bed viewport as a neutral loading surface until 3D is ready, and render 2D only when explicitly selected, WebGL is unavailable, or the renderer fails.

Regression tests cover library loading, first-frame readiness, renderer failure, unsupported WebGL, and the saved 2D preference. The viewport dimensions and measured-angle readouts remain stable.

Summary by CodeRabbit

  • Improvements
    • The 3D bed view now displays a loading status while the 3D view initializes, rather than showing the 2D view during loading.
    • If 3D rendering is unavailable or fails to load, the 2D view remains available without a loading status.
    • When simple view is selected, the 2D view appears directly without a 3D loading status.
🛏️ 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 fix/base-loading-flicker

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

curl -fsSL https://raw.githubusercontent.com/sleepypod/core/fix/base-loading-flicker/scripts/install \
  | sudo bash -s -- --branch fix/base-loading-flicker

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

curl -fsSL https://raw.githubusercontent.com/sleepypod/core/475ae8e99d9c492809441219c2e434796f5ef7ee/scripts/install \
  | sudo bash -s -- \
      --branch fix/base-loading-flicker \
      --artifact-url 'https://nightly.link/sleepypod/core/actions/runs/37487423668/sleepypod-core.zip'

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

@vercel

vercel Bot commented Oct 6, 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 6, 2026 3:25pm UTC

@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2540a71e-150d-4d66-9535-4f490df28098
📥 Commits

Reviewing files that changed from the base of the PR and between 4d15c84 and 475ae8e.

📒 Files selected for processing (3)
  • src/components/Base/BedView.tsx
  • src/components/Base/tests/BasePage.test.tsx
  • src/components/Base/tests/BedView.test.tsx
 _________________________________________________________
< Your config has more knobs than a 2004 Honda dashboard. >
 ---------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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 6, 2026 15:28
@codecov

codecov Bot commented Oct 6, 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 6, 2026
Merged via the queue into dev with commit 0e8e51e Oct 6, 2026
8 of 9 checks passed
@ng
ng deleted the fix/base-loading-flicker branch October 6, 2026 15:35
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.
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