Skip to content

feat(plan): say what happens now when it is not the plan - #119

Merged
frahlg merged 2 commits into
mainfrom
feat/plan-vs-now
Nov 8, 2026
Merged

frahlg merged 2 commits into
mainfrom
feat/plan-vs-now

Conversation

@frahlg

@frahlg frahlg commented Nov 8, 2026

Copy link
Copy Markdown
Member

Problem

On 8 November 2026 the battery discharged while the plan meant to charge it, because the sun gave 1.4 kW against a forecast of 3.8 kW. The Plan screen's headline said "The battery is charging", the Now card said "Charge battery" and a control row said "as planned".

Change

Paired with srcfl/ftw#1983, which adds plan_now and on_plan to GET /api/status. Core decides; this only words it. Merge after #1983.

  • control-feedback.js is re-copied from srcfl/ftw for planNowWords, with its digest re-recorded. The header names branch commit ed341192; re-stamp it once #1983 lands.
  • Plan screen: the headline says what the battery does, what the plan said and why. It reads /api/status every 10 s while visible.
  • Now card: "Not as planned / Now: discharging 1.2 kW / The plan said: charge 2.6 kW / The sun gives 1.4 kW; the forecast said 3.8 kW. The battery covers the home, so you buy less."
  • "As planned" appears only when the box says so. A box without plan_now shows the plan as before.

Evidence

  • npm run verify under heavy machine load: 1263 passed, 2 skipped; 4 failed, all in Energy.svelte.test.ts with chart timing, and that file passes 10/10 three times alone. CI will show it on an idle runner. The entry bundle is within budget in the earlier run.
  • vite in a browser at phone width with plan_now forced in the simulator (not committed): the Plan headline and the Now card read as above, with no console errors.

🤖 Generated with Claude Code

The plan's headline said "The battery is charging" and the card said
"Charge battery" over a battery that discharged. A control row said
"as planned" for any battery in a planner mode.

The box now says whether the batteries follow this quarter's plan and
why not. The Plan screen and the Now card say what the battery does,
what the plan said and the reason. control-feedback.js is re-copied from
srcfl/ftw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T10:15:07.005694Z 28255fa PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ftw-webapp 4ea78ce Commit Preview URL

Branch Preview URL
Nov 08 2026, 10:29 AM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28255fa700

ℹ️ 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".

Comment thread src/views/Plan.svelte
Comment on lines +86 to +87
const askPlanNow = $derived(site.documentVisible &&
site.session.phase === 'streaming' && site.session.caps.has(CAP_API_PASSTHROUGH))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Stop status polling when the Plan tab is hidden

After the user first opens Plan, this poller continues requesting /api/status every 10 seconds even after they switch tabs. src/App.svelte retains visited views and hides them with hidden={displayedRoute !== 'plan'}, so site.documentVisible only detects a backgrounded document, not an inactive Plan view. Returning to Now therefore runs this poller alongside Now's existing status watcher, and other tabs acquire unnecessary continuous box requests. Pass an active-view flag into Plan and include it in askPlanNow, as Now already does.

Useful? React with 👍 / 👎.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frahlg
frahlg merged commit 6f753b8 into main Nov 8, 2026
3 checks passed
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