Conversation
- Add "Recently revealed" sort option to Home, My Predictions, My Questions & Posts, and Tournament feeds - Rename "Recent Predictions" to "Recently predicted" - In My Predictions feed: move "Divergence" to More menu and move "Withdrawing Soon" to quick sorts Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com> Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a "Recently revealed" sort (descending CP reveal time, only items with reveal time < now) across multiple feed filters, renames "Recent predictions" to "Recently predicted", and swaps "Divergence" and "Withdrawing Soon" positions in My Predictions sorts. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Frontend
participant API
participant Serializer
participant FeedService
participant Database
Client->>Frontend: Select "Recently revealed" sort
Frontend->>API: GET /posts?order=cp_reveal_time
API->>Serializer: validate `order` param
Serializer->>FeedService: pass Order.CP_REVEAL_TIME
FeedService->>Database: query posts where question__cp_reveal_time < now ORDER BY question__cp_reveal_time DESC
Database-->>FeedService: return ordered posts
FeedService-->>API: posts payload
API-->>Frontend: JSON response
Frontend-->>Client: render sorted feed
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
✏️ Tip: You can disable this entire section by setting Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@front_end/src/types/question.ts`:
- Line 53: The frontend added CpRevealTimeDesc (value "-cp_reveal_time") but the
backend PostFilterSerializer.Order enum is missing CP_REVEAL_TIME, so
validate_order_by will reject "-cp_reveal_time"; add CP_REVEAL_TIME =
"cp_reveal_time" to the PostFilterSerializer.Order enum (in
posts/serializers.py) so the Order enum includes this field and ordering by
cp_reveal_time/-cp_reveal_time is accepted by validate_order_by.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
front_end/messages/en.jsonfront_end/src/app/(main)/questions/components/feed_filters/main.tsxfront_end/src/app/(main)/questions/components/feed_filters/my_predictions.tsxfront_end/src/app/(main)/questions/components/feed_filters/my_questions_and_posts.tsxfront_end/src/components/tournament_filters.tsxfront_end/src/types/question.ts
⏰ 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: integration-tests
- GitHub Check: Frontend Checks
- GitHub Check: Backend Checks
🔇 Additional comments (6)
front_end/messages/en.json (1)
547-551: Copy update aligns with the new sort label.Line 547 and Line 551 look good and match the new “Recently revealed” option plus the “Recently predicted” rename.
front_end/src/components/tournament_filters.tsx (1)
88-88: Nice addition to tournament sort options.Line 88 cleanly wires the new “Recently revealed” sort to the enum and translation key.
front_end/src/app/(main)/questions/components/feed_filters/main.tsx (1)
143-143: Home feed “Recently revealed” option looks good.Line 143 adds the new option in the More menu as requested.
front_end/src/app/(main)/questions/components/feed_filters/my_questions_and_posts.tsx (1)
94-94: Sort option added as expected.Line 94 correctly adds “Recently revealed” to the More menu.
front_end/src/app/(main)/questions/components/feed_filters/my_predictions.tsx (2)
52-54: Quick-sort swap matches the requirement.Lines 52–54 correctly surface “Withdrawing soon” as a quick sort.
70-75: More-menu updates look correct.Lines 70–75 move “Divergence” to the More menu and add “Recently revealed” as intended.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
🚀 Preview EnvironmentYour preview environment is ready!
Details
ℹ️ Preview Environment InfoIsolation:
Limitations:
Cleanup:
|
This enables backend support for the cp_reveal_time ordering field used by the new 'Recently revealed' sort option in the frontend. Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
@claude I get "Unexpected Api Error". |
|
Claude finished @SylvainChevalier's task in 1m 18s —— View job Fixed the API error ✓
Root CauseThe Fix AppliedAdded special handling in The "Recently revealed" sort option should now work correctly across all feeds! Commit: 5b9dd4b | Branch |
The cp_reveal_time field exists on the Question model, not the Post model. When ordering Posts by this field, we need to use question__cp_reveal_time to access it through the relationship. Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
@claude It's missing the filter for cp reveal time < now. |
|
Claude finished @SylvainChevalier's task in 1m 7s —— View job Added cp_reveal_time < now filter ✓
Root CauseThe code in Fix AppliedAdded a filter on line 319 in Now the "Recently revealed" sort option will correctly show only posts where the community prediction has been revealed (cp_reveal_time < now). Commit: 7511c30 | Branch |
When ordering by CP_REVEAL_TIME, only include posts where the community prediction has actually been revealed (cp_reveal_time < now). This follows the same pattern as other time-based filters. Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
Tested on preview env, lgtm. |
|
@SylvainChevalier But it only counts single questions, should we do for groups as well? |
Summary
Implements feed sort improvements requested in #4142:
Changes
CpRevealTimeDesctoQuestionOrderenumCloses #4142
Generated with Claude Code
Summary by CodeRabbit
New Features
Updates
✏️ Tip: You can customize this high-level summary in your review settings.