cb2024f857
Once every elective set is pinned, the Top Plans panel now renders the user's completed selection as a single "Your Plan" card showing the achievement count and pinned courses. Previously the panel went blank because the all-pinned branch in useAppState cleared topPlans, even though the spec strip was already showing the achievement. Synthesizes a single PlanOutcome from pinnedAssignments + optimizationResult.achieved + the priority scorer; TopPlans detects the all-pinned state via ELECTIVE_SETS.every(...) and bypasses the length>0 filter so a 0-spec completed plan still renders honestly.
2.2 KiB
2.2 KiB
ADDED Requirements
Requirement: Top Plans renders the synthesized completed plan
The TopPlans panel SHALL detect the all-pinned state by checking that every elective set in ELECTIVE_SETS has a non-null pinnedCourses[setId]. In that state, the panel SHALL bypass the existing achievedSpecs.length > 0 visibility filter and render every plan in the input list (which is guaranteed to be exactly one synthesized plan).
Scenario: Completed plan with achievements renders normally
- WHEN the user has pinned every set and the synthesized plan reports 3 achieved specs
- THEN the panel SHALL render a single
PlanRowshowing those 3 specs and the 12 pinned courses
Scenario: Completed plan with zero achievements still renders
- WHEN the user has pinned every set but the achieved set is empty
- THEN the panel SHALL render a single
PlanRowshowing0achievements and the 12 pinned courses - AND the panel SHALL NOT show the "No plans yet achieve a specialization…" placeholder
Requirement: Top Plans header reflects single completed plan
When the all-pinned state is detected, the panel header SHALL read "Your Plan" instead of "Top Plans". The "ranked by specs achieved" subtitle SHALL be omitted when only the single completed plan is shown.
Scenario: Header copy switches when selection is complete
- WHEN every elective set is pinned
- THEN the panel header SHALL display "Your Plan"
- AND the "ranked by specs achieved" subtitle SHALL NOT appear
Scenario: Header copy reverts on unpin
- WHEN the user unpins a course after a completed-plan state
- THEN the panel header SHALL revert to "Top Plans" and the subtitle SHALL reappear once the multi-plan list is populated
Requirement: Adopt button remains harmless on the synthesized plan
The adopt button on the synthesized plan SHALL remain interactive. Clicking it SHALL be a no-op in effect (every set is already pinned to that course) but SHALL NOT throw or otherwise misbehave.
Scenario: Adopt on completed plan
- WHEN the user clicks adopt on the synthesized completed plan
- THEN the application state SHALL remain unchanged and no error SHALL occur