Public: anyone can read this; the crew can change it.
Run and app pages carry og:title, og:description, og:image and twitter:card #2472
Check · Review · Land · Live done — Landed and live in production.
Run pages and app pages now name their own social card in `og:image`. Before this change they pointed at the generic site card.
shipped production is serving it deploy a9b30ef
Run pages and app pages now name their own social card in og:image. Before this change they pointed at the generic site card.
What was missing. Both pages already had og:title, og:description and twitter:card. The descriptions already come from state: a run says its outcome and short sha, and an app says its description and status, e.g. "… · up." The pages never passed an ogImage to the layout, so the site card stood in.
Changes
src/web/og/path.tshas two new helpers,runCardPathandappCardPath. A card is named only when an unfurler can fetch it:
- A run needs a public repo and a thread that isn't sealed. - An app needs a public repo and a public app. - Anything else keeps the site card, as threads already do.
src/web/studio/run.tsandsrc/web/studio/app.tsuse those helpers. A run's card is/og/run/owner~name~runId.pngand an app's is/og/app/<slug>.png.test/og-tags.test.tshas three new tests:
- A finished deploy run's description mentions "deployed", and its og:image is its own card, which answers 200 image/png.
- An app page's description ends with its status, and its og:image is /og/app/widget.png, which answers 200 image/png.
- A run on a sealed report falls back to /og/site.png.
Test result.
bun test test/og-tags.test.tspasses: 21 pass, 0 fail.bun test test/og-tags.test.ts test/og-designs.test.tsalso passes: 36 pass, 0 fail.- With the
srcchanges stashed, the new run and app tests fail, so they do catch the missing images. - I ran
bun x tsc --noEmitafterbun install, but I only read the tail of its output, and it showed no errors.
Left out. I did not change the card designs or the descriptions. I did not run the full suite, since the forge's check does that.
Run and app pages now name their own card only when the card route would serve it. The gates match src/web/pages/og.ts: public repo, run readable anonymously via getRepoRun(undefined), public app. Otherwise the site card stands in, so an unfurler never gets a 404 image. The tests cover the run card, the app card and the sealed fallback, and each fetches the image. I did not open the preview (the sandbox denied the host), so this is from the source and the tests only. Two things I would do next: (1) hoist the anonymous-readable check that runView and the /og/run route both make into one helper so they cannot drift; (2) add a private-app case, where a public repo has a non-public app, to the tests to pin the appCardPath access gate.
Run pages and app pages now name their own social card in
og:image. Before this change they pointed at the generic site card.What was missing. Both pages already had
og:title,og:descriptionandtwitter:card. The descriptions already come from state: a run says its outcome and short sha, and an app says its description and status, e.g. "… · up." The pages never passed anogImageto the layout, so the site card stood in.Changes
src/web/og/path.tshas two new helpers,runCardPathandappCardPath. A card is named only when an unfurler can fetch it:- A run needs a public repo and a thread that isn't sealed. - An app needs a public repo and a public app. - Anything else keeps the site card, as threads already do.
src/web/studio/run.tsandsrc/web/studio/app.tsuse those helpers. A run's card is/og/run/owner~name~runId.pngand an app's is/og/app/<slug>.png.test/og-tags.test.tshas three new tests:- A finished deploy run's description mentions "deployed", and its
og:imageis its own card, which answers 200image/png. - An app page's description ends with its status, and itsog:imageis/og/app/widget.png, which answers 200image/png. - A run on a sealed report falls back to/og/site.png.Test result.
bun test test/og-tags.test.tspasses: 21 pass, 0 fail.bun test test/og-tags.test.ts test/og-designs.test.tsalso passes: 36 pass, 0 fail.srcchanges stashed, the new run and app tests fail, so they do catch the missing images.bun x tsc --noEmitafterbun install, but I only read the tail of its output, and it showed no errors.Left out. I did not change the card designs or the descriptions. I did not run the full suite, since the forge's check does that.
Closes #2448