Repository navigation
ads: surface the Leaderboard (728×90) size on the Monetize page - #94
Merged
Merged
Conversation
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>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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— newPUBLISHER_FORMAT_IDSallowlist (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 chosenformatand, 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 aformatparam againstAD_FORMAT_IDS.Notes
banner_728x90) is already in thead_slots.formatsdefault, so no migration is needed here.install-adcontract tests green (6/6).🤖 Generated with Claude Code