Harden Meta publish against dirty captions and IG duplicates.

Strip production notes before posting, persist each network id immediately, refuse IG republish if delete fails, and place FB photos via feed for better timeline visibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4Ventures
2026-10-08 17:17:07 +02:00
parent 67969b12cb
commit 025fc85175
6 changed files with 368 additions and 120 deletions

View File

@@ -29,6 +29,7 @@ import {
mapPipelineFormatToCalendar,
scheduledAtFromPiece,
} from '@/lib/calendar-documents';
import { captionHasProductionNoise } from '@/lib/publish-caption';
type CalendarOption = {
id: string;
@@ -1006,6 +1007,12 @@ export default function CreativePipelineBoard() {
className="mt-1 w-full rounded-lg border border-gray-200 px-3 py-2 text-sm"
placeholder="Texto completo del anuncio"
/>
{captionHasProductionNoise(newCaption) && (
<p className="mt-1 text-[11px] text-amber-800 bg-amber-50 border border-amber-200 rounded-lg px-2 py-1.5">
Detectadas notas internas (WhatsApp, PENDIENTE, nombres de
archivo…). Se quitarán al publicar; no las dejes en el copy.
</p>
)}
</div>
<div className="sm:col-span-2 lg:col-span-3">
@@ -1788,6 +1795,12 @@ function DetailModal({
className="w-full rounded-xl border border-gray-200 bg-white p-3 text-xs text-gray-800 leading-relaxed"
placeholder="Copy del anuncio"
/>
{captionHasProductionNoise(editCaption) && (
<p className="text-[11px] text-amber-800 bg-amber-50 border border-amber-200 rounded-lg px-2 py-1.5">
Notas internas detectadas (archivos WhatsApp, PENDIENTE,
assignee…). Se eliminan al publicar / actualizar en redes.
</p>
)}
<div className="grid grid-cols-2 gap-2">
<label className="block text-[11px] text-gray-600">
Fecha plan