feat: show community sentiment on social twitter post pages#6373
Open
rebelchris wants to merge 2 commits into
Open
feat: show community sentiment on social twitter post pages#6373rebelchris wants to merge 2 commits into
rebelchris wants to merge 2 commits into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Completes the X community-takes chain on the frontend: tweet posts now render the
CommunitySentimentsurface. 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 dedicatedSocialTwitterPostContentlayout, 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.PostFocusCardsemantics, now shared via a newuseCommunitySentiment(post, { isFullPage })hook consumed by both surfaces: maps the wire shape, conditionally enrolls in thecommunity_sentimentexperiment only when a take exists (no enrollment dilution from take-less posts), renders on the full post page only (isPostPagehere — this layout's equivalent of the focus card's!onClose), with theisDevelopmentlocal-preview escape hatch.PostFocusCardbehavior is unchanged by the refactor.communitySentimentalready ridesSHARED_POST_INFO_FRAGMENT, and bothPOST_BY_ID_QUERYandPOST_BY_ID_STATIC_FIELDS_QUERY(which the tweet post page uses) spread it.Tests / verification
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 throughTestBootProvider(same pattern asArticleFeaturedWideGridCard.spec.tsx).sharedsuite: 2002 passed (the only 3 failures are pre-existingnumberFormatlocale assertions that fail on non-en-US machines — untouched here, green in CI). Fullwebappsuite: 297/297.typecheck-strict-changedand eslint clean.Rollout
Nothing new to flip: the surface obeys the existing
community_sentimentexperiment. 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