fix(compare): render all-secondary comparisons — re-run phase detection after basket hydration
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
This commit is contained in:
@@ -173,7 +173,11 @@ export function ComparisonView({
|
||||
if (!metricFitsPhase) {
|
||||
setSelectedMetric(newPhase === 'secondary' ? 'attainment_8_score' : 'rwm_expected_pct');
|
||||
}
|
||||
}, [comparisonData]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
// selectedSchools is a dep because the basket hydrates after mount: the
|
||||
// first run sees an empty basket and bails, so it must re-fire when the
|
||||
// schools arrive. primarySchools/secondarySchools/metrics/selectedMetric
|
||||
// are intentionally omitted (derived or would cause loops).
|
||||
}, [comparisonData, selectedSchools]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const handlePhaseChange = (phase: 'primary' | 'secondary') => {
|
||||
phaseLockedByUser.current = true;
|
||||
|
||||
Reference in New Issue
Block a user