Public: anyone can read this; the crew can change it.

A wave's page has a share card: title and description tags drawn from its milestone, so the link unfurls #14473

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A wave page (/:owner/:name/waves/:version) now carries a share card drawn from its milestone, so a pasted link unfurls as the wave. tsc, design-lint and test/waves-page.test.ts (24 tests, including the new share-card one) pass.

Notes

shipped production is serving it deploy 08ee03a

opened this

A wave page (/:owner/:name/waves/:version) now carries a share card drawn from its milestone, so a pasted link unfurls as the wave. tsc, design-lint and test/waves-page.test.ts (24 tests, including the new share-card one) pass. So do four share-tag suites, og-tags, page-head, page-title and public-head, plus wave-page-pulls, which covers the same page. The full diff-wide run scripts/fast.ts names (2353 files) was too broad to run here.

  • The layout already emitted the share tags on every page, so I extended that path instead of adding a new one. PageOptions gets one new field, share. false drops the description, Open Graph, Twitter and canonical tags. An object sets the Twitter card type (summary or summary_large_image) and a share title.
  • Public repository, valid wave:
    • og:title is the wave's headline.
    • og:description is the first highlight's why, or the headline if that is empty. It is clipped to 200 characters at a word, and the layout's existing 160-character clip still applies on top, so the tag carries at most 160.
    • twitter:card is summary.
    • The canonical link points at the wave's URL.
    • All of it is escaped by the existing html template.
  • Private repository: the wave page sets none of those tags, not even the generic site description, so an unfurler learns nothing. The 404 an outsider gets is unchanged.
  • Test: a hostile headline and why come out escaped, a wave with no special text uses its headline, and a private wave has no og:title, og:description, twitter:card or canonical.

I left out:

  • Any image route, as the issue said.
  • A card for the waves list page or for an unparsable wave file, which keep the generic card.
  • A change to the 160-character description clip shared by every page.
  • The builder brief for the story pillar.

To try it, open /alice/pub/waves/0.10.0 on a preview and view the source.

The pre-push hook demanded a "how to try it" commit, so I added an empty Try: commit.

🤖 Generated with Claude Code

Closes #14456

3 earlier comments
commented

A wave page (/:owner/:name/waves/:version) now carries a share card drawn from its milestone, so a pasted link unfurls as the wave. tsc, design-lint and test/waves-page.test.ts (24 tests, including the new share-card one) pass. So do four share-tag suites, og-tags, page-head, page-title and public-head, plus wave-page-pulls, which covers the same page. The full diff-wide run scripts/fast.ts names (2353 files) was too broad to run here.

  • The layout already emitted the share tags on every page, so I extended that path instead of adding a new one. PageOptions gets one new field, share. false drops the description, Open Graph, Twitter and canonical tags. An object sets the Twitter card type (summary or summary_large_image) and a share title.
  • Public repository, valid wave:
    • og:title is the wave's headline.
    • og:description is the first highlight's why, or the headline if that is empty. It is clipped to 200 characters at a word, and the layout's existing 160-character clip still applies on top, so the tag carries at most 160.
    • twitter:card is summary.
    • The canonical link points at the wave's URL.
    • All of it is escaped by the existing html template.
  • Private repository: the wave page sets none of those tags, not even the generic site description, so an unfurler learns nothing. The 404 an outsider gets is unchanged.
  • Test: a hostile headline and why come out escaped, a wave with no special text uses its headline, and a private wave has no og:title, og:description, twitter:card or canonical.

I left out:

  • Any image route, as the issue said.
  • A card for the waves list page or for an unparsable wave file, which keep the generic card.
  • A change to the 160-character description clip shared by every page.
  • The builder brief for the story pillar.

To try it, open /alice/pub/waves/0.10.0 on a preview and view the source.

The pre-push hook demanded a "how to try it" commit, so I added an empty Try: commit.

🤖 Generated with Claude Code

commented

<!-- look-pages c1ea5599671a --> Look pages for c1ea559, from the gate:

  • look pages (inferred): this pull changes src/web/layout.ts, src/web/pages/waves.ts; the forge pictures / (src/web/layout.ts), /docs (src/web/layout.ts), /explore (src/web/layout.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

<!-- look-pages d0bb90455d8e --> Look pages for d0bb904, from the gate:

  • look pages (inferred): this pull changes src/web/layout.ts, src/web/pages/waves.ts; the forge pictures / (src/web/layout.ts), /docs (src/web/layout.ts), /explore (src/web/layout.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

Both gate overrides are now on the branch. A No door: line and a No look: line are in the commit messages, with no code change. I didn't run the gate after the push, so I haven't seen whether the check passes now.

  • Both doors: the share tags are head metadata for link unfurlers, and the terminal has no head to show them in. The earlier push attempt failed with "Proxy CONNECT aborted". The No door: commit went up with this push.
  • Look pages: the gate inferred about 30 pages because src/web/layout.ts is imported widely. The change only adds a share option to the head and leaves every page's rendering as it was. Pages that don't pass share emit the same tags as before, and the tests that cover the head, og-tags, page-head, page-title and public-head, still pass. No pixels move, so I gave No look: as the reason instead of listing pages.

Nothing else changed from the earlier pull description: the wave page's tags (summary card, headline title, canonical link) and the private-repository case that sets none are as before.

Approved

Approved. Share tags are head-only, server-rendered, escaped by the html template, and a private wave sets none. No layout shift, no JS, no new dependency, no design-system departure (no visible markup changes). Next two things: (1) re-indent the shareHead call in src/web/layout.ts page() under the ternary so the formatter stays quiet; (2) give a public wave with an unparsable file a card too, or note why it keeps the generic one. Preview of other pages renders the unchanged generic card.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs