|
1 | 1 | // TODO (volunteer tickets): |
2 | | -// - Drag-and-drop courses between terms |
3 | | -// - Course palette sidebar with draggable course cards |
4 | | -// - Autocomplete on the course input |
5 | | -// - Co-op term special rendering (when COOP courses are added) |
6 | | -// - Configurable program length (not always 8 terms) |
7 | | -// - Polished violation rendering (cards, line numbers, jump-to) |
8 | | -// - Plan export/import as JSON |
9 | | -// - Share plan via URL hash |
10 | | -// - Reset plan button with confirm dialog |
11 | | -// - Render elective placeholder entries (with category label, italic, distinct border color) |
12 | | -// - Render choose-from-set entries (with credit count + description) |
13 | | -// - "Start from template" dropdown at the top of the planner; loads a ProgramTemplate via the store's loadTemplate action |
14 | | -// - Template freshness disclaimer banner shown when a template is loaded (uses validFor and lastReviewed fields) |
15 | | -// - First curated template content: BCS General (separate PR, content not engineering) |
16 | | -// - Subsequent templates: BCS Honours, BCS SE Stream, BCS AI Stream, BMath Data Science, Cybersecurity minor |
17 | | -// - In-planner course detail panel (shared component with Explorer) |
18 | | -// - In-planner prereq highlighting (click a course, highlight its prereqs in earlier terms and unlocks in later terms) |
| 2 | +// - Course palette panel + drag-and-drop course tiles onto slots (see CoursePalette) |
| 3 | +// - Prereq validation: re-add the violation banner (validatePlan + ViolationList |
| 4 | +// still exist; map each term's slots → compact entries, dropping nulls) |
| 5 | +// - "Start from template" dropdown (store's loadTemplate) + freshness disclaimer |
| 6 | +// - Render elective / choose entry kinds as styled tiles |
| 7 | +// - "Add slot" / drag-overflow to grow a term up to MAX_SLOTS_PER_TERM |
| 8 | +// - Add / remove terms (summer, year 5+); co-op term rendering |
| 9 | +// - Prereq connector lines between slots; in-planner course detail panel |
| 10 | +// - Plan export/import as JSON; share via URL hash; reset-plan button |
19 | 11 |
|
20 | | -import { useMemo } from 'react'; |
21 | | -import { usePlannerStore, termLabel } from '@/store/plannerStore'; |
22 | | -import { courses } from '@/data/loadCourses'; |
23 | | -import { validatePlan } from '@/lib/validatePlan'; |
24 | | -import TermCell from '@/components/TermCell'; |
25 | | -import ViolationList from '@/components/ViolationList'; |
| 12 | +import { usePlannerStore } from '@/store/plannerStore'; |
| 13 | +import CoursePalette from '@/components/CoursePalette'; |
| 14 | +import TermGrid from '@/components/TermGrid'; |
26 | 15 |
|
27 | 16 | export default function Planner() { |
28 | 17 | const terms = usePlannerStore((s) => s.terms); |
29 | 18 |
|
30 | | - const violations = useMemo( |
31 | | - () => |
32 | | - validatePlan( |
33 | | - terms.map((t) => ({ |
34 | | - termId: t.id, |
35 | | - label: termLabel(t), |
36 | | - entries: t.entries, |
37 | | - })), |
38 | | - courses, |
39 | | - ), |
40 | | - [terms], |
41 | | - ); |
42 | | - |
43 | 19 | return ( |
44 | | - <div className="flex h-full flex-col gap-4 overflow-y-auto p-4"> |
45 | | - <ViolationList violations={violations} /> |
| 20 | + <div className="flex h-full overflow-hidden"> |
| 21 | + <CoursePalette /> |
46 | 22 |
|
47 | | - <p className="rounded bg-yellow-100 px-3 py-2 text-sm text-yellow-800"> |
48 | | - This tool validates prerequisite ordering only. It does not check |
49 | | - whether courses are offered in specific terms. Verify with the |
50 | | - registrar. |
51 | | - </p> |
| 23 | + <main className="flex flex-1 flex-col gap-4 overflow-auto p-4"> |
| 24 | + <p className="rounded bg-yellow-100 px-3 py-2 text-sm text-yellow-800"> |
| 25 | + This tool validates prerequisite ordering only. It does not check |
| 26 | + whether courses are offered in specific terms. Verify with the |
| 27 | + registrar. |
| 28 | + </p> |
52 | 29 |
|
53 | | - <div className="grid grid-cols-2 gap-3"> |
54 | | - {terms.map((term) => ( |
55 | | - <TermCell |
56 | | - key={term.id} |
57 | | - termId={term.id} |
58 | | - label={termLabel(term)} |
59 | | - entries={term.entries} |
60 | | - /> |
61 | | - ))} |
62 | | - </div> |
| 30 | + <TermGrid terms={terms} /> |
| 31 | + </main> |
63 | 32 | </div> |
64 | 33 | ); |
65 | 34 | } |
0 commit comments