feat: add Happening Now sidebar widget on post pages#5919
feat: add Happening Now sidebar widget on post pages#5919
Conversation
Adds a compact, rotating "Happening Now" widget to article, squad and collection post sidebars (covers post pages and post modals). Gated behind the new `post_page_highlights` GrowthBook flag. Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude please review this pr |
|
Claude finished @nimrodkra's task in 2m 23s —— View job PR Review: feat/happening-now-post-widgetTasks
SummaryOverall this is a clean, well-structured feature. The implementation follows codebase patterns well — proper early returns, IssuesMedium — Hover-pause test passes for the wrong reason
// Timer setup happens AFTER hover (when rotation is already paused)
await userEvent.hover(article); // isPaused = true → interval never created
jest.useFakeTimers(); // No real interval exists at this point
await act(async () => {
jest.advanceTimersByTime(6000); // Nothing to advance — this is dead code
jest.advanceTimersByTime(500);
});The test passes because
Minor — Redundant
|
- Restructure hover-pause test to fake-time before render so the rotation interval is live, then verify rotation actually pauses on hover and resumes on unhover (previously the test passed because the interval was never created during pause). - Add a test asserting the impression event fires when highlights load. Made-with: Cursor
|
Thanks for the review! Addressed two of three findings in 5b0f3b4:
Declined dropping |
Made-with: Cursor
Summary
Adds a compact "Happening Now" sidebar widget to article, squad and collection post sidebars, covering both standalone post pages and post modals.
HighlightPostSidebarWidgetshows a single major headline that rotates every 6s with a fade transition (instant swap whenprefers-reduced-motion: reduce); pauses on hover/focus and when the tab is hidden.WidgetContainerborder, no background,typo-callouttitle) while keeping the gradient "Happening Now" brand identity.ShareMobile, beforeFurtherReading/FeaturedArchives), consistent across all three sidebar files.post_page_highlightsGrowthBook flag, evaluated only for logged-in users viauseConditionalFeature.majorHeadlinesQueryOptions— no backend changes.feedHighlightsLogEventwithOrigin.ArticlePage.Test plan
post_page_highlightsflag on/off — widget appears/disappears for logged-in users.ArticlePostModalboth render the widget.SharePostModalboth render the widget.CollectionPostModalboth render the widget./highlights?highlight=<firstId>.pnpm --filter @dailydotdev/shared exec jest HighlightPostSidebarWidget.Made with Cursor
Preview domain
https://feat-happening-now-post-widget.preview.app.daily.dev