Repository navigation
Share posts to LinkedIn and other apps, from the feed and a post's page - #63
Merged
Merged
Conversation
Every post in the feed now has a Share button in its footer, and a post's own page swaps its copy-only Share for the full control: the browser's own share sheet, Copy, and plain links to LinkedIn, X, Facebook, WhatsApp, Bluesky, Threads, Reddit, Telegram and email. Still no widget and no third-party script: each is an <a href> that only leaves on a click. A post's page now tells the networks what to show (og:title, description, type article, url, and the product's card as the image), so a LinkedIn share unfurls as the post rather than as the site. - contracts: shareIntents grows from three to nine (LinkedIn first); postShareText; SHARE_INTENT_ORIGINS lists each - ShareControl: a `row` look (icon and word) and panel alignment - PostFooter: Share, only where the site knows its public origin; off on the composer's draft preview Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…links The control builds the links in the browser from url and text when it is given none, so the home page's HTML does not carry nine share links per card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured in CI: / 168,987 B of JS and 18,270 of document; the product tabs 184,445; Talk 188,653; the post's page 189,752; /submit 181,178. Each limit moves to the measurement plus ~100 B. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 share control offers:
Still no widget and no third-party script (RE3's zero third-party requests): each destination is a plain
<a href>that leaves only when clicked, withrel="noreferrer noopener". Mastodon is still left out, for the documented reason.LinkedIn previews
A post's page had no Open Graph tags, so a shared link showed up as the site's generic card. It now sets
og:titleandog:descriptionfrom the post,og:type=article,og:url, and uses the product's existing card (/og/product/<slug>) as the image, with atwitterlarge-image card. This only happens where the deployment has a canonical origin, the same gate ascanonical.Changes
packages/contracts/src/share.ts:shareIntentsgoes from 3 to 9 destinations, plus a newpostShareText(headline — product), and every origin is listed inSHARE_INTENT_ORIGINS.web/src/app/[slug]/share-control.tsx: alook="row"option (icon plus word, fills its cell) andalignfor which edge the panel hangs from.web/src/app/posts/post-footer.tsx: Share, only when the site knows its origin. Theshare={false}prop is used by the composer's draft preview.web/src/app/[slug]/posts/[id]/page.tsx: ShareControl in the React / Comment / Share row; Open Graph tags.Tests
share.test.ts: the destination list and order, every link pointing at a declared origin and carrying the address, andpostShareText.post-page.test.ts: the post page uses ShareControl and sets article OG tags.post-share-feed.test.ts: the feed footer's Share uses the post's own address and text, is hidden without an origin, and is off on the draft preview.Security (OWASP)
encodeURIComponent-ed and the URL is built from the post's server-side address. Nothing typed by a visitor goes in.noreferrermeans a destination isn't told which page someone was reading.🤖 Generated with Claude Code