feat(ev): set the charging schedule from the phone, weekdays and all - #20
Conversation
The other half of srcfl/ftw#869. The box gave the schedule its own Configure-priced door; this teaches the panel to use it. - The schedule row grows a pen for owners: ready-by time on the kitchen clock, seven weekday chips (a zero mask is every day, so an untouched week reads all-on), and the target charge. One draft, one PUT, one passkey ceremony — never a prompt per field. - Nothing applies optimistically: the box answers, the panel rereads, and until then the old schedule stands as the truth it is. A failed ceremony says what happened and changes nothing. - Viewers see the schedule and never the pen; the box would refuse them anyway, and the hidden button is presentation on top of that refusal. - The simulator serves the new route at the box's own price, stores what it is handed, and serves absence after a DELETE — so the tests meet a mutable schedule, not an echo. - daysWord says the mask the way a person does: weekdays, weekends, every day, or the short names in week order. Against a box without the route, the pen meets "Your box doesn't have that yet" — the sentence that already exists for exactly this. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
ftw-webapp | 67da22a | Aug 09 2026, 03:59 PM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a79adb45d
ℹ️ 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".
| function toggleDay(bit: number): void { | ||
| if (draft) draft.days ^= 1 << bit |
There was a problem hiding this comment.
Expand the all-days sentinel before toggling a day
When draft.days is zero, all seven chips are rendered as pressed, but clicking a pressed chip XORs against zero: clicking Sat produces 32, which means Saturday-only rather than every day except Saturday. Consequently, the natural sequence of clicking Sat and Sun to select weekdays instead saves weekends, potentially charging on the opposite days intended; normalize zero to 0x7f before clearing the selected bit.
Useful? React with 👍 / 👎.
The draft now holds all seven bits where the wire holds zero, so the chips read as they act; all-seven canonicalises back to the wire's zero on save, and a week with every day off cannot be saved at all — the wire would have read it as its opposite. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The app half of srcfl/ftw#869 (merged; ships in v1.16.1-beta.11). The box gave the charging schedule its own Configure-priced route; this teaches the EV panel to use it.
The pen, for owners only. The schedule row gets a Change button (and "Set a charging schedule" where none exists): ready-by time on the kitchen clock, seven weekday chips — a zero mask means every day, so an untouched week honestly reads all-on — and the target charge. One draft, one PUT, one passkey ceremony, never a prompt per field. Remove sits beside Cancel when there is something to remove.
Nothing optimistic. The box answers, the panel rereads from
/api/loadpoints, and until then the old schedule stands on screen as the truth it is. A failed ceremony says what happened ("Nothing was changed") and cancels back to exactly the schedule that was. Viewers see the schedule and never the pen — presentation on top of the box's refusal, not instead of it.The simulator plays the new box.
PUT/DELETE /api/loadpoints/{id}/scheduleat Configure with the box's own validation (0..1439 minutes, 7-bit mask), a stored mutable schedule, and honest absence after DELETE — so the tests meet state, not an echo. Against a real box without the route, the pen meets the existing "Your box doesn't have that yet" sentence.daysWordrenders the mask the way a person says it: weekdays, weekends, every day, or the short names in week order. Conversions between the kitchen clock and the wire's UTC minutes live in one module with a round-trip test that passes in any zone — CI deliberately pins none.Verified: full
npm run verifygreen (763 tests — 18 new), and the editor exercised in a browser against the simulator.🤖 Generated with Claude Code