Skip to content

Rotating subway-ad campaign on commute station platforms - #413

Open
spencerc99 wants to merge 5 commits into
mainfrom
cd/commute-subway-ads
Open

Rotating subway-ad campaign on commute station platforms#413
spencerc99 wants to merge 5 commits into
mainfrom
cd/commute-subway-ads

Conversation

@spencerc99

Copy link
Copy Markdown
Owner

Summary

Follow-up to #410. The single install poster on station platforms becomes a five-ad rotating campaign, each ad wearing the real artwork and palette of what it links to:

  • playhtml — the playhtml.fun homepage art on its sage green, gold-highlight wordmark, capability chips → playhtml.fun
  • class — the class.playhtml.fun hero (red stools, pool cyan, 'building benches for the web') → class.playhtml.fun
  • benches — the essay's real header (red bench + cursor) on its cream → The Internet Has No Benches
  • alive — dark poster framing the essay's image, 'they say the internet is dead / the internet is alive' → Alive Internet Theory
  • transit pass — the existing install poster, unchanged

Mechanics

  • Deterministic rotation: FNV-1a hash of the stop domain over the eligible set (mirrors the landscape seed hash), so everyone at the same station sees the same ad.
  • The four content ads show for everyone, installed riders included; only the transit-pass ad stays gated on the extension being absent. The poster waits for install detection to resolve so the ad never swaps mid-view.
  • Tiny platform poster shows the ad's artwork + accent stripe; clicking opens a per-ad readable overlay (dialog a11y, ×/backdrop/Escape, external links in new tabs). The offscreen-unmount behavior from Commute link on wewere.online + install CTAs on the commute #410's review carries over.
  • Renamed the Platform prop showInstallPoster → showStationPoster to match the widened role.

Verification

  • 137 files / 881 tests pass; both type checks clean; WXT + website production builds pass.
  • Verified on the dev server; screenshots below.

Notes

  • PENDING.md gains a bullet — installed extension users now see the content ads, so this is a user-visible extension change.
  • No changesets (nothing under packages/). Artwork JPGs total ~210KB in extension assets.

Five posters rotate deterministically per stop domain (FNV-1a over the
eligible set): playhtml, the SFPC class, the benches essay, alive
internet theory, and the transit pass. The four content ads show for
everyone — installed riders included; only the transit-pass ad stays
gated on the extension being absent. Tiny platform posters show each
ad's real header artwork; clicking opens a readable per-ad overlay in
the destination's own palette.
@spencerc99

spencerc99 commented Aug 25, 2026

Copy link
Copy Markdown
Owner Author

Preview evidence

Two-sided station posters at every stop: bigger tiles with real artwork plus a short title; distinct ads per side.

Open preview · Review all evidence · Commit e9de978

Station with posters on both sides

Station with posters on both sides

Left drew the class poster, right the benches essay — distinct ads, deterministic per stop, 108x62 tiles with artwork + title.

Open captured page · 1280×900

Right-side ad overlay

Right-side ad overlay

Clicking either side opens that ad's readable card.

Open captured page · 1280×900

Published by PR Evidence. Media is temporary and is removed after retention expires.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploying we-were-online-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 57def0a
Status: ✅  Deploy successful!
Preview URL: https://6451aaeb.we-were-online-website.pages.dev
Branch Preview URL: https://cd-commute-subway-ads.we-were-online-website.pages.dev

View logs

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

bun add https://pkg.pr.new/@playhtml/common@413
bun add https://pkg.pr.new/playhtml@413
bun add https://pkg.pr.new/@playhtml/react@413

commit: 57def0a

@spencerc99

Copy link
Copy Markdown
Owner Author

Code review

  • P2 — An open station poster can silently switch to a different ad. CommuteStationPoster.tsx:170 recalculates ad from the live domain and install state on every render, while lines 205–243 render the open portal from that changing value. The late-install path is reachable at CommuteInstallPrompt.test.tsx:73, and commuteAds.test.ts:25 proves the selected ad changes when install status flips. The retained-offscreen behavior can likewise carry the open dialog across a station-domain change. Store the clicked CommuteAd in dialog state and render that snapshot until dismissal.
  • P3 — The new test violates the required test layout. extension/src/entrypoints/commute/commuteAds.test.ts:1 is outside __tests__/, while the repository instruction requires tests under __tests__/. Move it to extension/src/entrypoints/commute/__tests__/commuteAds.test.ts and update the relative import.

Each stop hangs a poster on both sides of the station sign; the right
slot deterministically draws a different ad than the left. Tiles grow
to 108x62 and show the ad's artwork plus a short serif title.
@spencerc99

Copy link
Copy Markdown
Owner Author

Code review

No issues found. Verified the changes addressing the previous review findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying playhtml with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4bfa50b
Status: ✅  Deploy successful!
Preview URL: https://8515d6fe.playhtml.pages.dev
Branch Preview URL: https://cd-commute-subway-ads.playhtml.pages.dev

View logs

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