Skip to content

fix(ui): rename duplicate trainFamily binding in forecast page#308

Merged
w7-mgfcode merged 1 commit into
devfrom
fix/forecast-train-family-duplicate
May 26, 2026
Merged

fix(ui): rename duplicate trainFamily binding in forecast page#308
w7-mgfcode merged 1 commit into
devfrom
fix/forecast-train-family-duplicate

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

Summary

  • Renames the PRP-31 derived trainFamily (L120, sourced from useJobFeatureMetadata) to loadedTrainFamily.
  • Updates the single consumer at L497–498 (ModelFamilyBadge in the "Model details" collapsible).
  • The PRP-37 Slice C train-card form state (trainFamily at L68 via useState) keeps its name.

Fixes #307 — without this, Babel/Vite reject forecast.tsx with Cannot redeclare block-scoped variable 'trainFamily'; tsc reports TS2451 at both sites; the Forecast page (/visualize/forecast) never mounts.

Discovered while running the PRP-37 Task 26 dogfood against the merged dev (5e86b6f).

Test plan

  • tsc --noEmit -p tsconfig.app.json no longer emits the two TS2451 redeclaration errors at forecast.tsx:68/120.
  • vitest run over src/components/forecast-intelligence/, src/components/charts/backtest-horizon-buckets-chart.test.tsx, src/lib/feature-frame-utils.test.ts, src/lib/horizon-bucket-utils.test.ts — 81/81 pass.
  • Manual dogfood (vite --host 0.0.0.0 + Playwright on /snap/bin/chromium): the Forecast Visualization page now renders the PRP-37 Train-a-new-model card (Family segmented control, Model select, Feature frame V1/V2 picker, Store/Product/Date inputs); 9/9 PRP-37 surfaces pass.

PRP-37 introduced `trainFamily` as the train-card form state (useState at
L68), shadowing an existing PRP-31 derived `trainFamily` at L120 sourced
from `useJobFeatureMetadata`. Babel/Vite reject the file with `Cannot
redeclare block-scoped variable 'trainFamily'`; tsc reports TS2451 at
both sites. The forecast page does not mount.

Rename L120 to `loadedTrainFamily` (distinct semantics: derived from a
loaded predict job's training metadata, used by the `ModelFamilyBadge`
in the Model details collapsible). The L68 form state keeps the
`trainFamily` name.
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2efd1c68-f6b3-40e4-9ed9-41c52db0b0bf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/forecast-train-family-duplicate

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.

@w7-mgfcode w7-mgfcode merged commit 48cddf3 into dev May 26, 2026
8 checks passed
@w7-mgfcode w7-mgfcode deleted the fix/forecast-train-family-duplicate branch May 26, 2026 09:17
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.

1 participant