Skip to content

Key Factors: show aggregate links to all users#4148

Merged
hlbmtc merged 2 commits intomainfrom
fix/kf-show-aggregate-links
Jan 23, 2026
Merged

Key Factors: show aggregate links to all users#4148
hlbmtc merged 2 commits intomainfrom
fix/kf-show-aggregate-links

Conversation

@hlbmtc
Copy link
Contributor

@hlbmtc hlbmtc commented Jan 22, 2026

https://metaculus.slack.com/archives/C02JGTBC7DJ/p1769101143812069

Summary by CodeRabbit

  • Refactor
    • Simplified coherence links provider initialization by removing explicit validation checks and implementing optional chaining with default empty arrays for more consistent data handling.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

The CoherenceLinksProvider's useEffect hook was simplified by removing explicit validation guards that checked login status and the existence of coherence links data. The effect now defaults to empty arrays when data is unavailable, and the dependency array was updated to reference optional-chain properties directly.

Changes

Cohort / File(s) Change Summary
Provider Effect Simplification
front_end/src/app/(main)/components/coherence_links_provider.tsx
Removed login status and data presence guards from useEffect; now defaults to empty arrays for coherence links and aggregations via nullish coalescing. Dependency array adjusted to use optional-chain properties (post.question?.coherence_links, post.question?.coherence_link_aggregations) instead of post.question.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Guards once stood like fence posts tall,
Now empty arrays dance down the hall,
Optional chains whisper secrets true,
Effects flow free without a cue! ✨

🚥 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 title 'Key Factors: show aggregate links to all users' directly relates to the main change, which removes login status validation and allows coherence link aggregations to be shown to all users by default.

✏️ 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 ecc633e and 0f704b6.

📒 Files selected for processing (1)
  • front_end/src/app/(main)/components/coherence_links_provider.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)/components/coherence_links_provider.tsx (1)

53-64: Confirm anonymous visibility of non-aggregate coherence links.

The effect now initializes coherenceLinks from post.question.coherence_links even when logged out. If that field can include per‑user or private links, anonymous users will now see them. Please verify the server payload/permissions for logged‑out sessions; if it’s not meant to be public, keep the gate for coherenceLinks while leaving aggregate links visible.

✏️ 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 22, 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-23T12:03:28Z

@hlbmtc hlbmtc merged commit 0347f56 into main Jan 23, 2026
9 of 10 checks passed
@hlbmtc hlbmtc deleted the fix/kf-show-aggregate-links branch January 23, 2026 12:03
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