Skip to content

Recreate now edits the website instead of building a new one - #122

Merged
ehsan6sha merged 1 commit into
mainfrom
fix/web-recreate-edits-site
Sep 10, 2026
Merged

Recreate now edits the website instead of building a new one#122
ehsan6sha merged 1 commit into
mainfrom
fix/web-recreate-edits-site

Conversation

@ehsan6sha

Copy link
Copy Markdown
Member

The bug

Recreate is meant for change this one thing about my site. On the web app it produced a completely different website every time — different layout, different wording, different palette.

It was an ordinary from-scratch generation. The previous site's HTML/CSS/JS was never sent anywhere; the only continuity was a sentence seeded into the prompt box:

The website "<url>" was created for prompt: "<body>"

[Describe what to change or add for the new version]

The generator read that as a fresh brief — correctly, since that is all it was — and designed a new site.

The fix

The link is now structural instead of textual. Recreate sends base_cid, the build being edited, and the server revises that site's own source, so anything the user does not ask about comes back untouched. Server side: functionland/pinning-service#89.

The generator screen gains a revision mode. It leads with the only question that matters — What should change? — starting empty. The creative direction below it comes back verbatim; the seeded preamble is gone. The remaining fields are presented as how this site was built, adjustable rather than a fresh brief.

Leaving the change field empty is a real answer. The server honours it literally: it returns the site the user already has, instantly and free, without running the model at all. No history entry is written for a build that did not happen — the user gets "No changes described — your website is unchanged."

Capability is checked before the user invests any effort, via supportsRevision on /pricing. The generate endpoint ignores unknown fields, so a server without this feature would accept the job, charge for it, and return a redesign — asking afterwards is too late. Until the AI service deploys, Recreate says so plainly and submits nothing.

A site generated before the server kept its source is explained, not silently redesigned: "created before editing was supported — use Create Website to build a new one." Asking for no change still works on those sites, which is every site that exists today.

A Sheets contact form is no longer recreated on every Recreate. It used to mint a brand-new Google Form each time — abandoning the responses collected so far, changing the iframe URL in the page, and (because the responder URL is part of the stored prompt) making every edit look like a settings change, so a site with a Google form could never be left unchanged. Now an unchanged form spec keeps its existing form. Pre-existing bug, surfaced by this work.

Testing

web_website_generate_logic carries the request/response decisions (repo convention: services keep the I/O, logic files keep the decisions) with 12 tests: base_cid is sent when editing and absent when building fresh, an empty change request is still sent (it means "change nothing"), and a 200 unchanged is not mistaken for a failure.

  • flutter analyze — 0 errors, 177 issues (byte-identical to the pre-change baseline)
  • flutter test — 1051 pass
  • flutter build web --release — succeeds (the exact CI command)

A widget test for the screen was written and dropped: it pulls in package:web through the service and cannot compile on the VM test platform, which is why no web screen has one in this repo.

Scope

Native Recreate (features/websites/screens/website_detail_screen.dart) still regenerates from scratch — it has the same duplicated seed logic and would need the same treatment. Flagged as a follow-up rather than changed blind.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AwMWmCivEpYTmmzzmjSTAf

Recreate is meant for "change this one thing about my site". It produced
a completely different site every time, because it was an ordinary
from-scratch generation: the previous site's HTML/CSS/JS was never sent
anywhere, and the only continuity was a sentence seeded into the prompt
box -

  The website "<url>" was created for prompt: "<body>"
  [Describe what to change or add for the new version]

which the generator quite reasonably read as a fresh brief.

The link is now structural instead of textual. Recreate sends base_cid -
the build being edited - and the server revises that site's own source,
so anything the user does not ask about comes back untouched.

- The generator screen gains a revision mode: it leads with "What should
  change?", empty, and the creative direction below comes back VERBATIM
  with no seeded preamble. Leaving the field empty is a real answer, and
  the server honours it literally - it returns the site the user already
  has, instantly and free, without running the model at all. There is no
  new history entry for a build that did not happen.
- Capability is checked BEFORE the user invests any effort, via
  supportsRevision on /pricing. The generate endpoint ignores unknown
  fields, so a server without this feature would accept the job, charge
  for it, and return a redesign; asking afterwards would be too late.
  Until the AI service ships, Recreate says so plainly.
- A site generated before the server kept its source is explained rather
  than silently redesigned ("created before editing was supported - use
  Create Website"). Asking for no change still works on those sites.
- A Sheets contact form is no longer recreated on every Recreate. It used
  to mint a new Google Form each time, abandoning collected responses and
  changing the responder URL - which is part of the stored prompt, so a
  site with a Google form could never be left unchanged.

The request body and response handling move into web_website_generate_logic
(repo convention: services keep the I/O, logic files keep the decisions)
with 12 tests covering that base_cid is sent when editing, absent when
building fresh, and that "nothing changed" is not mistaken for a failure.
Native Recreate is unchanged and still regenerates - follow-up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AwMWmCivEpYTmmzzmjSTAf
@ehsan6sha
ehsan6sha merged commit 6b2773d into main Sep 10, 2026
2 of 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