diff --git a/src/components/ScenarioEditModal.js b/src/components/ScenarioEditModal.js index 7bd0ae2..5b20cb4 100644 --- a/src/components/ScenarioEditModal.js +++ b/src/components/ScenarioEditModal.js @@ -3,6 +3,7 @@ import authFetch from '../utils/authFetch.js'; import { simulateFinancialProjection } from '../utils/FinancialProjectionService.js'; import { Button } from './ui/button.js'; import parseFloatOrZero from '../utils/ParseFloatorZero.js'; +import InfoTooltip from "./ui/infoTooltip.js"; // Data paths const CIP_URL = '/cip_institution_mapping_new.json'; @@ -49,6 +50,26 @@ export default function ScenarioEditModal({ * 5) Combined formData => scenario + college *********************************************************/ const [formData, setFormData] = useState({}); + const [showCollegeForm, setShowCollegeForm] = useState(false); + + + /********************************************************* + * Auto-expand the college section each time the modal opens. + * -------------------------------------------------------- + * ❑ The effect runs exactly once per modal–open (`show` → true). + * ❑ If the saved scenario already says the user is + * ‘currently_enrolled’ or ‘prospective_student’ + * we open the section so they immediately see their data. + * ❑ Once open, the user can click Hide/Show; we *don’t* re-run + * on every keystroke, so the effect won’t fight the button. + *********************************************************/ + useEffect(() => { + if (!show) return; + setShowCollegeForm( + ['currently_enrolled', 'prospective_student'] + .includes(formData.college_enrollment_status) + ); +}, [show]); /********************************************************* * 6) On show => load CIP, IPEDS, CAREERS @@ -844,43 +865,57 @@ if (formData.retirement_start_date) { - {/* SECTION: College Profile */} -

College Profile

- {(formData.college_enrollment_status === 'currently_enrolled' || - formData.college_enrollment_status === 'prospective_student') ? ( + {/* ───────── COLLEGE PROFILE heading + Add plan ───────── */} + +
+ {/* left cluster (title + info badge) */} +
+

College Profile

+ +
+ + {/* right cluster (toggle button) */} + +
+ + {/* Collapse / expand the full set of inputs */} + {showCollegeForm ? ( <> - {/* District/State/Online */} + {/* District / State / Online check-boxes ------------------ */}
- - - + {[ + { name: 'is_in_district', label: 'In District' }, + { name: 'is_in_state', label: 'In State' }, + { name: 'is_online', label: 'Fully Online' } + ].map(({ name, label }) => ( + + ))}
{/* Loan Deferral */} @@ -1183,7 +1218,7 @@ if (formData.retirement_start_date) { ) : (

- Not currently enrolled or prospective. Minimal college fields only. + Not currently enrolled or prospective. Add a plan to enter this info.

)}