Native AI theme editor on /sites/[id] (feature 3/3)#8
Draft
gndclouds wants to merge 1 commit into
Draft
Conversation
Promotes the existing Anthropic-backed theme generator (previously admin-only, used once on site create) into a first-class native editor on the site settings page. Owners can iterate on their look by typing a prompt; the model returns colors + fonts, the tokens are written to the site, and a rebuild is queued — all in one round trip. Changes - src/app/api/sites/[id]/theme/ai/route.ts: owner-scoped POST. Reuses generateAiSiteTheme() but gates on the same plan rule as the existing /theme PUT (admin/friend/pro/studio). With `apply: true` (default) it writes themeColors/themeFonts and triggers buildSite() via after(). - src/components/site-ai-theme-box.tsx: prompt + apply UI, inline error + "Applied · rebuild queued" feedback, and a per-browser prompt history (localStorage, top 8) for iterative "the same, but darker" tweaks. No schema change in v1. - src/app/sites/[id]/page.tsx: drops the AI box above the existing theme.css / styles.css editor on the Theme tab, so users can describe a vibe and then nudge the result by hand. Template consolidation from docs/features.md is intentionally NOT in this PR — leaving the existing template surface in place for now. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
📝 Changed routes:
Commit c0a3138 (https://tiny-garden-58wk9rv8s-tiny-factories.vercel.app). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
![Screenshot of /sites/[id]](https://images.weserv.nl?url=https://sjc.microlink.io/-1efC_cpjxJ-DATOrqkutTSIXOKd2NwcE63FuMJfZPX2nPloJZlmJeTKNSMEbxnLm4oHB-aLfkawP_heKR4YiQ.png&w=600)
Summary
Promotes the existing Anthropic-backed theme generator — which today only runs once during admin site creation — into a first-class native editor on every site's settings page. Owners can describe the look they want, the model returns a cohesive color + font palette, the tokens are written to the site, and a rebuild is queued automatically.
This is feature 3 of 3 from `docs/features.md`. Template consolidation is intentionally not in this PR (per the decision to skip archiving for now); only the AI editor ships here.
This PR does not depend on PRs 1 / 2 — it branches straight off main and can ship independently.
What changed
Why this shape
Test plan
Open follow-ups (not in this PR)
Made with Cursor