Skip to content

Fix AI prompt wiring, asset generation flow, and signup trigger#8

Merged
jadru merged 2 commits into
mainfrom
ai-style-generation-fix
Mar 10, 2026
Merged

Fix AI prompt wiring, asset generation flow, and signup trigger#8
jadru merged 2 commits into
mainfrom
ai-style-generation-fix

Conversation

@jadru

@jadru jadru commented Mar 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • wire headline and OG prompt generation through the new structured prompt config pipeline
  • fix the wizard asset-generation flow so preview advances correctly and duplicate generation requests are blocked client/server side
  • generate and layer current Supabase types, and fix the auth signup trigger to populate public.users from auth.users.email

Verification

  • yarn tsc --noEmit
  • yarn vitest run tests/lib/ai/prompt-config.test.ts
  • yarn build
  • applied Supabase migrations through 013_fix_handle_new_user_email.sql and verified remote migration alignment
  • browser smoke: headline generation + asset generation completed with exactly one /api/assets/generate request
  • signup trigger verification: public signup and admin create both create matching public.users rows; auth.users / public.users mismatch query returned zero rows

@vercel

vercel Bot commented Mar 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
brand-kit Ready Ready Preview, Comment Mar 10, 2026 9:03am

@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: 10c36de9f5

ℹ️ 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 on lines +183 to 185
const initialStatus = await pollStatus()
if (initialStatus === 'completed' || initialStatus === 'failed') return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow regeneration when status is already completed

startGeneration now exits immediately when the first status poll returns completed, which prevents the subsequent /api/assets/generate call from ever being sent. In the current UI, the preview screen always exposes a retry/regenerate action, so retrying a previously completed project will no longer trigger a new generation and will silently keep the old assets.

Useful? React with 👍 / 👎.

Comment on lines +49 to +53
const { data: startedProject, error: startError } = await supabase
.from('projects')
.update({ status: 'generating', pipeline_stage: 'icon_resolve' })
.eq('id', projectId)
.eq('user_id', user.id)

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 Move generating status update after prerequisite checks

The project is marked status='generating' before validating dependent records (for example, the style preset lookup just below). If that lookup fails (missing/deleted preset or query error), the handler throws before entering the pipeline try/catch that resets status, leaving the row stuck as generating; later generate attempts then return ASSET_GENERATION_IN_PROGRESS even though no pipeline is running.

Useful? React with 👍 / 👎.

@jadru
jadru merged commit 6c0fc7d into main Mar 10, 2026
6 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