feat(shared): display bookmark count on post cards#5659
feat(shared): display bookmark count on post cards#5659
Conversation
Add feature flag `show_bookmark_count` to gate bookmark count display. Update Post interface and GraphQL fragments with numBookmarks field. Show InteractionCounter in ActionButtons BookmarkButton and PostEngagementCounts, both gated by the feature flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove redundant invisible class from ActionButtons bookmark counter (already gated by > 0 check). Fix PostEngagementCounts to avoid rendering falsy number 0 in separator conditional. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Switch bookmark-count consumers from post.numBookmarks to post.analytics.bookmarks and update shared GraphQL fragments/types accordingly. Made-with: Cursor
|
Updated frontend to consume the analytics-based bookmark count from API. What changed:
Latest commit: 7774b0e. |
Apply the bun tertiary button class to bookmark actions in card ActionButtons so counter color and hover state match upvote/comment interaction patterns. Made-with: Cursor
Update bookmark mutation cache handlers to optimistically adjust analytics.bookmarks on toggle and restore previous values on rollback for feed and ad posts. Made-with: Cursor
Drop stale Bookmark type import after optimistic cache refactor to satisfy shared lint checks. Made-with: Cursor
|
Found and fixed a likely CI lint failure cause: removed an unused Fix commit: |
|
@claude please review this pr |
|
Claude finished @nimrodkra's task in 2m 2s —— View job PR Review: feat(shared): display bookmark count on post cards
OverviewThe implementation is generally clean and follows existing codebase patterns well. Feature flag gating is correctly applied, GraphQL fragments are updated appropriately, and the UI integration is consistent. A few issues worth calling out: Issues🔴 Rollback logic in
|
Capture and restore the exact pre-mutation bookmark snapshot in defaultOnMutate, add an explicit onMutate type, and avoid requesting feed impressions where they are not needed. Made-with: Cursor
|
Addressed Claude review in commit f6f231a. Changes made:
This should resolve the two actionable findings and the fragment payload concern. |
Format the snapshot query call in useBookmarkPost to satisfy prettier in shared lint CI. Made-with: Cursor
Summary
show_bookmark_countGrowthBook feature flag (defaultfalse)numBookmarksto Post interface and bothFEED_POST_INFO_FRAGMENT/SHARED_POST_INFO_FRAGMENTGraphQL fragmentsInteractionCounterinsideBookmarkButtoninActionButtons, gated by the feature flagbookmarksprop toPostEngagementCountsfor the Similar Posts widget, also gated by the flagKey decisions
ActionButtonsandSimilarPostssince they render in separate contextsPostEngagementCountsreceives bookmarks as an optional prop threaded from the parent to avoid hooks in a static function component&&to prevent React's falsy-number-rendering pitfallCloses ENG-974
Created by Huginn 🐦⬛
Preview domain
https://eng-974-show-number-of-bookmarks.preview.app.daily.dev