fix(ui): rename duplicate trainFamily binding in forecast page#308
Conversation
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.
There was a problem hiding this comment.
Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults 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)
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 |
Summary
trainFamily(L120, sourced fromuseJobFeatureMetadata) toloadedTrainFamily.ModelFamilyBadgein the "Model details" collapsible).trainFamilyat L68 viauseState) keeps its name.Fixes #307 — without this, Babel/Vite reject
forecast.tsxwithCannot redeclare block-scoped variable 'trainFamily'; tsc reportsTS2451at 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.jsonno longer emits the twoTS2451redeclaration errors atforecast.tsx:68/120.vitest runoversrc/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.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.