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.
1.6 KiB
1.6 KiB
ADDED Requirements
Requirement: Synthesized completed plan when all sets are pinned
When openSetIds.length === 0 (every elective set has a pinned course), useAppState SHALL emit a single-element topPlans array containing a synthesized PlanOutcome rather than clearing the slice. The synthesized plan's fields SHALL be:
courseAssignments: thepinnedAssignmentsmap (setId → courseId for every elective set)achievedSpecs:optimizationResult.achieved(the optimizer's output for the same selection)priorityScore:makePriorityScorer(state.ranking)(achievedSpecs)
The other state slices (treeResults, topPlansPartial, searchProgress, treeLoading) SHALL remain in their cleared/null state for this branch — no decision-tree search runs when there are no open sets.
Scenario: Top Plans state populates after every set is pinned
- WHEN the user pins a course in the final remaining open set
- THEN
topPlansSHALL contain exactly one element whosecourseAssignmentsmatches the user's pinned selection - AND that element's
achievedSpecsSHALL equaloptimizationResult.achieved
Scenario: Search progress remains null when selection is complete
- WHEN every elective set is pinned
- THEN
searchProgressSHALL benullandtreeLoadingSHALL befalse
Scenario: Unpinning resumes normal search
- WHEN the user unpins one course after the synthesized state was emitted
- THEN the search effect SHALL run normally (cache filter, partial worker spawn) and
topPlansSHALL reflect the cached subset and any streamed improvements