From 465ba826e268d1dab7ec64d8cd54701616d86779 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Fri, 17 Jul 2026 07:25:12 +0000 Subject: [PATCH] ads: surface the Text Link size on the Monetize page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the native, full-width text-link ad to the publisher size picker. Unlike the banners, text_link predates the ad_slots.formats default, so a migration widens the default and backfills existing slots — otherwise serveAd() would gate it out and the copied embed would never fill. - lib/ads/formats.ts: add text_link to PUBLISHER_FORMAT_IDS - supabase/migrations: allow text_link on ad_slots.formats (+ backfill) Note: prod migration history has diverged, so this must be applied by hand via psql over the pooler (see the crawlproof-alerts runbook), not `supabase db push`. Co-Authored-By: Claude Opus 4.8 --- lib/ads/formats.ts | 1 + .../20260717130000_ad_slot_text_link_format.sql | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 supabase/migrations/20260717130000_ad_slot_text_link_format.sql diff --git a/lib/ads/formats.ts b/lib/ads/formats.ts index 38593b4b..16f92491 100644 --- a/lib/ads/formats.ts +++ b/lib/ads/formats.ts @@ -23,6 +23,7 @@ export const PUBLISHER_FORMAT_IDS: AdFormatId[] = [ "banner_300x250", "banner_728x90", "banner_320x50", + "text_link", ]; export function formatSpec(id: AdFormatId) { diff --git a/supabase/migrations/20260717130000_ad_slot_text_link_format.sql b/supabase/migrations/20260717130000_ad_slot_text_link_format.sql new file mode 100644 index 00000000..3ac77360 --- /dev/null +++ b/supabase/migrations/20260717130000_ad_slot_text_link_format.sql @@ -0,0 +1,16 @@ +-- Allow the native text-link ad to serve on publisher slots. +-- +-- ad_slots.formats gates which sizes serveAd() will fill for a slot, and its +-- original default predates the text_link format: +-- default array['banner_300x250','banner_728x90','banner_320x50'] +-- So a publisher who copies the new text-link embed would get nothing back. +-- Widen the default for new slots and backfill existing ones so their +-- text-link embed actually fills. + +alter table public.ad_slots + alter column formats + set default array['banner_300x250', 'banner_728x90', 'banner_320x50', 'text_link']; + +update public.ad_slots + set formats = array_append(formats, 'text_link') + where not ('text_link' = any (formats));