Skip to content

ads: surface the Leaderboard (728×90) size on the Monetize page - #94

Merged
ralyodio merged 1 commit into
masterfrom
ads/publisher-formats-leaderboard
Jul 17, 2026
Merged

ralyodio merged 1 commit into
masterfrom
ads/publisher-formats-leaderboard

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

The Monetize page (/ads/slots) only ever handed publishers the 300×250 square embed — even though the serving/creative pipeline already renders leaderboards, mobile banners, and text links. This is the first of a per-size series that surfaces the sizes we already render so publishers can actually use them.

This PR adds the Leaderboard (728×90) and the shared foundation the rest of the series builds on.

Changes

  • lib/ads/formats.ts — new PUBLISHER_FORMAT_IDS allowlist (rectangle + leaderboard). Each subsequent size PR appends one entry.
  • components/ads/slot-manager.tsx — a button per size; clicking one reveals that size's copyable embed (clicking the open one collapses it). Copy + "Submit PR to install" act on the selected size.
  • lib/github/install-ad.ts — the installer now threads the chosen format and, for leaderboards, injects after <body> (top of page) instead of before </body>, since a 728×90 reads best across the top. Falls back to the old spot when there's no <body> tag.
  • app/api/ads/slots/[id]/install-embed/route.ts — accepts & validates a format param against AD_FORMAT_IDS.
  • tests — new contract test asserting a leaderboard lands at the top of the page.

Notes

  • Leaderboard (banner_728x90) is already in the ad_slots.formats default, so no migration is needed here.
  • Stacked series — this is the base; mobile and text link build on top.
  • Typecheck clean; install-ad contract tests green (6/6).

🤖 Generated with Claude Code

The Monetize page only ever handed publishers the 300×250 square embed,
even though the serving pipeline already renders leaderboards. Add a
data-driven size picker (PUBLISHER_FORMAT_IDS) with a toggle button per
size that reveals that size's copyable embed, and thread the chosen
format through the one-click installer so the PR it opens installs the
size the publisher actually picked.

Placement: a 728×90 reads best across the top of the page, so the
installer now drops the leaderboard right after <body> instead of before
</body> (falling back to the old spot when there's no <body> tag).

- lib/ads/formats.ts: PUBLISHER_FORMAT_IDS allowlist (rect + leaderboard)
- components/ads/slot-manager.tsx: per-size toggle buttons + copy
- lib/github/install-ad.ts: injectAfterBodyOpen + per-format placement
- app/api/ads/slots/[id]/install-embed: accept & validate `format`
- tests: leaderboard lands at the top of the page

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 3026eea into master Jul 17, 2026
8 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