Skip to content

Conversation

@ncarazon
Copy link
Contributor

@ncarazon ncarazon commented Jan 21, 2026

This PR makes notebooks look the same for authenticated and anonymous users.

Before for anonymous:

image

After for anonymous:

image

Summary by CodeRabbit

  • Refactor

    • Simplified how the question variant selector receives data and streamlined variant selection logic.
    • Removed internal data forwarding no longer needed by the selector.
  • Chores

    • No user-facing behavior changes; consumers and forecasters continue to work as before.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

Removed the postData prop from QuestionVariantComposer’s type and signature, updated its internal logged-out eligibility logic, and removed postData from all call sites; consumer/forecaster branches continue to receive postData where they previously did.

Changes

Cohort / File(s) Summary
Component definition
front_end/src/app/(main)/questions/[id]/components/question_variant_composer.tsx
Removed postData from QuestionVariantComposerProps and the component signature. Dropped PostWithForecasts import and related checks (isNotebookPost, isConditionalPost). Simplified logged-out eligibility to user == nil and feature-flag based selection.
Question layout usages
front_end/src/app/(main)/questions/[id]/components/question_layout/index.tsx, front_end/src/app/(main)/questions/[id]/components/question_layout/question_info.tsx, front_end/src/app/(main)/questions/[id]/components/question_view/index.tsx
Removed postData prop passed into QuestionVariantComposer invocations; other props and control flow unchanged.
Feed usage
front_end/src/components/posts_feed/paginated_feed.tsx
Removed postData prop from QuestionVariantComposer call inside renderPost; no other changes to surrounding logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nudged a prop away with care,
Cleaned up logic, lighter air,
Composer hops with fewer ties,
Consumer and forecaster still rise,
A tiny change — a tidy hare ✨

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Unify consumer notebooks representation' directly aligns with the PR's objective to standardize consumer notebook representation for both authenticated and anonymous users by removing postData prop usage across multiple components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2edf088 and d6f0ff8.

📒 Files selected for processing (5)
  • front_end/src/app/(main)/questions/[id]/components/question_layout/index.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_layout/question_info.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_variant_composer.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/index.tsx
  • front_end/src/components/posts_feed/paginated_feed.tsx
💤 Files with no reviewable changes (4)
  • front_end/src/components/posts_feed/paginated_feed.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_layout/question_info.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_layout/index.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build Docker Image
  • GitHub Check: Frontend Checks
  • GitHub Check: Backend Checks
  • GitHub Check: integration-tests
🔇 Additional comments (1)
front_end/src/app/(main)/questions/[id]/components/question_variant_composer.tsx (1)

37-40: No action needed—the auth implementation is correct.

The user field from useAuth() is strictly typed as CurrentUser | null and is initialized server-side before rendering. Auth is fully resolved during server rendering, not asynchronously client-side. There is no loading state, no risk of undefined during auth resolution, and no chance of flickering. Using isNil(user) is safe and appropriate.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

🧹 Preview Environment Cleaned Up

The preview environment for this PR has been destroyed.

Resource Status
🌐 Preview App ✅ Deleted
🗄️ PostgreSQL Branch ✅ Deleted
⚡ Redis Database ✅ Deleted
🔧 GitHub Deployments ✅ Removed
📦 Docker Image ⚠️ Retained (auto-cleanup via GHCR policies)

Cleanup triggered by PR close at 2026-01-22T07:19:38Z

@ncarazon ncarazon force-pushed the fix/unify-news-consumer-representation branch from 2edf088 to d6f0ff8 Compare January 22, 2026 06:59
@ncarazon ncarazon merged commit cc29917 into main Jan 22, 2026
12 of 13 checks passed
@ncarazon ncarazon deleted the fix/unify-news-consumer-representation branch January 22, 2026 07:19
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.

3 participants