feat: notify when a device is down, and restart the box from the phone - #56
Conversation
Two lock-screen kinds join the catalogue — a device gone quiet, and the house drawing more than the fuse — and the Box screen can restart FTW so a stuck driver does not need Termius from work. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
The public demo still cannot turn notifications on, but the sentence should name the same events a real home can now hear. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ftw-webapp | 2554794 | Commit Preview URL Branch Preview URL |
Aug 26 2026, 06:19 PM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2554794289
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 'driver.offline', | ||
| 'fuse.over_limit', |
There was a problem hiding this comment.
Hide notification kinds absent from the box document
On an existing subscription connected to an older box whose rules document lacks these new kinds, Notifications.svelte still iterates every entry in RULE_KINDS, so both unsupported toggles are displayed. Although NotifyStore.#writeRules correctly filters them out before sending, it then applies the returned document and silently resets the toggles to off after Save, leaving users with controls that can never take effect. Derive the displayed kinds from the types present in the loaded rules document.
Useful? React with 👍 / 👎.
| error = null | ||
| stage = 'restarting' | ||
| try { | ||
| await callBox<{ status?: unknown }>(site, { method: 'POST', path: '/api/restart' }) |
There was a problem hiding this comment.
Clear the restarting state once reconnection completes
After the restart request returns 202, no success path ever changes stage from restarting. App.svelte keeps previously opened views mounted even while navigating between tabs, so the automatic disconnect/reconnect does not recreate this component; the Box screen consequently says “Restarting” for the rest of the app session and permanently suppresses another restart attempt. Observe the session returning to streaming, or otherwise reset the stage after reconnection.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2554794. Configure here.
| <p> | ||
| A few words on the lock screen when something at home matters: the car is | ||
| charged, your box updated itself, or it went quiet. Nothing is sent until | ||
| charged, a device goes quiet, or the box itself. Nothing is sent until |
There was a problem hiding this comment.
Broken notifications intro copy
Medium Severity
The offline notifications teaser ends with or the box itself, which is an incomplete phrase. Readers never learn what happens with the box, unlike the parallel DemoBox sentence that finishes the idea.
Reviewed by Cursor Bugbot for commit 2554794. Configure here.
| <p> | ||
| A few words on the lock screen when something at home matters: the car is | ||
| charged, your box updated itself, or it went quiet. Nothing is sent until | ||
| charged, a device goes quiet, or the box itself. Nothing is sent until |
There was a problem hiding this comment.
Extra toggles on older boxes
Medium Severity
The kinds list always renders every RULE_KINDS entry, including driver.offline and fuse.over_limit, even when those types are absent from the box’s rules document. A save correctly omits missing kinds, so those toggles can appear, be flipped, and then snap back off after save.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 2554794. Configure here.
miravoss26
left a comment
There was a problem hiding this comment.
Reviewed the diff. This adds a manual box-restart control to the phone app (owner-only, step-up gated, confirm-before-send) plus two new lock-screen notification kinds (driver.offline, fuse.over_limit) mirroring the existing ntfy rules.
- Authz:
Restart.svelteonly renders whensite.heardFromBox && canAsk(owner role +api.passthroughcap), tested for the viewer role showing nothing and no box connection showing nothing. - Safety: restart is gated behind a confirm step and a step-up ceremony before
POST /api/restartfires; a stray tap on the confirm screen doesn't restart (tested). - Consistency: the two new push kinds are threaded through
push-catalogue.yaml,kinds.ts, and the sim API'sRULE_TYPEStogether — nothing half-wired. - CI green (registry-drift check, verify, Cursor security/bugbot all pass).
No blocking findings. Safe to merge from my read.




Contract-pair: srcfl/ftw@cursor/push-driver-down-0d20
What changed
The phone app can now hear two more facts from the box, and it can restart the box from the Box screen.
Notifications (paired catalogue with the box):
driver.offline— “If a device goes quiet”fuse.over_limit— “If the house draws more than the fuse allows”Turning notifications on enables the new kinds with the rest. An existing subscription sees two new toggles, off until saved.
box.unreachablestill has no switch.Restart (already
POST /api/restarton the box, Configure):Why
Hannes had to use Termius/Tailscale from work when a driver stuck, and there was no lock-screen for a driver being down. Fredrik asked for both while we were on the Pixii blip.
Boundaries
Verification
svelte-check: 0 errors. Production build succeeded.verifypassed on Node 24.box_notifications_and_restart.mp4
Box screen with notifications and restart
Restart confirmation
Phone-width Box screen
Checklist
To show artifacts inline, enable in settings.