Skip to content

Issue/4186/fix/mc options change feedback#4286

Merged
lsabor merged 5 commits intomainfrom
issue/4186/fix/MC-options-change-feedback
Feb 9, 2026
Merged

Issue/4186/fix/mc options change feedback#4286
lsabor merged 5 commits intomainfrom
issue/4186/fix/MC-options-change-feedback

Conversation

@lsabor
Copy link
Contributor

@lsabor lsabor commented Feb 8, 2026

closes #4186

fixes broken reaffirm button
email subject line includes name
pluralization of emails
removes related questions from emails
improves comment phrasing as requested

Summary by CodeRabbit

  • Bug Fixes

    • Fixed forecast completion logic to properly handle option removals.
  • Improvements

    • Enhanced notification emails with improved messaging clarity—updated wording for how predictions are handled when options are modified.
    • Improved email layout with simplified formatting and dynamic pluralization for single and multiple option changes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

This PR adjusts forecast completion validation for multiple choice questions to ignore removed options, updates email notification templates to use dynamic pluralization for affected options, simplifies email layouts by removing related questions sections, and revises user messaging from "probability was folded" to "predictions were moved."

Changes

Cohort / File(s) Summary
Forecast Validation Logic
front_end/src/components/forecast_maker/forecast_maker_question/forecast_maker_multiple_choice.tsx
Updated forecastHasValues condition to ignore options not present in question.options and adjusted dependency array to track question.options changes.
Option Addition Notifications
notifications/templates/emails/multiple_choice_option_addition.html, notifications/templates/emails/multiple_choice_option_addition.mjml
Removed 50% column CSS styling, replaced static text with pluralized i18n messages using number_options, removed email_similar_questions.mjml inclusion, and simplified layout structure.
Option Deletion Notifications
notifications/templates/emails/multiple_choice_option_deletion.html, notifications/templates/emails/multiple_choice_option_deletion.mjml
Removed 50% column CSS and media query rules, replaced static messaging with pluralized notification text using number_options, eliminated related posts sections, and simplified MSO/IE compatibility scaffolding.
Notification Task & Configuration
questions/tasks.py, questions/admin.py
Updated email subject lines to include post titles with pluralization support, added number_options to template context, revised messaging from "probability was folded" to "predictions on those options were moved", and updated user-facing deletion comment text.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Feat/mc options change #4038 — Feat/mc options change directly modifies the same forecast_maker component and option-handling logic, introducing related changes to multiple choice option validation.

Suggested reviewers

  • elisescu
  • cemreinanc
  • hlbmtc

Poem

🐰 Hopping through options with care,
We've tidied the emails with flair,
Predictions now move (not fold away),
Plurals ring clear, come what may,
Related questions? We've trimmed that care! 📧

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses most requirements from #4186: reaffirm button fixed, email subject includes question title, pluralization corrected, and comment phrasing improved. However, the PR removes related questions instead of adding them. Review requirement about related questions—the PR removes them from emails rather than adding them as requested in issue #4186.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title refers to the issue number and general topic (MC options change feedback) but lacks specificity about key changes like the reaffirm button fix or pluralization improvements.
Out of Scope Changes check ✅ Passed All changes are directly related to #4186: forecast logic fix, email templates, notification text, and comment phrasing. No unrelated modifications detected.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue/4186/fix/MC-options-change-feedback

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.

❤️ Share

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

@lsabor lsabor requested review from hlbmtc and ncarazon February 8, 2026 22:24
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
front_end/src/components/forecast_maker/forecast_maker_question/forecast_maker_multiple_choice.tsx (1)

402-402: ⚠️ Potential issue | 🟡 Minor

Pre-existing bug: !forecastsSum === null is always false.

!forecastsSum yields a boolean, so comparing it with === null is always false. This means the null-check on forecastsSum in rescaleForecasts is effectively dead code. The intended guard was likely forecastsSum === null.

Not introduced in this PR, but worth fixing since you're touching adjacent logic.

Proposed fix
-    if (!forecastHasValues || !forecastsSum === null) return;
+    if (!forecastHasValues || forecastsSum === null) return;
🧹 Nitpick comments (1)
questions/tasks.py (1)

294-296: Note: template.replace("Their", "Its", 1) on Line 296 is now a dead path for the default text.

The new default_text uses "Your predictions" instead of "Their probability", so this replacement will never match the default. It only applies if a custom comment_text containing "Their" is passed. Consider removing it for clarity, or keeping it for backward compatibility with custom text.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 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-02-09T15:56:08Z

Copy link
Contributor

@ncarazon ncarazon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lsabor lsabor merged commit 55c30bf into main Feb 9, 2026
16 checks passed
@lsabor lsabor deleted the issue/4186/fix/MC-options-change-feedback branch February 9, 2026 15:56
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.

short and sweet MC feedback

2 participants