Skip to content

feat: show community sentiment on social twitter post pages#6373

Open
rebelchris wants to merge 2 commits into
mainfrom
feat/community-sentiment-twitter-posts
Open

feat: show community sentiment on social twitter post pages#6373
rebelchris wants to merge 2 commits into
mainfrom
feat/community-sentiment-twitter-posts

Conversation

@rebelchris

@rebelchris rebelchris commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Completes the X community-takes chain on the frontend: tweet posts now render the CommunitySentiment surface. The backend generates takes for tweets from their X reply threads (dailydotdev/yggdrasil#711 + dailydotdev/bragi#262 + dailydotdev/daily-api#4024), but tweets use the dedicated SocialTwitterPostContent layout, which never showed the take.

Changes

  • SocialTwitterPostContent: renders <CommunitySentiment> after the tweet body (thread markdown / embedded quote preview) and before the comments section, using the file's existing block-spacing idiom.
  • Gating is byte-for-byte the PostFocusCard semantics, now shared via a new useCommunitySentiment(post, { isFullPage }) hook consumed by both surfaces: maps the wire shape, conditionally enrolls in the community_sentiment experiment only when a take exists (no enrollment dilution from take-less posts), renders on the full post page only (isPostPage here — this layout's equivalent of the focus card's !onClose), with the isDevelopment local-preview escape hatch. PostFocusCard behavior is unchanged by the refactor.
  • No GraphQL changes: communitySentiment already rides SHARED_POST_INFO_FRAGMENT, and both POST_BY_ID_QUERY and POST_BY_ID_STATIC_FIELDS_QUERY (which the tweet post page uses) spread it.

Tests / verification

  • New SocialTwitterPostContent.spec.tsx (4 tests): renders with take + flag on; hidden without a take; hidden with take but flag off; hidden in the preview modal. Flag mocked via a real GrowthBook instance through TestBootProvider (same pattern as ArticleFeaturedWideGridCard.spec.tsx).
  • Full shared suite: 2002 passed (the only 3 failures are pre-existing numberFormat locale assertions that fail on non-en-US machines — untouched here, green in CI). Full webapp suite: 297/297. typecheck-strict-changed and eslint clean.

Rollout

Nothing new to flip: the surface obeys the existing community_sentiment experiment. Tweets simply join the eligible surfaces once the backend chain is deployed and X creds are live.

🤖 Generated with Claude Code

Preview domain

https://feat-community-sentiment-twitter.preview.app.daily.dev

The backend now generates community takes for tweet posts (X replies as a
discussion provider, yggdrasil#711), but tweets render via the dedicated
SocialTwitterPostContent layout which never showed the take. Embeds the
CommunitySentiment surface there, after the tweet body and before the
comments, with the exact PostFocusCard gating: conditional experiment
enrollment only when a take exists, full post page only (isPostPage, the
layout's equivalent of the focus card's !onClose), isDevelopment preview
escape hatch. The shared gating now lives in a useCommunitySentiment hook
consumed by both surfaces (behavior unchanged on the focus card).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Jul 24, 2026 11:49am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jul 24, 2026 11:49am

Request Review

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