Skip to content

Rebuild the home page around savings, the planner, AI and the app - #33

Merged
frahlg merged 2 commits into
mainfrom
web/clearer-story
Oct 30, 2026
Merged

frahlg merged 2 commits into
mainfrom
web/clearer-story

Conversation

@frahlg

@frahlg frahlg commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Problem

The home page did not say what FTW saves or how the planner works. It named only ChatGPT, though the FTW plugin already works in Claude, Grok, Cursor and Codex. Its app pictures came from an older build. It had no way to join a list for the Sourceful Energy Gateways we want to sell, no newsletter, and Discord was a small link.

What changes

The page now follows the iPhone app's Phosphor look (dark ground, ink interface, one colour per kind of energy, from ftw-app's Theme.xcassets) and runs in seven parts:

  1. Hero: "Your home's energy, planned to cost less", with a recording of the app's Now ring.
  2. Savings: an example day you can switch between Charge at plug-in and With the FTW plan. The same simulated home goes from 77.77 to 50.40 kr, mostly by charging the car at night. The baseline is ordinary self-consumption control, as VISION asks, and both runs end with the battery about 95 % full. The page labels it an example and not a measured result.
  3. Planner: inputs → Energyplan → Core's checks → the SENT ▸ ACCEPTED ▸ MEASURED ▸ CONFIRMED receipt, with the example day drawn as the app's plan dial.
  4. AI: one MCP address with a copy button and setup steps for Claude, ChatGPT, Grok, Cursor, Claude Code and Codex, taken from srcfl/ftw-plugin's README. An example chat matches the example day. ChatGPT is marked as waiting for its directory listing.
  5. App: a tour of real demo screens (Now, Plan, Car, History, Price) from ftw-app 95af454 on an iPhone 17 Pro simulator.
  6. Get FTW: a waitlist for Sourceful Energy Gateways (Raspberry Pi 4) set up for FTW, next to the Home Assistant and Linux paths. No price or date is promised.
  7. News with a newsletter sign-up, and a larger Discord block with the English and Swedish invites.

Both forms post to /api/signup in _worker.js. It takes same-origin JSON only, checks the address, list and country, ignores a filled hidden field, and gives the same answer for a new and a known address. Rows go to a new D1 binding, SIGNUPS_DB (signups.sql), kept apart from the anonymous FUTURE_DB votes. Each row records a consent version that the new privacy#email section describes, in English and Swedish. Motion respects Reduce Motion.

Before this goes live

  • D1 database ftw-signups (32851378-602c-4b71-b3ea-69e85acff569) created in the EU jurisdiction, signups.sql applied, bound to the Pages project as SIGNUPS_DB for production and preview next to FUTURE_DB. No other project setting changed.
  • Name the email service in the privacy notice before the first newsletter or waitlist email.
  • Confirm the gateway copy: "built on the Raspberry Pi 4", "set up for FTW", price and shipping in the first email.

Evidence

  • node --test tests/*.test.mjs: 32 passed, 0 failed. New: tests/signups.test.mjs (storage, normalising, duplicates, bad input, origin, honeypot, missing binding) and tests/savings-model.test.mjs (energy balance each hour, battery limits, car energy and deadline, equal ending storage, page numbers match the model).
  • Browser, on a local server that runs the real worker against an in-memory D1 stand-in: desktop at 1440 × 900 and phone at 375 × 812. No console errors. No sideways scroll on the phone. The chart toggles, the dial turns, the tabs and copy buttons work, the tour advances, and the mobile menu opens. A waitlist sign-up stored [email protected], gateway, SE, gateway-2026-10-30; an invalid address was refused on the page.
  • Pages preview with the real database: a news and a gateway sign-up for a probe address stored two rows with the right list, country and consent; a mixed-case repeat matched the same address. The probe rows were deleted and the table is empty.
  • Not checked: Safari on a phone.

🤖 Generated with Claude Code

The home page now says plainly what FTW does for a household and how to
get it, in the iPhone app's Phosphor look.

- Savings: an example day compares the same simulated home with and
  without a plan. Charging the car at night and holding the battery for
  the peaks takes the day from 77.77 to 50.40 kr. savings-model.mjs holds
  the model; a test checks the energy balance, the battery limits, equal
  ending storage and that the page's numbers match. The page labels it an
  example, not a measured result.
- Planner: inputs, Energyplan, Core's checks and the command receipt, with
  the example day drawn as the app's plan dial.
- AI: one MCP address and setup steps for Claude, ChatGPT, Grok, Cursor,
  Claude Code and Codex, from srcfl/ftw-plugin, plus an example chat and
  the access rules.
- App: a recording of Now and real screens of Plan, Car, History and
  Price from the app's demo (ftw-app 95af454), shown as a tour.
- Get FTW: a waitlist for Sourceful Energy Gateways set up for FTW, next
  to Home Assistant and Linux installs.
- News with a newsletter sign-up, and a larger Discord block.

Both forms post to /api/signup in the Pages worker, which stores the
address, list, optional country and consent version in a separate D1
binding, SIGNUPS_DB. Without the binding it answers 503 and the forms
say sign-up is closed. The privacy notice, in English and Swedish,
describes the lists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T08:18:08.147687Z 7a0e4c3 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.

@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: 7a0e4c31b4

ℹ️ 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 index.html
<p class="stage-label">Waitlist · FTW box</p>
<h3>A box, ready to go.</h3>
<p>We have a stock of Sourceful Energy Gateways, built on the Raspberry Pi 4. We plan to sell them set up for FTW. Join the waitlist and we'll email you first when orders open, with the price and shipping.</p>
<form class="signup" data-list="gateway" novalidate>

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 Prevent native GET submission of signup addresses

When JavaScript is disabled or the module has not loaded, this form remains usable but defaults to a GET submission to the current page because it has neither method nor action. Submitting therefore puts the email address and country into the URL and browser history without actually registering the signup. The newsletter form has the same issue. Disable submission until the handler is installed, or provide a safe POST fallback, so an unavailable script cannot expose signup data in URLs.

Useful? React with 👍 / 👎.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying ftw with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3e6ce9c
Status: ✅  Deploy successful!
Preview URL: https://4db557d1.ftw-613.pages.dev
Branch Preview URL: https://web-clearer-story.ftw-613.pages.dev

View logs

@frahlg
frahlg merged commit e989b14 into main Oct 30, 2026
1 check passed
frahlg added a commit that referenced this pull request Oct 30, 2026
Fredrik liked the dark design from #33 better than the editorial reset
in #34, but not its generic look. This keeps the app's dark ground and
energy colours and drops what made it read as a template: no glows,
gradients, rounded cards, pill buttons, scroll fades or grey second
halves in headings.

The layout stays editorial: a label rail beside the text, ruled lists,
square corners, hairlines, underline form fields and the transcript.
Headings use weight, not colour, for their one stressed word. The
chart, plan dial and receipt use the app's energy colours, and the
savings rail shows the example day's prices as the app's block bars.
The page no longer loads sourceful.css; the other pages still do.

Co-authored-by: Claude Opus 5.5 <[email protected]>
@frahlg
frahlg deleted the web/clearer-story branch November 11, 2026 09:25
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