Skip to content

feat(post): community sentiment mockup (L1 + L2)#6295

Draft
idoshamun wants to merge 6 commits into
mainfrom
feat/community-sentiment
Draft

feat(post): community sentiment mockup (L1 + L2)#6295
idoshamun wants to merge 6 commits into
mainfrom
feat/community-sentiment

Conversation

@idoshamun

@idoshamun idoshamun commented Jul 8, 2026

Copy link
Copy Markdown
Member

What

A Community Sentiment section on the redesigned post page (PostFocusCard): what the developer community outside daily.dev thinks about a post, aggregated from X / Hacker News / Lobsters.

Mockup with typed sample data — behind the community_sentiment flag (dev-on, prod-off) and gated to the full post page (not the preview modal).

Layers

  • L1 surface: plain-English TL;DR + a positive / mixed / skeptical breakdown bar, discussion count, and a Deep dive toggle.
  • L2 (inline expand): modular blocks that render only when populated, so the layer composes itself to the sentiment shape:
    • What devs like / What worries them (pros vs cons)
    • The big debate (the one thing they disagree on)
    • Open questions (unknowns nobody's answered)
    • By community (per-source lean with logos; HN/Lobsters link to the real threads)

Notes

  • Not for merge yet — draft while we iterate on the design (Layer 3 next).
  • Real data is a one-line swap for the sample constant.
  • Context doc kept local/uncommitted per request.

Preview domain

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

Adds a Community Sentiment section to the redesigned post page (PostFocusCard), behind the community_sentiment flag (dev-on, prod-off) and gated to the full page (not the preview modal).

- Layer 1 surface: plain-language TL;DR + positive/mixed/skeptical breakdown bar, discussion count, and a Deep dive toggle.
- Layer 2 (inline expand): modular blocks that render only when populated (pros/cons, the big debate, open questions, by-community with source badges + links to the real threads).

Uses typed sample data so wiring a real aggregation query later is a one-line swap.
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
daily-webapp Error Error Jul 15, 2026 9:09am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jul 15, 2026 9:09am

Request Review

- Layer 3 'Top picks': verbatim quote cards with source badges, author, engagement metrics, and links to the originals; Load more reveals the rest in one step.
- Reworked copy (breakdown bar, 'By community', 'The big debate' vs 'Open questions', 'Deep dive').
- Source rows: logos + links to the real threads, with the link slot reserved so unlinked rows stay aligned.
…ing)

Add communitySentiment to Post's GraphQL contract (SHARED_POST_INFO_FRAGMENT
+ Post interface), mirroring the twitter-fields convention. The wire shape
carries structured highlight metrics ({points, replies, likes}),
per-discussion counts, and the take's own updatedAt; mapCommunitySentimentPost
converts it to the display shape the mockup components already render.

CommunitySentiment now renders nothing when data is null (a real post without
a take), shows an "Updated Xh ago" stamp via the existing RelativeTime
helper, and CommunitySentimentBreakdown surfaces per-source discussion counts
("points · comments") alongside the by-source narrative.

daily-api doesn't expose the field yet (checked locally) — types are
hand-declared against the contract in COMMUNITY_TAKES_PLAN.md pending the
parallel daily-api work landing.
Convert community_sentiment from a plain (dev-on) feature flag into a proper
experiment: the committed default is now always false (control/hidden), and
PostFocusCard uses useConditionalFeature with shouldEvaluate tied to the post
actually having a take (communitySentiment != null). This means GrowthBook is
only queried — and exposure only logged — for posts with something to show,
so take-less posts never dilute the treatment/control split. Backend keeps
generating takes unconditionally; this flag gates rendering only.

Local/dev preview still works via isDevelopment (never the committed
default), matching the pattern documented in AGENTS.md.
@rebelchris

rebelchris commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Pushed the real-data + experiment wiring (2 commits):

  • community_sentiment is now a GrowthBook experiment (default false), evaluated via useConditionalFeature with shouldEvaluate: !!post.communitySentiment — enrollment/exposure only logs when a post actually has a take, so take-less post views don't dilute the experiment.
  • communitySentiment added to SHARED_POST_INFO_FRAGMENT with typed wire interfaces + mapper replacing the sample constant; null renders nothing; "updated Xh ago" stamp; per-source rows show real points/comment counts from discussions.
  • Backend contract: feat: community sentiment on posts daily-api#3999 (field names verified against its SDL).

🤖 Generated with Claude Code

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.

2 participants