Fix generation quality warning handling#38
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c512dee3a
ℹ️ 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".
| headline: String(editable.headline || originalPlanAsset.headline), | ||
| subheadline: String(editable.subheadline || originalPlanAsset.subheadline), | ||
| callouts: Array.isArray(editable.callouts) ? editable.callouts.map(String).slice(0, 3) : originalPlanAsset.callouts, | ||
| cta: "Try Talocode LaunchPix", |
There was a problem hiding this comment.
Use the actual plan CTA in rerender quality checks
When rerendering through the Mistral path, the generated prompt still places generation.copy_json.cta_line in the asset, but the refreshed quality_report is computed against the hard-coded "Try Talocode LaunchPix" here. For existing or imported generations whose plan CTA is empty or longer than the 28-character quality limit, a successful rerender will persist a passing CTA report even though the new image was rendered with the problematic CTA, so the warning/error can incorrectly disappear instead of reflecting the current output.
Useful? React with 👍 / 👎.
| const screenshotById = new Map(uploads.map((upload: any) => [upload.id, upload.file_url])); | ||
| const screenshotUrls = originalPlanAsset.screenshot_ids.map((id) => screenshotById.get(id)).filter(Boolean) as string[]; | ||
|
|
||
| qualityReport = runAssetQualityChecks({ |
There was a problem hiding this comment.
Reject rerenders that fail error-level quality checks
This computes a qualityReport, but the POST path never checks qualityReport.pass before rendering, uploading, and returning success. When an edit introduces an error-level issue such as a headline over 65 characters or missing screenshots, the initial generation path would block that asset, while rerender now saves a potentially clipped/broken image; the assets UI only surfaces warning-severity entries, so the user can see a successful rerender with no actionable quality message.
Useful? React with 👍 / 👎.
Summary\n- Add a shared quality warning detail type in the generation runner\n- Persist refreshed quality reports during asset rerenders so resolved warnings do not linger\n- Keep rerender metadata aligned with the current editable values\n\n## Verification\n- npm run build