Skip to content

[#38] Add Farcaster sharing, meta tags, and OG image#148

Merged
realproject7 merged 3 commits intomainfrom
task/38-farcaster-sharing
Mar 15, 2026
Merged

[#38] Add Farcaster sharing, meta tags, and OG image#148
realproject7 merged 3 commits intomainfrom
task/38-farcaster-sharing

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

Fixes #38

  • Share to Farcaster button: Client component that detects Farcaster Mini App context and calls sdk.actions.composeCast() with pre-filled text and story URL embed. Only visible inside Farcaster.
  • fc:miniapp meta tags: Added generateMetadata to story pages emitting fc:miniapp JSON with launch_miniapp action, plus standard OG tags.
  • Dynamic OG image: New edge route at /story/[storylineId]/og generating a 1200x800 (3:2) image with story title, writer address, and plot count using next/og ImageResponse.

Test plan

  • Open a story page in browser — verify OG meta tags and fc:miniapp meta tag in page source
  • Visit /story/1/og — confirm 1200x800 PNG renders with story metadata
  • Open story page inside Farcaster client — verify "Share to Farcaster" button appears
  • Click share button — confirm composeCast opens with pre-filled text and story URL embed
  • Open story page outside Farcaster — verify share button is hidden

🤖 Generated with Claude Code

- ShareToFarcaster client component: detects mini app context via SDK,
  calls sdk.actions.composeCast() with story URL embed
- generateMetadata on story pages: OG tags + fc:miniapp meta tag with
  launch_miniapp action pointing back to story URL
- Dynamic OG image route at /story/[storylineId]/og: 1200x800 (3:2)
  showing title, writer address, and plot count

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The share button and metadata scaffolding are in place, but the embed metadata does not yet satisfy the issue requirements.

Findings

  • [high] Issue #38 requires story pages to include Farcaster embed metadata for story title, current price, plot count, and writer name. The new metadata/OG implementation only includes title, writer, and plot count. generateMetadata() builds a description from writer + plot count only, and the dynamic OG image renders title + writer + plot count only. There is no current price in the embed metadata or generated image.
    • File: src/app/story/[storylineId]/page.tsx:38
    • Suggestion: fetch the current token price for the storyline and include it in the Farcaster/OG metadata payload.
    • File: src/app/story/[storylineId]/og/route.tsx:84
    • Suggestion: render the current price in the generated 1200x800 image alongside the other story stats.

Decision

Requesting changes because the PR does not yet meet issue #38's acceptance criteria for embed metadata content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b Review: REQUEST CHANGES

Well-structured PR — SDK context gating, OG tags, and image generation all look correct. One functional bug:

Blocking

  1. lineClamp: 3 not supported by Satorinext/og ImageResponse uses Satori for rendering, which doesn't support lineClamp / -webkit-line-clamp. Long titles will overflow the OG image. Fix by truncating in JS:
const displayTitle = sl.title.length > 80 ? sl.title.slice(0, 77) + "..." : sl.title;

Non-blocking

  1. No explicit caching headers on OG image route — consider export const revalidate = 3600 or Cache-Control header.
  2. ShareToFarcaster re-imports SDK on every click — consider storing sdk ref from the initial useEffect.
  3. No XSS risks — ImageResponse renders to PNG (rasterized text), meta tags are escaped by Next.js.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b Re-review: APPROVE

lineClamp replaced with JS string truncation — Satori-compatible. Title capped at 80 chars with ellipsis. Clean fix.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The PR now includes the required Farcaster sharing flow, embed metadata, and dynamic OG image content for story pages. The missing current-price metadata is fixed and the OG image fallback is compatible with next/og.

Findings

  • [info] No blocking findings.

Decision

Approving because the implementation now matches issue #38 and lint-and-typecheck passed.

@realproject7 realproject7 merged commit a34d546 into main Mar 15, 2026
1 check passed
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.

[P7-3] Social Sharing & Embed Meta Tags

2 participants