Header.jsx UI component
The sticky top bar. Always visible above the semester timeline. Contains the plan title, credit hour counters, and all primary controls: theme, zoom, plan management, cohort settings, PDF export, and the relationship legend.
Layout structure
Popover controls
Cohort popup (showSettings)
Triggered by "π Cohort". Contains entry/graduation semester + year pickers and the sticky-courses toggle. Hidden on phones.
- Entry: Fall/Spring radio + βyearβΆ stepper
- Graduation: Fall/Spring radio + βyearβΆ stepper
- Validation: graduation ordinal must exceed entry ordinal
- Summary: "Fall 2026 β Spring 2031 (~5 yrs)"
- π Sticky: on/off toggle
Settings popup (showAppSettings)
Triggered by "β". On phone this also contains the Cohort picker (since the standalone cohort button is hidden). Contains toggles for display preferences, a theme cycler, and links.
- Error lines β toggle
showViolLines; when on, red prerequisite-order and corequisite-violation lines are always drawn across all placed courses - Continuation logo β toggle
showContLogo(default on); when on, continuation rows for co-op/internship blocks show the company logo. Persisted asncp-show-cont-logo - Collapse other credits β toggle
collapseOtherCredits; controls whether the β€2 SH section starts collapsed. Persisted asncp-collapse-other-credits - Theme β cycles through available themes (light, dark, β¦)
- LINKS β
/devopens the dev portal;/documentationopens this site. Both open in a new tab.
Plan management dropdown (showPlanMenu)
Opens on clicking the plan name. Lists all saved plans. Actions: New plan, switch to a plan, rename (inline edit), delete. Closes on any outside click.
Import/Export (showIO)
- Export JSON: downloads current plan as
plan-name.json - Import JSON:
<input type="file">βimportPlanJSON(file) - Export PDF: calls
exportReport()from planModel.js β opens print window - Copy as text:
handleCopyHumanReadable()β builds a plain-text plan summary and copies to clipboard
Key functions
gradInfo parameter (major path, NUPath coverage, done course keys, etc.) and calls exportReport() from planModel.js. This triggers the async PDF build and opens a new print window.themeNames, increments modulo length, calls setThemeName(). The button displays a β or theme name depending on viewport size.YearStepper helper component
A small βyearβΆ widget defined at the bottom of Header.jsx. Props: year, canDec, canInc, onDec, onInc. Used in both the entry and graduation pickers.
Co-op/graduation conflict warning
If any co-op block overlaps the graduation semester (i.e., it starts before graduation but ends after it), Header renders a yellow warning banner below the controls row. The affected co-op names are listed. Computed by PlannerContext as coopGradConflicts.