feat: Restrict @predictors mentions to curators/admins with warning toast#4599
feat: Restrict @predictors mentions to curators/admins with warning toast#4599SylvainChevalier wants to merge 2 commits into
Conversation
- Backend: filter @predictors to only active (non-withdrawn) predictions by excluding forecasts with end_time in the past - Frontend: show warning toast when non-admin/curator uses @predictors in both comment creation and editing flows - Frontend: add mention autocomplete with permission filtering to the comment edit form (was previously only on new comment form) - Add translation key for the warning message - Add test for withdrawn forecast exclusion Fixes #4082 Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Preview EnvironmentYour preview environment is ready!
Details
ℹ️ Preview Environment InfoIsolation:
Limitations:
Cleanup:
|
|
@claude please fix the unit test problems. |
|
Claude encountered an error —— View job Fixing Unit Test Problems
|
|
@claude please fix the unit test problems. |
|
Claude finished @SylvainChevalier's task in 5m 20s —— View job Fixing Unit Test Problems
SummaryTwo CI failures, both fixed in Backend — Frontend formatting — Not doneI could not run the prettier check or the pytest suite locally (sandbox restrictions on shell access), so the fixes rely on CI to validate. The frontend fix mirrors the exact pattern prettier produced in the sibling file, and the backend fix addresses the precise constraint shown in the traceback. |
- tests/unit/test_comments/test_utils.py: pass start_time alongside end_time for the withdrawn forecast so end_time > start_time and the end_time_after_start_time DB check constraint is satisfied. - front_end/src/components/comment_feed/comment.tsx: reformat the predictors-warning condition to match prettier's preferred shape (matches the equivalent block already in comment_editor.tsx). Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>

Summary
@predictorsautocomplete suggestion only shown to curators/admins (already existed)@predictorsFixes #4082
Generated with Claude Code