Skip to content

feat: add pre-predictions#4557

Open
cemreinanc wants to merge 5 commits intomainfrom
feat/pre-predictions
Open

feat: add pre-predictions#4557
cemreinanc wants to merge 5 commits intomainfrom
feat/pre-predictions

Conversation

@cemreinanc
Copy link
Copy Markdown
Contributor

@cemreinanc cemreinanc commented Mar 30, 2026

closes #3563

Summary by CodeRabbit

  • New Features

    • Users can make pre-predictions for questions that are scheduled to open (including approved/upcoming cases); controls enable interaction before questions officially open.
    • Predict button label switches to "Pre-Predict" in pre-prediction state; pre-predictions are not scored until the question opens.
  • Internationalization

    • Added pre-prediction label and status message translations for cs, en, es, pt, zh, and zh-TW.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

Adds a "pre-prediction" flow: new localization keys, UI shows "Pre‑Predict" for upcoming questions with open_time, prediction eligibility extended to UPCOMING/APPROVED states, forecast components accept a dynamic predictLabel, forecast-availability types refined, and backend validation now requires open_time existence rather than future timing.

Changes

Cohort / File(s) Summary
Internationalization
front_end/messages/cs.json, front_end/messages/en.json, front_end/messages/es.json, front_end/messages/pt.json, front_end/messages/zh-TW.json, front_end/messages/zh.json
Added prePredict and prePredictionMessage translations for six locales.
Prediction utils & backend
front_end/src/utils/questions/predictions.ts, questions/views.py
Added isPostPrePrediction(); broadened canPredictQuestion() and canWithdrawForecast() to allow UPCOMING/APPROVED cases with open_time present; backend validation now checks open_time existence only.
Forecast availability types & helpers
front_end/src/types/question.ts, front_end/src/utils/questions/forecastAvailability.ts
Added optional isAggregationsEmpty? and isMyForecastsEmpty?; availability helpers compute these and derive isEmpty.
Predict button & action integration
.../action_buttons/index.tsx, .../action_buttons/question_predict_button.tsx
Include isPostPrePrediction in predictability checks and render prePredict label when applicable.
ForecastMaker label threading
front_end/src/components/forecast_maker/index.tsx, .../forecast_maker_question/*, .../forecast_maker_group/*, .../forecast_maker_conditional/*, .../forecast_maker/forecast_expiration.tsx, .../continuous_group_accordion/*, .../forecast_maker_group/continuous_input_wrapper.tsx
Introduce predictLabel prop across forecast maker components; use it instead of hardcoded t("predict"); propagate label to PredictButton/ForecastExpirationModal; adjust UI enablement for UPCOMING questions.
Message & card rendering
front_end/src/components/forecast_maker/prediction_status_message.tsx, front_end/src/components/detailed_question_card/detailed_question_card/index.tsx
Switch UPCOMING message key to prePredictionMessage and adjust detailed card early-return when aggregations are empty for APPROVED posts.

Sequence Diagram

sequenceDiagram
    participant UI as User Interface
    participant Button as Predict Button
    participant FM as ForecastMaker
    participant Utils as Prediction Utils
    participant API as Backend API
    participant DB as Database

    UI->>Button: View UPCOMING question
    Button->>Utils: isPostPrePrediction(post)?
    Utils-->>Button: true (open_time present & future)
    Button->>UI: Render "Pre‑Predict"

    UI->>Button: Click "Pre‑Predict"
    Button->>FM: Open ForecastMaker(predictLabel)
    FM->>UI: Show modal with predictLabel
    UI->>FM: Submit pre-prediction
    FM->>API: POST forecast
    API->>Utils: canPredictQuestion(...)
    Utils-->>API: validation OK (UPCOMING with open_time)
    API->>DB: Save forecast
    DB-->>API: Confirm
    API-->>FM: Success
    FM-->>UI: Show "This prediction is not scored yet..."
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • lsabor
  • ncarazon
  • hlbmtc

Poem

🐰
I tiptoe where questions sleep,
A little guess before they leap.
"Pre‑Predict" I softly say,
Scores will wait for opening day.
Hop, submit — the future's play!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: add pre-predictions' clearly and concisely describes the main feature addition, directly matching the core objective of implementing pre-predictions functionality.
Linked Issues check ✅ Passed All coding requirements from issue #3563 are met: 'Pre-Predict' button labels added across languages, pre-prediction message implemented, and robustness to open date edits ensured via open_time checks.
Out of Scope Changes check ✅ Passed All changes directly support pre-predictions feature: localization keys, UI button logic updates, forecast availability checks, and backend validation adjustments for open_time.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pre-predictions

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

🚀 Preview Environment

Your preview environment is ready!

Resource Details
🌐 Preview URL https://metaculus-pr-4557-feat-pre-predictions-preview.mtcl.cc
📦 Docker Image ghcr.io/metaculus/metaculus:feat-pre-predictions-782a904
🗄️ PostgreSQL NeonDB branch preview/pr-4557-feat-pre-predictions
Redis Fly Redis mtc-redis-pr-4557-feat-pre-predictions

Details

  • Commit: 92fc13fe9d29377921a51c340dd685b7e1df18d0
  • Branch: feat/pre-predictions
  • Fly App: metaculus-pr-4557-feat-pre-predictions

ℹ️ Preview Environment Info

Isolation:

  • PostgreSQL and Redis are fully isolated from production
  • Each PR gets its own database branch and Redis instance
  • Changes pushed to this PR will trigger a new deployment

Limitations:

  • Background workers and cron jobs are not deployed in preview environments
  • If you need to test background jobs, use Heroku staging environments

Cleanup:

  • This preview will be automatically destroyed when the PR is closed

@cemreinanc cemreinanc marked this pull request as ready for review March 30, 2026 13:52
Copy link
Copy Markdown
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.

Actionable comments posted: 8

Caution

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

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

15-20: ⚠️ Potential issue | 🟠 Major

Use pre-prediction copy for UPCOMING pre-predictable posts too.

Line 15 still returns predictionUpcomingMessage, so upcoming questions in the pre-prediction flow can show the old message instead of the required pre-prediction message.

🔧 Suggested fix
+import { isPostPrePrediction } from "@/utils/questions/predictions";
+
 const PredictionStatusMessage: FC<Props> = ({ post }) => {
   const t = useTranslations();
+
+  if (isPostPrePrediction(post)) {
+    return <>{t("prePredictionMessage")}</>;
+  }

   switch (post.status) {
     case PostStatus.UPCOMING: {
       return <>{t("predictionUpcomingMessage")}</>;
     }
     case PostStatus.APPROVED: {
-      if (Date.parse(post.open_time) > Date.now()) {
-        return <>{t("prePredictionMessage")}</>;
-      }
       return null;
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@front_end/src/components/forecast_maker/prediction_status_message.tsx` around
lines 15 - 20, The UPCOMING branch in prediction_status_message.tsx currently
always returns t("predictionUpcomingMessage") but should use the pre-prediction
copy for posts that are still in the pre-prediction window (same condition used
in the APPROVED branch). Update the PostStatus.UPCOMING case to check the
post.open_time (Date.parse(post.open_time) > Date.now()) and return
t("prePredictionMessage") when that condition is true, otherwise fall back to
t("predictionUpcomingMessage"); mirror the logic used in the PostStatus.APPROVED
branch so both statuses show the pre-prediction copy for pre-predictable posts.
front_end/src/components/forecast_maker/forecast_maker_group/forecast_maker_group_binary.tsx (1)

228-239: ⚠️ Potential issue | 🔴 Critical

UPCOMING group rows are still dropped from the submit payload.

Line 231 only keeps OPEN questions, even though Lines 390-392 now let users edit UPCOMING rows. Any pre-prediction entered in a group will be silently discarded on submit.

🐛 Minimal fix
   return questionOptions.filter((option) => {
-    if (option.status !== QuestionStatus.OPEN) return false;
+    if (
+      option.status !== QuestionStatus.OPEN &&
+      option.status !== QuestionStatus.UPCOMING
+    ) {
+      return false;
+    }
     if (option.isDirty) return true;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@front_end/src/components/forecast_maker/forecast_maker_group/forecast_maker_group_binary.tsx`
around lines 228 - 239, The submit filter in questionsToSubmit currently drops
any UPCOMING rows because it only allows QuestionStatus.OPEN; update the
predicate to include UPCOMING so pre-predictions entered in group rows are
preserved. Specifically, in the useMemo that defines questionsToSubmit (variable
questionOptions filter), change the initial status check to allow option.status
=== QuestionStatus.OPEN || option.status === QuestionStatus.UPCOMING (or invert
to return false only when status is neither OPEN nor UPCOMING), keeping the rest
of the dirty/predicted logic intact; this ensures entries editable by the picker
(see isPickerDirty, hasSomeActiveUserForecasts, and isOpenQuestionPredicted) are
included in the submit payload.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@front_end/messages/es.json`:
- Line 19: The "prePredict" translation value uses "Pre-Predecir" which sounds
unnatural; update the ES string value for the "prePredict" key to a concise,
natural Spanish CTA such as "Predecir" (replace the value for the "prePredict"
key with "Predecir").

In
`@front_end/src/components/detailed_question_card/detailed_question_card/index.tsx`:
- Around line 57-58: Remove the debug console.log calls that print
"forecastAvailability" and "status" from the DetailedQuestionCard component
(index.tsx) — locate the two console.log("forecastAvailability",
forecastAvailability) and console.log("status", status) statements and delete
them so no debug logging remains in production; if you need runtime inspection
keep a guarded logger or use React DevTools instead.

In
`@front_end/src/components/forecast_maker/forecast_maker_conditional/forecast_maker_conditional_continuous.tsx`:
- Around line 791-792: questions for upcoming conditional branches are being
filtered out because questionsToSubmit only includes QuestionStatus.OPEN, and
handlePredictSubmit returns early for upcoming branches; update the logic so
upcoming questions are treated as submittable: modify the questionsToSubmit
construction to include both QuestionStatus.OPEN and the upcoming status (e.g.,
QuestionStatus.UPCOMING) and/or adjust handlePredictSubmit to not return early
for upcoming branch submissions (ensure it validates and includes upcoming
questions in the submission path); reference the variables/functions
questionsToSubmit and handlePredictSubmit and the constant QuestionStatus.OPEN
(and QuestionStatus.UPCOMING) as the places to change so both the inline predict
button and modal will submit for upcoming branches.

In
`@front_end/src/components/forecast_maker/forecast_maker_group/continuous_input_wrapper.tsx`:
- Around line 282-285: The current render condition uses the group-level
canPredict to enable controls for UPCOMING rows; change it to also require the
row's own open_time and that it has passed. Specifically, update the conditional
that references QuestionStatus.UPCOMING (and the similar check at the other
location) to only allow editing when option.question.open_time is present and
Date.now() (or new Date()) is >= new Date(option.question.open_time). Keep
existing canPredict but AND it with the per-row check on
option.question.open_time so UPCOMING rows without a valid/opened open_time
remain gated.

In `@front_end/src/components/forecast_maker/index.tsx`:
- Around line 28-29: The pre-predict label should be derived from the same
predictability predicate used elsewhere instead of calling isPostPrePrediction;
replace the isPrePrediction assignment to use the canonical predictability
function (e.g., isPredictable, canPredictPost, or whatever predicate your
codebase uses for "forecastable" checks) and base predictLabel on that result
(keep predictLabel = isPrePrediction ? t("prePredict") : t("predict")), removing
the isPostPrePrediction usage so open_time > now gating no longer causes stale
UPCOMING cases to show the wrong CTA.

In `@front_end/src/utils/questions/predictions.ts`:
- Around line 94-97: The nil-check for open_time is too narrow: replace the
current strict "!== undefined" check on conditional.condition_child.open_time
with the same null/undefined check used elsewhere (e.g., use != null or an
explicit !== undefined && !== null) so that null values are treated as missing;
update the return expression that uses conditionClosedOrResolved and
conditional.condition_child.open_time accordingly to match the other branches'
behavior.
- Around line 24-35: isPostPrePrediction's group branch is using
QuestionStatus.UPCOMING instead of checking each question's open_time, causing
stale pre-prediction labels; update the group_of_questions branch in
isPostPrePrediction to mirror the single-question logic by comparing each
question.open_time to now (use isNil and parseISO like the post.question branch)
— i.e., return true only if every question has a non-nil open_time and
parseISO(open_time) > now for all entries in post.group_of_questions.questions.

In `@questions/views.py`:
- Around line 120-126: The guard change lets pre-open forecasts be created but
create_forecast_bulk() -> create_forecast() currently persists forecasts with
start_time=now, causing them to be picked up by the aggregation (which filters
by start_time__lte=timezone.now()); modify create_forecast() so when given a
Question whose open_time is in the future it sets the persisted forecast's
start_time to question.open_time (instead of timezone.now()), or alternatively
update the aggregation query to explicitly exclude forecasts with start_time >
question.open_time; make the change in the create_forecast() implementation
called by create_forecast_bulk() and ensure the same logic covers the other
creation path referenced around the 199-203 area.

---

Outside diff comments:
In
`@front_end/src/components/forecast_maker/forecast_maker_group/forecast_maker_group_binary.tsx`:
- Around line 228-239: The submit filter in questionsToSubmit currently drops
any UPCOMING rows because it only allows QuestionStatus.OPEN; update the
predicate to include UPCOMING so pre-predictions entered in group rows are
preserved. Specifically, in the useMemo that defines questionsToSubmit (variable
questionOptions filter), change the initial status check to allow option.status
=== QuestionStatus.OPEN || option.status === QuestionStatus.UPCOMING (or invert
to return false only when status is neither OPEN nor UPCOMING), keeping the rest
of the dirty/predicted logic intact; this ensures entries editable by the picker
(see isPickerDirty, hasSomeActiveUserForecasts, and isOpenQuestionPredicted) are
included in the submit payload.

In `@front_end/src/components/forecast_maker/prediction_status_message.tsx`:
- Around line 15-20: The UPCOMING branch in prediction_status_message.tsx
currently always returns t("predictionUpcomingMessage") but should use the
pre-prediction copy for posts that are still in the pre-prediction window (same
condition used in the APPROVED branch). Update the PostStatus.UPCOMING case to
check the post.open_time (Date.parse(post.open_time) > Date.now()) and return
t("prePredictionMessage") when that condition is true, otherwise fall back to
t("predictionUpcomingMessage"); mirror the logic used in the PostStatus.APPROVED
branch so both statuses show the pre-prediction copy for pre-predictable posts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e50cc15d-f48c-46f8-85d7-4c76c7b579c1

📥 Commits

Reviewing files that changed from the base of the PR and between e04276e and d2d78fc.

📒 Files selected for processing (28)
  • front_end/messages/cs.json
  • front_end/messages/en.json
  • front_end/messages/es.json
  • front_end/messages/pt.json
  • front_end/messages/zh-TW.json
  • front_end/messages/zh.json
  • front_end/src/app/(main)/questions/[id]/components/question_view/consumer_question_view/action_buttons/index.tsx
  • front_end/src/app/(main)/questions/[id]/components/question_view/consumer_question_view/action_buttons/question_predict_button.tsx
  • front_end/src/components/detailed_question_card/detailed_question_card/index.tsx
  • front_end/src/components/forecast_maker/continuous_group_accordion/group_forecast_accordion.tsx
  • front_end/src/components/forecast_maker/forecast_expiration.tsx
  • front_end/src/components/forecast_maker/forecast_maker_conditional/forecast_maker_conditional_binary.tsx
  • front_end/src/components/forecast_maker/forecast_maker_conditional/forecast_maker_conditional_continuous.tsx
  • front_end/src/components/forecast_maker/forecast_maker_conditional/index.tsx
  • front_end/src/components/forecast_maker/forecast_maker_group/continuous_input_wrapper.tsx
  • front_end/src/components/forecast_maker/forecast_maker_group/forecast_maker_group_binary.tsx
  • front_end/src/components/forecast_maker/forecast_maker_group/forecast_maker_group_continuous.tsx
  • front_end/src/components/forecast_maker/forecast_maker_group/index.tsx
  • front_end/src/components/forecast_maker/forecast_maker_question/forecast_maker_binary.tsx
  • front_end/src/components/forecast_maker/forecast_maker_question/forecast_maker_continuous.tsx
  • front_end/src/components/forecast_maker/forecast_maker_question/forecast_maker_multiple_choice.tsx
  • front_end/src/components/forecast_maker/forecast_maker_question/index.tsx
  • front_end/src/components/forecast_maker/index.tsx
  • front_end/src/components/forecast_maker/prediction_status_message.tsx
  • front_end/src/types/question.ts
  • front_end/src/utils/questions/forecastAvailability.ts
  • front_end/src/utils/questions/predictions.ts
  • questions/views.py

Comment on lines +282 to +285
if (
(option.question.status === QuestionStatus.OPEN ||
option.question.status === QuestionStatus.UPCOMING) &&
canPredict
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Gate UPCOMING rows on the row’s own open_time.

canPredict here is group-level, so another question can make it true for this wrapper. With the new status checks, an individual UPCOMING row still renders controls and becomes editable even when option.question.open_time is missing, but the backend still rejects that submission.

Suggested fix
   const predictButtonIsDisabled =
     forecastInputMode === ContinuousForecastInputType.Slider
       ? option.userSliderForecast === null &&
         option.question.status !== QuestionStatus.OPEN
       : validateAllQuantileInputs({
           question: option.question,
           components: option.userQuantileForecast,
           t,
         }).length !== 0 || !isNil(submitError);
+  const isQuestionForecastable =
+    !isNil(option.question.open_time) &&
+    (option.question.status === QuestionStatus.OPEN ||
+      option.question.status === QuestionStatus.UPCOMING);
 
-  if (
-    (option.question.status === QuestionStatus.OPEN ||
-      option.question.status === QuestionStatus.UPCOMING) &&
-    canPredict
-  ) {
+  if (canPredict && isQuestionForecastable) {
     SubmitControls = (
       <>
         <FormError
@@
           disabled={
-            !canPredict ||
-            (option.question.status !== QuestionStatus.OPEN &&
-              option.question.status !== QuestionStatus.UPCOMING)
+            !canPredict || !isQuestionForecastable
           }

Also applies to: 421-423

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@front_end/src/components/forecast_maker/forecast_maker_group/continuous_input_wrapper.tsx`
around lines 282 - 285, The current render condition uses the group-level
canPredict to enable controls for UPCOMING rows; change it to also require the
row's own open_time and that it has passed. Specifically, update the conditional
that references QuestionStatus.UPCOMING (and the similar check at the other
location) to only allow editing when option.question.open_time is present and
Date.now() (or new Date()) is >= new Date(option.question.open_time). Keep
existing canPredict but AND it with the per-row check on
option.question.open_time so UPCOMING rows without a valid/opened open_time
remain gated.

Comment on lines +28 to +29
const isPrePrediction = isPostPrePrediction(post);
const predictLabel = isPrePrediction ? t("prePredict") : t("predict");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Derive the pre-predict label from the same predicate as predictability.

Line 28 reintroduces the old open_time > now gate via isPostPrePrediction(). The rest of this flow now admits stale UPCOMING + open_time cases so open-date edits stay forecastable; in that state the user can still enter the maker, but this component drops back to a plain Predict CTA.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@front_end/src/components/forecast_maker/index.tsx` around lines 28 - 29, The
pre-predict label should be derived from the same predictability predicate used
elsewhere instead of calling isPostPrePrediction; replace the isPrePrediction
assignment to use the canonical predictability function (e.g., isPredictable,
canPredictPost, or whatever predicate your codebase uses for "forecastable"
checks) and base predictLabel on that result (keep predictLabel =
isPrePrediction ? t("prePredict") : t("predict")), removing the
isPostPrePrediction usage so open_time > now gating no longer causes stale
UPCOMING cases to show the wrong CTA.

Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
front_end/src/components/forecast_maker/forecast_maker_conditional/forecast_maker_conditional_continuous.tsx (1)

839-853: Minor inconsistency in predictLabel handling between modal and inline button.

The inline PredictButton (line 793) conditionally omits predictLabel when a previousForecast exists, while ForecastExpirationModal always receives predictLabel. This means the modal's submit button will show "Pre-Predict" even when the user is updating an existing forecast on an upcoming question.

If this is intentional, no action needed. If you want consistent behavior, consider applying the same conditional logic:

Optional alignment
       <ForecastExpirationModal
         savedState={modalSavedState}
         setSavedState={setModalSavedState}
         isOpen={isForecastExpirationModalOpen}
         onClose={() => {
           setIsForecastExpirationModalOpen(false);
         }}
         onSubmit={handlePredictSubmit}
         isUserForecastActive={hasUserActiveForecast}
         isDirty={predictButtonIsDirty}
         hasUserForecast={hasUserForecast}
         isSubmissionDisabled={predictButtonIsDisabled}
         questionDuration={questionDuration}
-        predictLabel={predictLabel}
+        predictLabel={previousForecast ? undefined : predictLabel}
       />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@front_end/src/components/forecast_maker/forecast_maker_conditional/forecast_maker_conditional_continuous.tsx`
around lines 839 - 853, ForecastExpirationModal always receives predictLabel
while the inline PredictButton omits predictLabel when previousForecast exists,
causing inconsistent submit labels; make behavior consistent by passing
predictLabel to ForecastExpirationModal conditionally the same way as in the
inline button (use the same previousForecast check used when rendering
PredictButton), or update PredictButton to always follow the modal's logic;
locate ForecastExpirationModal and PredictButton usages and apply the same
conditional expression on predictLabel (refer to predictLabel, previousForecast,
ForecastExpirationModal, and PredictButton) so both UI paths show the same label
for new vs. existing forecasts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@front_end/src/components/forecast_maker/forecast_maker_conditional/forecast_maker_conditional_continuous.tsx`:
- Around line 839-853: ForecastExpirationModal always receives predictLabel
while the inline PredictButton omits predictLabel when previousForecast exists,
causing inconsistent submit labels; make behavior consistent by passing
predictLabel to ForecastExpirationModal conditionally the same way as in the
inline button (use the same previousForecast check used when rendering
PredictButton), or update PredictButton to always follow the modal's logic;
locate ForecastExpirationModal and PredictButton usages and apply the same
conditional expression on predictLabel (refer to predictLabel, previousForecast,
ForecastExpirationModal, and PredictButton) so both UI paths show the same label
for new vs. existing forecasts.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eef1f18d-1efc-4a4f-8e57-2697e4c058f9

📥 Commits

Reviewing files that changed from the base of the PR and between d2d78fc and 782a904.

📒 Files selected for processing (12)
  • front_end/messages/cs.json
  • front_end/messages/en.json
  • front_end/messages/es.json
  • front_end/messages/pt.json
  • front_end/messages/zh-TW.json
  • front_end/messages/zh.json
  • front_end/src/components/detailed_question_card/detailed_question_card/index.tsx
  • front_end/src/components/forecast_maker/forecast_maker_conditional/forecast_maker_conditional_continuous.tsx
  • front_end/src/components/forecast_maker/forecast_maker_group/continuous_input_wrapper.tsx
  • front_end/src/components/forecast_maker/forecast_maker_group/forecast_maker_group_binary.tsx
  • front_end/src/components/forecast_maker/prediction_status_message.tsx
  • front_end/src/utils/questions/predictions.ts
✅ Files skipped from review due to trivial changes (5)
  • front_end/messages/cs.json
  • front_end/messages/pt.json
  • front_end/messages/en.json
  • front_end/messages/zh-TW.json
  • front_end/messages/zh.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • front_end/src/components/forecast_maker/prediction_status_message.tsx
  • front_end/src/components/detailed_question_card/detailed_question_card/index.tsx
  • front_end/messages/es.json
  • front_end/src/components/forecast_maker/forecast_maker_group/continuous_input_wrapper.tsx
  • front_end/src/utils/questions/predictions.ts

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.

Pre-Predictions

1 participant