From 526066b64bb4dd116028cabf3b264abf9ec48107 Mon Sep 17 00:00:00 2001 From: Aikhan Jumashukurov <117706338+aikhanj@users.noreply.github.com> Date: Thu, 5 Nov 2026 20:37:33 -0500 Subject: [PATCH] Add interactive semester planning with cancellable local search --- app/solver/README.md | 16 + app/src/client/components/SemesterLab.tsx | 1134 +++++++++++++++++++++ app/src/client/pages/PlannerPage.tsx | 27 +- app/src/client/scheduling/useSolver.ts | 53 + app/src/client/scheduling/worker.ts | 39 + app/src/client/styles/desk.css | 1 + app/src/client/styles/semester-lab.css | 997 ++++++++++++++++++ 7 files changed, 2259 insertions(+), 8 deletions(-) create mode 100644 app/src/client/components/SemesterLab.tsx create mode 100644 app/src/client/scheduling/useSolver.ts create mode 100644 app/src/client/scheduling/worker.ts create mode 100644 app/src/client/styles/semester-lab.css diff --git a/app/solver/README.md b/app/solver/README.md index 2ad3661..c7e630d 100644 --- a/app/solver/README.md +++ b/app/solver/README.md @@ -3,6 +3,8 @@ `schedule.cpp` is a freestanding C++17 finite-domain solver compiled to WebAssembly. It has no allocator, WASI dependency, network calls, or JavaScript imports. A TypeScript adapter validates inputs and decodes ranked answers. +Each request runs in a cancellable browser worker. Changing a constraint +terminates obsolete work, so it cannot overwrite a newer result. Each section group requires one option. An option can have several meetings. Hard constraints are nonoverlapping meetings, earliest start, latest finish, @@ -78,3 +80,17 @@ module compilation and instantiation, workers, conflict diagnosis, and rendering The fixtures are synthetic and repeated in a warm process. These measurements do not establish browser interaction latency, production tail latency, a speedup over another solver, or worst-case performance. There is no CI timing threshold. + +## Interactive planner + +Open a saved schedule in My Planner and choose Open semester lab. The lab uses +the original section payload and computes local alternatives. Protect a weekday +or a time interval, set earliest and latest times, lock a section, or change the +ranking objective. Pin a plan to compare changes and undo constraint edits. +Infeasible requests show conflict groups and verified relaxations. An unfinished +search remains explicitly unfinished. The lab never saves a new Junction +schedule, registers courses, or reserves seats. + +The component is lazy-loaded only when the lab is opened. While a constraint +change is being solved, the previous timetable is labeled as previous and its +controls are unavailable. No obsolete worker result can replace newer input. diff --git a/app/src/client/components/SemesterLab.tsx b/app/src/client/components/SemesterLab.tsx new file mode 100644 index 0000000..765f3af --- /dev/null +++ b/app/src/client/components/SemesterLab.tsx @@ -0,0 +1,1134 @@ +import { + useCallback, + useEffect, + useLayoutEffect, + useMemo, + useRef, + useState, +} from "react"; +import { + DEFAULT_CONSTRAINTS, + DAYS, + dayLabel, + timeLabel, + type Constraints, + type Diagnosis, + type Plan, + type ScheduleProblem, + type SectionGroup, +} from "../scheduling/model"; +import { useSolver } from "../scheduling/useSolver"; +import "../styles/semester-lab.css"; + +const COLORS = [ + "#c8e2cb", + "#f2d3ab", + "#c9e1ec", + "#ddd1ee", + "#f0ced8", + "#e7e2ad", +]; +const kind = (g: SectionGroup) => + ({ + L: "Lecture", + P: "Precept", + B: "Lab", + LA: "Lab", + S: "Seminar", + C: "Class", + })[g.category] ?? g.category; +const hours = Array.from({ length: 15 }, (_, i) => (i + 7) * 60); +const minutes = (n: number) => + n >= 60 ? `${Math.floor(n / 60)}h${n % 60 ? ` ${n % 60}m` : ""}` : `${n}m`; +const samePicks = (a: Plan, b: Plan) => + Object.keys(a.picks).every((id) => a.picks[id] === b.picks[id]); + +function Mark({ + type, + size = 16, +}: { + type: "lock" | "undo" | "pin" | "check" | "arrow" | "x"; + size?: number; +}) { + return ( + + ); +} + +export function SemesterLab({ problem }: { problem: ScheduleProblem }) { + const [constraints, setConstraints] = useState(() => ({ + ...DEFAULT_CONSTRAINTS, + objective: "changes", + locks: {}, + busy: [], + })); + const [history, setHistory] = useState([]); + const [active, setActive] = useState(0); + const [pinned, setPinned] = useState(null); + const [focusGroup, setFocusGroup] = useState(null); + const [copied, setCopied] = useState(false); + const [copyError, setCopyError] = useState(false); + const [detailsOpen, setDetailsOpen] = useState(false); + const [blockDay, setBlockDay] = useState(1); + const [blockStart, setBlockStart] = useState(16 * 60); + const [blockEnd, setBlockEnd] = useState(18 * 60); + const search = useSolver(problem, constraints); + const courses = useMemo( + () => [...new Set(problem.groups.map((g) => g.course))], + [problem], + ); + const color = (course: string) => + COLORS[courses.indexOf(course) % COLORS.length]; + const result = search.kind === "done" ? search.result : null; + const plan = + result?.plans[Math.min(active, Math.max(0, result.plans.length - 1))] ?? + null; + const previousPlan = useRef(null); + if (plan) previousPlan.current = plan; + const displayPlan = + plan ?? (search.kind === "loading" ? previousPlan.current : null); + const changed = + pinned && plan + ? problem.groups.filter((g) => pinned.picks[g.id] !== plan.picks[g.id]) + : []; + + const change = useCallback( + (next: Constraints) => { + setHistory((h) => [...h.slice(-29), constraints]); + setConstraints(next); + setActive(0); + setCopied(false); + setCopyError(false); + }, + [constraints], + ); + const undo = useCallback(() => { + if (!history.length) return; + setConstraints(history[history.length - 1]); + setHistory((h) => h.slice(0, -1)); + setActive(0); + }, [history]); + useEffect(() => { + const listener = (event: KeyboardEvent) => { + if ( + !(event.metaKey || event.ctrlKey) || + event.key.toLowerCase() !== "z" || + event.shiftKey + ) + return; + if ( + (event.target as HTMLElement)?.closest( + "input,select,textarea,[contenteditable=true]", + ) + ) + return; + if (history.length) { + event.preventDefault(); + undo(); + } + }; + window.addEventListener("keydown", listener); + return () => window.removeEventListener("keydown", listener); + }, [history.length, undo]); + const toggleLock = (group: SectionGroup, optionId: string) => { + const locks = { ...constraints.locks }; + if (locks[group.id] === optionId) delete locks[group.id]; + else locks[group.id] = optionId; + change({ ...constraints, locks }); + }; + const copy = async () => { + if (!plan) return; + const lines = [ + problem.title, + problem.source === "sample" + ? "SAMPLE DATA. These section times are synthetic." + : problem.term, + ]; + for (const group of problem.groups) { + const option = group.options.find((o) => o.id === plan.picks[group.id])!; + lines.push( + `${group.course} ${option.title}. ${option.meetings.map((m) => `${dayLabel(m.days)} ${timeLabel(m.start)} to ${timeLabel(m.end)}`).join(", ")}`, + ); + } + try { + await navigator.clipboard.writeText(lines.join("\n")); + setCopied(true); + setCopyError(false); + } catch { + setCopyError(true); + } + }; + const focused = problem.groups.find((g) => g.id === focusGroup); + const combinations = problem.groups.reduce((n, g) => n * g.options.length, 1); + + return ( +
+
+
+
PI / SEMESTER LAB
+

+ Your week, with room to breathe. +

+

Keep what matters. See what moves.

+
+
+ + +
+
+ +
+ + +
+
+
+ + + {search.kind === "loading" + ? displayPlan + ? "Updating. Previous timetable shown…" + : "Finding room…" + : search.kind === "error" + ? "More data needed" + : result?.status === "infeasible" + ? "These constraints don't fit" + : result?.status === "limited" + ? "Search limit reached" + : "A complete week. Every section fits."} + +
+ {result && ( + + {result.solveMs < 1 ? "<1" : result.solveMs.toFixed(1)} ms on + this device + + )} +
+ {search.kind === "error" && ( +

+ {search.message} +

+ )} + {result?.status === "limited" && ( +

+ {plan + ? "These schedules fit. The search stopped before proving they are the best. Lock a section to narrow the search." + : "The search stopped before finding a complete schedule. This does not mean your request is impossible. Try locking a section to narrow the search."} +

+ )} + {result?.status === "infeasible" && search.kind === "done" && ( + + )} + + {result?.status !== "infeasible" && search.kind !== "error" && ( +
+
+
+ {problem.title} + {problem.term} +
+ + make space for the good stuff + +
+ setFocusGroup(id)} + /> + {focused && plan && ( +
+
+ + {focused.course} {kind(focused)} + + + { + focused.options.find( + (o) => o.id === plan.picks[focused.id], + )?.title + } + .{" "} + {constraints.locks[focused.id] + ? "This section is locked." + : "Keep this section while PI moves the others."} + +
+ + +
+ )} +
+ {courses.map((course) => ( + + + {course} + + ))} + {pinned && ( + + + Pinned position + + )} + + Click a class to lock its section + + + Scroll across to see every day + +
+
+ )} + + {search.kind === "loading" && ( + + )} + {!!result?.plans.length && ( +
+ {result.plans.map((candidate, i) => ( + + ))} +
+ )} + + {pinned && plan && ( +
+ +
+ + {changed.length + ? `${changed.length} ${changed.length === 1 ? "section moved" : "sections moved"} from your pinned version` + : "Matches your pinned version"} + + {changed.length > 0 && ( + + {changed + .map( + (g) => + `${g.course} ${g.options.find((o) => o.id === pinned.picks[g.id])?.title} → ${g.options.find((o) => o.id === plan.picks[g.id])?.title}`, + ) + .join(" · ")} + + )} +
+ +
+ )} + +
+ + {plan + ? `${plan.days} class days. First class ${timeLabel(plan.earliest)}. Last finish ${timeLabel(plan.latest)}.` + : "Complete schedules account for every required section group."} + + +
+ {copyError && ( +

+ Clipboard access was blocked. Select the section details to copy + them manually. +

+ )} +

+ {problem.source === "sample" + ? "Sample data. These section times are synthetic. " + : "Based on this Junction snapshot. "} + Checks meeting times and listed availability. Prerequisites and + registration eligibility are not checked. Your saved schedule stays + unchanged. +

+
setDetailsOpen(e.currentTarget.open)} + > + How this was checked +
+

+ A C++ constraint solver runs as WebAssembly on your device. It + picks one option for every section group, checks every meeting, + then ranks complete schedules. +

+
+
+
Possible section combinations
+
+ {Number.isSafeInteger(combinations) + ? combinations.toLocaleString() + : ">9 quadrillion"} +
+
+
+
Search nodes visited
+
{result?.nodes.toLocaleString() ?? "—"}
+
+
+
Search result
+
+ {result?.status === "optimal" + ? "Ranking proved" + : result?.status === "infeasible" + ? "No solution proved" + : result?.status === "limited" + ? "Incomplete" + : "Running"} +
+
+
+

+ {constraints.objective === "compact" + ? "Compact week minimizes gap minutes plus 30 minutes per class day." + : constraints.objective === "changes" + ? "Fewest changes preserves current section picks first, then minimizes gaps." + : "Latest first class maximizes the earliest start across your week, then minimizes gaps."}{" "} + Timing measures the local solve, excluding engine loading and + conflict explanation. +

+
+
+
+
+
+ ); +} + +function ConflictExplanation({ + problem, + diagnosis, + onRelax, +}: { + problem: ScheduleProblem; + diagnosis?: Diagnosis; + onRelax: (constraints: Constraints) => void; +}) { + const groups = problem.groups.filter((g) => diagnosis?.groups.includes(g.id)); + const slots = new Set( + groups.flatMap((g) => + g.options.flatMap((o) => + o.meetings.map((m) => `${m.days}|${m.start}|${m.end}`), + ), + ), + ); + const bottleneck = + groups.length > slots.size && + groups.every((g) => g.options.every((o) => o.meetings.length === 1)); + return ( +
+
!
+
+

+ {groups.length === 1 + ? `${groups[0].course} has no section that fits.` + : bottleneck + ? `${groups.length} required groups. Only ${slots.size} distinct time slots.` + : "Something has to give."} +

+

+ {bottleneck + ? "At least two required sections must overlap. Changing their order cannot make this timetable work." + : "No complete combination satisfies all of the current constraints."} +

+
+ {groups.map((g) => ( +
+ + {g.course} {kind(g)} + +
+ {g.options.slice(0, 6).map((o) => ( + + {o.title} ·{" "} + {o.meetings + .map((m) => `${dayLabel(m.days)} ${timeLabel(m.start)}`) + .join(", ")} + + ))} + {g.options.length > 6 && ( + +{g.options.length - 6} more sections + )} +
+
+ ))} +
+ {!!diagnosis?.relaxations.length && ( +
+ These changes each make a complete schedule possible + {diagnosis.relaxations.map((r, i) => ( + + ))} +
+ )} +
+
+ ); +} + +function Calendar({ + problem, + constraints, + plan, + pinned, + color, + pending, + onPick, +}: { + problem: ScheduleProblem; + constraints: Constraints; + plan: Plan | null; + pinned: Plan | null; + color: (course: string) => string; + pending: boolean; + onPick: (id: string) => void; +}) { + const root = useRef(null); + const previous = useRef(new Map()); + const slots = problem.groups.flatMap((g) => + g.options.flatMap((o) => o.meetings), + ); + const dayCount = [...slots, ...constraints.busy].some((m) => m.days & 96) + ? 7 + : 5; + const start = Math.min( + 8 * 60, + ...slots.map((m) => Math.floor(m.start / 60) * 60), + ); + const end = Math.max( + 18 * 60, + ...slots.map((m) => Math.ceil(m.end / 60) * 60), + ); + const span = end - start; + const height = Math.max(440, (span / 60) * 48); + useLayoutEffect(() => { + if (!root.current) return; + const next = new Map(); + const reduced = window.matchMedia( + "(prefers-reduced-motion: reduce)", + ).matches; + root.current + .querySelectorAll("[data-meeting]") + .forEach((element) => { + const key = element.dataset.meeting!, + rect = element.getBoundingClientRect(), + old = previous.current.get(key); + if (old && !reduced && (old.x !== rect.x || old.y !== rect.y)) + element.animate( + [ + { + transform: `translate(${old.x - rect.x}px,${old.y - rect.y}px)`, + opacity: 0.65, + }, + { transform: "translate(0,0)", opacity: 1 }, + ], + { duration: 360, easing: "cubic-bezier(.16,1,.3,1)" }, + ); + next.set(key, rect); + }); + if (plan) previous.current = next; + }, [plan]); + return ( +
+
+
+ + {DAYS.slice(0, dayCount).map((d, i) => ( +
+ {d} + {constraints.offDays & (1 << i) ? "YOURS" : ""} +
+ ))} +
+
+
+ {Array.from( + { length: Math.floor(span / 60) + 1 }, + (_, i) => start + i * 60, + ).map((t) => ( + + {timeLabel(t)} + + ))} +
+
+ {DAYS.slice(0, dayCount).map((d, i) => ( +
+ {constraints.offDays & (1 << i) ? ( + all yours + ) : null} +
+ ))} + {constraints.busy.flatMap((b) => + DAYS.slice(0, dayCount).flatMap((_, d) => + b.days & (1 << d) + ? [ +
+ Protected +
, + ] + : [], + ), + )} + {pinned && + plan && + problem.groups.flatMap((g) => { + if (pinned.picks[g.id] === plan.picks[g.id]) return []; + const option = g.options.find( + (o) => o.id === pinned.picks[g.id], + ); + return ( + option?.meetings.flatMap((m, mi) => + DAYS.slice(0, dayCount).flatMap((_, d) => + m.days & (1 << d) + ? [ + +
+
+
+ ); +} + +function MiniWeek({ + problem, + plan, + color, +}: { + problem: ScheduleProblem; + plan: Plan; + color: (course: string) => string; +}) { + return ( + + ); +} diff --git a/app/src/client/pages/PlannerPage.tsx b/app/src/client/pages/PlannerPage.tsx index 97649eb..fcad845 100644 --- a/app/src/client/pages/PlannerPage.tsx +++ b/app/src/client/pages/PlannerPage.tsx @@ -1,9 +1,10 @@ -import { useCallback, useEffect, useRef, useState } from "react"; +import { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react"; import { PI_APPS, type PiSettings } from "../../shared/apps"; import { IconChevron, IconExternal } from "../components/Icons"; import { WeekGrid } from "../components/WeekGrid"; import { friendlyError, rawError, useDesk } from "../lib/desk"; import { extractSchedule, type ScheduleView } from "../lib/tools"; +import { fromJunction } from "../scheduling/junction"; import "../styles/desk.css"; type SchedMeta = { id: number; title: string; term: number; termName?: string }; @@ -19,9 +20,10 @@ type Detail = | { kind: "loading" } | { kind: "empty" } | { kind: "error"; err: unknown } - | { kind: "ready"; schedule: ScheduleView }; + | { kind: "ready"; schedule: ScheduleView; raw: unknown }; const JUNCTION = PI_APPS.find((a) => a.key === "junction")!; +const SemesterLab = lazy(() => import("../components/SemesterLab").then(m => ({ default: m.SemesterLab }))); export function PlannerPage({ settings, @@ -35,6 +37,12 @@ export function PlannerPage({ const [term, setTerm] = useState(null); const [selected, setSelected] = useState(null); const [detail, setDetail] = useState({ kind: "loading" }); + const [labOpen, setLabOpen] = useState(false); + const lab = useMemo(() => { + if (!labOpen || detail.kind !== "ready") return null; + try { return { problem: fromJunction(detail.raw) }; } + catch (error) { return { error: error instanceof Error ? error.message : "The schedule data is incomplete." }; } + }, [labOpen, detail]); const junctionOn = settings.apps.includes("junction"); const gen = useRef({ list: 0, detail: 0 }); @@ -79,7 +87,7 @@ export function PlannerPage({ }); if (gen.current.detail !== id) return; const view = extractSchedule(data); - setDetail(view ? { kind: "ready", schedule: view } : { kind: "empty" }); + setDetail(view ? { kind: "ready", schedule: view, raw: data } : { kind: "empty" }); } catch (err) { if (gen.current.detail === id) setDetail({ kind: "error", err }); } @@ -113,13 +121,13 @@ export function PlannerPage({ return (
-
-

+
+ {!labOpen && <>

My Planner

Straight from TigerJunction, in highlighter. -

+

} {load.kind === "loading" && (
@@ -213,7 +221,10 @@ export function PlannerPage({ ))}
-
+ {detail.kind === "ready" && } + + {labOpen && lab?.problem ? Opening the planning lab…

}>
:
+ {labOpen && lab?.error &&

{lab.error}

} {detail.kind === "ready" && (
@@ -248,7 +259,7 @@ export function PlannerPage({
)} -
+
}

PI reads this from TigerJunction. Changes you make there show up diff --git a/app/src/client/scheduling/useSolver.ts b/app/src/client/scheduling/useSolver.ts new file mode 100644 index 0000000..2e18379 --- /dev/null +++ b/app/src/client/scheduling/useSolver.ts @@ -0,0 +1,53 @@ +import { useEffect, useState } from "react"; +import SolverWorker from "./worker?worker&inline"; +import type { + Constraints, + Diagnosis, + ScheduleProblem, + SolveResult, +} from "./model"; + +export type SearchState = + | { kind: "loading" } + | { kind: "error"; message: string } + | { kind: "done"; result: SolveResult; diagnosis?: Diagnosis }; + +export function useSolver( + problem: ScheduleProblem, + constraints: Constraints, +): SearchState { + const [snapshot, setSnapshot] = useState<{ + problem: ScheduleProblem; + constraints: Constraints; + state: SearchState; + } | null>(null); + useEffect(() => { + let current = true; + const setState = (state: SearchState) => { + if (current) setSnapshot({ problem, constraints, state }); + }; + // A fresh worker cancels any obsolete search, including conflict analysis. + // Main-thread interaction never waits for a long combinatorial search. + const worker = new SolverWorker(); + worker.onmessage = ({ data }) => { + setState( + data.error + ? { kind: "error", message: data.error } + : { kind: "done", ...data }, + ); + }; + worker.onerror = () => + setState({ + kind: "error", + message: "The planner engine could not start. Refresh and try again.", + }); + worker.postMessage({ problem, constraints, explain: true }); + return () => { + current = false; + worker.terminate(); + }; + }, [problem, constraints]); + return snapshot?.problem === problem && snapshot.constraints === constraints + ? snapshot.state + : { kind: "loading" }; +} diff --git a/app/src/client/scheduling/worker.ts b/app/src/client/scheduling/worker.ts new file mode 100644 index 0000000..cc1ba2f --- /dev/null +++ b/app/src/client/scheduling/worker.ts @@ -0,0 +1,39 @@ +import wasmUrl from "./solver.wasm?url"; +import { createSolver } from "./engine"; +import type { Constraints, ScheduleProblem } from "./model"; + +const engine = fetch(wasmUrl) + .then((response) => { + if (!response.ok) + throw new Error( + "The planner engine could not load. Refresh to try again.", + ); + return response.arrayBuffer(); + }) + .then(createSolver); + +onmessage = async ( + event: MessageEvent<{ + problem: ScheduleProblem; + constraints: Constraints; + explain?: boolean; + }>, +) => { + try { + const solver = await engine; + const { problem, constraints, explain } = event.data; + const result = solver.solve(problem, constraints); + const diagnosis = + result.status === "infeasible" && explain + ? solver.diagnose(problem, constraints) + : undefined; + postMessage({ result, diagnosis }); + } catch (error) { + postMessage({ + error: + error instanceof Error + ? error.message + : "The planner could not finish this request.", + }); + } +}; diff --git a/app/src/client/styles/desk.css b/app/src/client/styles/desk.css index 6e7ca58..05afa4f 100644 --- a/app/src/client/styles/desk.css +++ b/app/src/client/styles/desk.css @@ -733,3 +733,4 @@ transition: none; } } +.planner-lab-entry { margin-bottom: 20px; display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--pi-deep); } diff --git a/app/src/client/styles/semester-lab.css b/app/src/client/styles/semester-lab.css new file mode 100644 index 0000000..109770e --- /dev/null +++ b/app/src/client/styles/semester-lab.css @@ -0,0 +1,997 @@ +.semester-lab { + --lab-edge: #dfdfd3; + --lab-muted: #696c60; + --lab-accent: #0a7180; + color: var(--ink, #242b29); + font-family: var(--sans, system-ui); + font-size: 13px; +} +.semester-lab * { + box-sizing: border-box; +} +.semester-lab button, +.semester-lab select { + font: inherit; +} +.semester-lab button { + cursor: pointer; +} +.semester-lab button:disabled { + opacity: 0.42; + cursor: default; +} +.semester-lab :focus-visible { + outline: 2px solid var(--lab-accent); + outline-offset: 3px; +} +.lab-header { + display: flex; + justify-content: space-between; + gap: 24px; + align-items: center; + padding: 0 0 28px; + border-bottom: 1px solid var(--lab-edge); +} +.lab-eyebrow { + font-size: 10px; + font-weight: 700; + letter-spacing: 0.16em; + color: var(--lab-muted); + margin-bottom: 9px; +} +.lab-header h2 { + margin: 0; + font-weight: 540; + letter-spacing: -0.045em; + font-size: clamp(25px, 2.5vw, 36px); + line-height: 1.15; +} +.lab-header h2 span { + font-family: var(--hand, cursive); + font-size: 1.3em; + letter-spacing: -0.025em; + font-weight: 500; + color: var(--lab-accent); + white-space: nowrap; +} +.lab-header p { + margin: 8px 0 0; + color: var(--lab-muted); + font-size: 13px; +} +.lab-header-actions { + display: flex; + gap: 8px; + flex-shrink: 0; +} +.lab-button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 7px; + border: 1px solid var(--lab-edge); + background: transparent; + color: inherit; + border-radius: 6px; + padding: 9px 11px; + min-height: 36px; + transition: + background 140ms, + border-color 140ms; +} +.lab-button:not(:disabled):hover { + background: var(--paper-sunk, #f5f2ea); + border-color: #aaa997; +} +.lab-layout { + display: grid; + grid-template-columns: 250px minmax(0, 1fr); + gap: 30px; + padding-top: 26px; + align-items: start; +} +.lab-controls { + min-width: 0; + padding-right: 25px; + border-right: 1px solid var(--lab-edge); +} +.lab-mobile-controls > summary { + display: none; +} +.lab-section-label { + font-size: 10px; + font-weight: 750; + letter-spacing: 0.13em; + margin: 0 0 14px; + color: var(--lab-muted); +} +.lab-field { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; + margin: 10px 0; +} +.semester-lab select { + background: var(--paper, #fdfcf9); + color: inherit; + border: 1px solid var(--lab-edge); + border-radius: 5px; + padding: 7px 8px; + font-size: 12px; + max-width: 100%; + min-height: 34px; +} +.lab-field select { + min-width: 78px; +} +.lab-days { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 5px; + padding: 0; + margin: 17px 0 18px; + border: none; +} +.lab-days legend { + margin-bottom: 8px; +} +.lab-days button { + border: 1px solid var(--lab-edge); + border-radius: 5px; + background: transparent; + padding: 8px 2px; + font-size: 11px; + transition: background 140ms; +} +.lab-days button[aria-pressed="true"] { + background: #e0efea; + border-color: #527f70; + color: #235c47; + font-weight: 700; +} +.lab-days button:hover { + background: #edf1e7; +} +.lab-objective { + display: block; + margin: 0 0 25px; +} +.lab-objective > span { + display: block; + margin-bottom: 7px; +} +.lab-objective select { + width: 100%; + background: #f2f0e6; +} +.lab-course-heading { + display: flex; + justify-content: space-between; + align-items: baseline; + padding-top: 21px; + border-top: 1px solid var(--lab-edge); + margin-bottom: 14px; +} +.lab-course-heading > span { + font-weight: 400; + font-size: 9px; + letter-spacing: 0; +} +.lab-course { + margin-bottom: 17px; +} +.lab-course-name { + display: flex; + gap: 7px; + align-items: center; + margin-bottom: 6px; +} +.lab-course-dot { + width: 8px; + height: 8px; + border-radius: 2px; + flex-shrink: 0; +} +.lab-course-name strong { + font-size: 12px; + white-space: nowrap; +} +.lab-course-name > span:last-child:not(.lab-course-dot) { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 10px; + color: var(--lab-muted); +} +.lab-section-choice { + display: flex; + align-items: center; + gap: 3px; + padding-left: 15px; + margin-top: 4px; +} +.lab-section-choice label { + display: flex; + align-items: center; + gap: 6px; + flex: 1; + min-width: 0; +} +.lab-section-choice label > span { + width: 43px; + flex-shrink: 0; + color: var(--lab-muted); + font-size: 11px; +} +.lab-section-choice select { + width: 100%; + min-width: 0; + border-color: transparent; + padding: 3px 2px; + min-height: 25px; + font-size: 11px; + background: transparent; +} +.lab-section-choice select:hover { + border-color: var(--lab-edge); +} +.lab-section-choice.locked { + color: var(--lab-accent); +} +.lab-section-choice.locked select { + font-weight: 650; +} +.lab-section-choice > button { + padding: 4px; + background: transparent; + border: 0; + color: var(--lab-accent); +} +.lab-protect { + border-top: 1px solid var(--lab-edge); + padding-top: 15px; + margin-top: 8px; +} +.lab-protect summary { + cursor: pointer; + font-size: 11px; + display: flex; + justify-content: space-between; + align-items: center; + list-style: none; +} +.lab-protect summary::-webkit-details-marker { + display: none; +} +.lab-protect summary > span { + font-size: 19px; + line-height: 1; +} +.lab-protect-fields { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + gap: 6px; + padding-top: 13px; +} +.lab-protect-fields label { + font-size: 10px; +} +.lab-protect-fields select { + display: block; + width: 100%; + padding: 5px 2px; + margin-top: 4px; +} +.lab-protect-fields button { + grid-column: 1 / -1; + font-size: 11px; +} +.lab-busy-list { + list-style: none; + padding: 0; + margin: 10px 0; +} +.lab-busy-list li { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 11px; + padding: 6px 0; +} +.lab-busy-list button { + padding: 5px; + background: transparent; + border: none; +} +.lab-checkbox { + display: flex; + gap: 7px; + align-items: center; + font-size: 11px; + margin-top: 17px; + color: var(--lab-muted); +} +.lab-checkbox input { + accent-color: var(--lab-accent); +} +.lab-workspace { + min-width: 0; +} +.lab-result-heading { + display: flex; + gap: 10px; + justify-content: space-between; + align-items: center; + min-height: 20px; + margin-bottom: 15px; +} +.lab-result-heading > div { + display: flex; + align-items: center; + gap: 7px; +} +.lab-result-heading strong { + font-size: 12px; + font-weight: 550; +} +.lab-signal { + display: inline-block; + height: 6px; + width: 6px; + border-radius: 50%; + background: #3b8560; + flex-shrink: 0; +} +.lab-signal.no-fit { + background: #a45c3a; +} +.lab-timing { + color: var(--lab-muted); + font-size: 10px; + font-variant-numeric: tabular-nums; + white-space: nowrap; +} +.lab-calendar-sheet { + background: var(--paper-raised, #fffefa); + border: 1px solid var(--lab-edge); + border-radius: 9px; + overflow: hidden; + box-shadow: 0 4px 20px -15px #75664170; +} +.lab-calendar-sheet.searching .lab-calendar { + opacity: 0.55; +} +.lab-sheet-top { + padding: 17px 18px 13px; + display: flex; + justify-content: space-between; + gap: 8px; + align-items: center; +} +.lab-sheet-top strong { + display: block; + font-size: 13px; + font-weight: 600; +} +.lab-sheet-top > div > span { + color: var(--lab-muted); + font-size: 10px; + display: block; + margin-top: 2px; +} +.lab-hand-note { + color: #6b7962; + font-family: var(--hand, cursive); + font-size: 20px; + transform: rotate(-3deg); + white-space: nowrap; +} +.lab-calendar-scroll { + overflow-x: auto; + padding: 0 16px 12px 6px; +} +.lab-calendar { + min-width: 430px; +} +.lab-day-header { + display: grid; + grid-template-columns: 36px repeat(var(--lab-days), minmax(0, 1fr)); + height: 35px; + margin-bottom: 9px; +} +.lab-day-header > div { + text-align: center; + font-weight: 600; + font-size: 11px; + padding-top: 4px; +} +.lab-day-header small { + display: block; + font-size: 7px; + letter-spacing: 0.12em; + color: #4c7759; + min-height: 10px; +} +.lab-day-header .is-free { + color: #335c44; +} +.lab-grid-body { + display: grid; + grid-template-columns: 36px 1fr; + height: var(--lab-grid-height); + margin-bottom: 8px; +} +.lab-time-axis { + position: relative; +} +.lab-time-axis > span { + position: absolute; + right: 7px; + font-size: 9px; + line-height: 1; + transform: translateY(-50%); + color: #757367; + font-variant-numeric: tabular-nums; +} +.lab-grid-days { + position: relative; + background-image: repeating-linear-gradient( + to bottom, + #e8e7dc 0, + #e8e7dc 1px, + transparent 1px, + transparent var(--lab-hour-height) + ); + border-bottom: 1px solid #e8e7dc; +} +.lab-day-column { + position: absolute; + top: 0; + bottom: 0; + border-left: 1px solid #eeece3; +} +.lab-day-column:last-of-type { + border-right: 1px solid #eeece3; +} +.lab-day-column.is-free { + background: #dce9d845; +} +.lab-free-note { + position: absolute; + font-family: var(--hand, cursive); + font-size: 23px; + color: #62815b; + top: 45%; + left: 50%; + white-space: nowrap; + transform: translateX(-50%) rotate(-5deg); +} +.lab-class-block { + position: absolute; + text-align: left; + border: 1px solid #66765f16; + border-radius: 5px; + padding: 4px 7px; + overflow: hidden; + min-height: 25px; + display: flex; + flex-direction: column; + justify-content: center; + gap: 1px; + z-index: 3; + color: #273a30; + box-shadow: 0 1px 2px #4c493512; +} +.lab-class-block:hover { + outline: 1px solid #586c5c; + z-index: 5; +} +.lab-class-block.is-locked { + box-shadow: inset 0 0 0 1px #3e665a; +} +.lab-block-time { + font-size: 8px; + line-height: 1.1; + display: flex; + align-items: center; + justify-content: space-between; + gap: 3px; +} +.lab-class-block strong { + font-size: 12px; + line-height: 1.2; + white-space: nowrap; +} +.lab-block-section { + font-size: 8px; + line-height: 1.1; +} +.lab-ghost-block { + position: absolute; + border: 1px dashed #827c6c; + border-radius: 4px; + background: #c6c0ab20; + pointer-events: none; + z-index: 1; +} +.lab-protected-block { + position: absolute; + padding: 4px; + overflow: hidden; + background: repeating-linear-gradient( + 135deg, + #deddd640, + #deddd640 3px, + #f4f2eb80 3px, + #f4f2eb80 7px + ); + border: 1px solid #9e9c8e80; + border-radius: 4px; + color: #66685c; + font-size: 9px; + z-index: 2; +} +.lab-calendar-key { + display: flex; + flex-wrap: wrap; + gap: 8px 13px; + padding: 12px 17px; + border-top: 1px solid #eeece3; +} +.lab-calendar-key > span { + display: inline-flex; + align-items: center; + gap: 4px; + font-size: 9px; +} +.lab-calendar-key i { + width: 6px; + height: 6px; + border-radius: 1px; +} +.lab-calendar-key .lab-key-hint { + margin-left: auto; + color: var(--lab-muted); + font-size: 9px; +} +.lab-calendar-key .lab-pinned-key i { + border: 1px dashed #827c6c; + background: transparent; + width: 10px; + height: 7px; +} +.lab-calendar-key .lab-swipe-hint { + display: none; +} +.lab-meeting-detail { + background: #edf3ed; + border-top: 1px solid #d3dfcf; + padding: 12px 16px; + display: flex; + gap: 9px; + align-items: center; +} +.lab-meeting-detail > div { + flex: 1; +} +.lab-meeting-detail strong { + display: block; + font-size: 11px; +} +.lab-meeting-detail > div > span { + display: block; + font-size: 10px; + color: #54654e; + margin-top: 2px; +} +.lab-icon-button { + padding: 6px; + background: transparent; + border: none; + display: inline-flex; + align-items: center; +} +.lab-alternatives { + margin-top: 18px; + border-top: 1px solid var(--lab-edge); +} +.lab-search-placeholder > span { + display: block; + height: 63px; + border-bottom: 1px solid var(--lab-edge); + background: linear-gradient(90deg, #e9eade75, transparent 65%); +} +.lab-alternative { + display: flex; + width: 100%; + align-items: center; + gap: 13px; + text-align: left; + background: transparent; + border: none; + border-bottom: 1px solid var(--lab-edge); + border-radius: 0; + padding: 11px 9px 11px 4px; + min-height: 63px; +} +.lab-alternative:hover { + background: #eff1e7; +} +.lab-alternative.active { + background: #e8f0e855; +} +.lab-plan-number { + font-family: var(--hand, cursive); + font-size: 28px; + line-height: 1; + color: #6f7e67; + min-width: 28px; +} +.lab-alternative > div { + flex: 1; +} +.lab-alternative strong { + display: block; + font-size: 12px; + font-weight: 600; + margin-bottom: 2px; +} +.lab-alternative > div > span { + display: block; + color: var(--lab-muted); + font-size: 10px; +} +.lab-mini-week { + position: relative; + height: 38px; + width: 76px; + flex-shrink: 0; + background-image: repeating-linear-gradient( + 90deg, + #a9af9a38 0, + #a9af9a38 1px, + transparent 1px, + transparent 14.2857% + ); +} +.lab-mini-week > i { + position: absolute; + min-height: 3px; + border-radius: 1px; +} +.lab-choice-mark { + width: 22px; + color: #487453; + display: flex; + justify-content: center; +} +.lab-comparison { + display: flex; + align-items: center; + gap: 9px; + background: #f0ebdc; + padding: 11px 13px; + border-radius: 5px; + margin-top: 13px; + color: #626047; +} +.lab-comparison > div { + flex: 1; +} +.lab-comparison strong { + display: block; + font-size: 11px; +} +.lab-comparison span { + display: block; + font-size: 10px; + margin-top: 3px; +} +.lab-bottom-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + margin: 18px 0 10px; +} +.lab-bottom-row > span { + color: #62675b; + font-size: 11px; +} +.lab-copy { + display: inline-flex; + align-items: center; + gap: 9px; + font-size: 11px !important; + font-weight: 650 !important; + background: transparent; + color: var(--lab-accent); + border: none; + padding: 4px 0 4px 8px; + white-space: nowrap; +} +.lab-scope { + color: var(--lab-muted); + font-size: 10px; + line-height: 1.6; + margin: 0; + max-width: 640px; +} +.lab-engine { + border-top: 1px solid var(--lab-edge); + margin-top: 18px; + padding-top: 12px; +} +.lab-engine summary { + cursor: pointer; + font-size: 10px; + color: #686b5e; + width: fit-content; +} +.lab-engine p { + font-size: 11px; + line-height: 1.6; + color: #65695e; + margin: 12px 0; +} +.lab-engine dl { + display: flex; + gap: 22px; + flex-wrap: wrap; + margin: 12px 0; +} +.lab-engine dt { + font-size: 9px; + color: #666e60; +} +.lab-engine dd { + margin: 3px 0 0; + font-size: 12px; + font-variant-numeric: tabular-nums; +} +.lab-conflict { + display: flex; + gap: 13px; + padding: 18px; + background: #f4e9d8; + border: 1px solid #decaaa; + border-radius: 7px; + margin-bottom: 16px; + color: #694d2d; +} +.lab-conflict-mark { + border: 1px solid #9b744c; + border-radius: 50%; + width: 23px; + height: 23px; + flex-shrink: 0; + text-align: center; + font-size: 14px; + font-weight: 650; +} +.lab-conflict h3 { + margin: 0 0 7px; + font-size: 16px; + letter-spacing: -0.025em; + font-weight: 650; +} +.lab-conflict p { + margin: 0; + font-size: 12px; + line-height: 1.6; +} +.lab-conflict-options { + margin-top: 18px; +} +.lab-conflict-options > div { + display: flex; + gap: 16px; + border-top: 1px solid #d6c3a8; + padding: 11px 0; + align-items: baseline; +} +.lab-conflict-options strong { + min-width: 100px; + font-size: 11px; +} +.lab-conflict-options strong > span { + display: block; + font-size: 10px; + font-weight: 400; + margin-top: 2px; +} +.lab-conflict-options > div > div { + display: flex; + flex-wrap: wrap; + gap: 8px; +} +.lab-conflict-options > div > div > span { + padding: 4px 7px; + border: 1px solid #d2bb9c; + border-radius: 3px; + font-size: 10px; +} +.lab-relaxations { + margin-top: 16px; + display: flex; + flex-wrap: wrap; + gap: 7px; +} +.lab-relaxations > span { + width: 100%; + font-size: 11px; + margin-bottom: 2px; +} +.lab-relaxations button { + display: inline-flex; + align-items: center; + gap: 9px; + padding: 7px 10px; + background: #fffbf0; + border: 1px solid #cfb58f; + border-radius: 4px; + font-size: 11px; + color: #73522f; +} +.lab-message { + font-size: 12px; + line-height: 1.6; + padding: 13px 15px; + background: #f5eadc; + border-radius: 5px; + color: #794c30; + margin: 0 0 14px; +} +.planner-lab.page-inner { + max-width: 1280px; +} +.planner-lab-entry svg { + flex-shrink: 0; +} + +@media (max-width: 1000px) { + .lab-layout { + grid-template-columns: 215px minmax(0, 1fr); + gap: 20px; + } + .lab-controls { + padding-right: 18px; + } + .lab-header { + gap: 16px; + flex-wrap: wrap; + } + .lab-hand-note { + display: none; + } + .lab-calendar-key .lab-key-hint { + width: 100%; + margin-left: 0; + } + .lab-course-name > span:last-child:not(.lab-course-dot) { + display: none; + } +} +@media (max-width: 700px) { + .lab-header { + padding-bottom: 18px; + } + .lab-header h2 { + font-size: 26px; + } + .lab-header h2 span { + display: block; + margin-top: 2px; + font-size: 36px; + } + .lab-header-actions { + width: 100%; + justify-content: flex-start; + } + .lab-header-actions .lab-button { + padding: 8px 10px; + font-size: 12px; + } + .lab-layout { + grid-template-columns: minmax(0, 1fr); + gap: 22px; + padding-top: 18px; + } + .lab-controls { + padding-right: 0; + border-right: none; + border-bottom: 1px solid var(--lab-edge); + padding-bottom: 15px; + } + .lab-mobile-controls > summary { + display: flex; + justify-content: space-between; + align-items: center; + cursor: pointer; + font-weight: 600; + list-style: none; + } + .lab-mobile-controls > summary::-webkit-details-marker { + display: none; + } + .lab-mobile-controls > summary > span { + color: var(--lab-muted); + font-size: 11px; + font-weight: 400; + } + .lab-mobile-controls[open] > summary { + margin-bottom: 18px; + } + .lab-course-name > span:last-child:not(.lab-course-dot) { + display: inline; + } + .lab-course-heading > span { + font-size: 10px; + } + .lab-days button { + min-height: 38px; + } + .lab-section-choice select { + min-height: 33px; + font-size: 12px; + } + .lab-section-choice label > span { + width: 55px; + } + .lab-result-heading { + align-items: flex-start; + } + .lab-result-heading strong { + font-size: 11px; + } + .lab-timing { + font-size: 9px; + } + .lab-sheet-top { + padding: 14px; + } + .lab-calendar-key .lab-swipe-hint { + display: inline-flex; + color: var(--lab-muted); + font-size: 9px; + } + .lab-conflict-options > div { + flex-direction: column; + gap: 6px; + } + .lab-bottom-row { + flex-wrap: wrap; + gap: 8px; + } + .lab-copy { + padding-left: 0; + } + .lab-meeting-detail { + flex-wrap: wrap; + } + .lab-meeting-detail > div { + flex-basis: calc(100% - 40px); + } + .lab-alternative { + gap: 9px; + } + .lab-mini-week { + width: 54px; + } + .lab-alternative > div > span { + font-size: 9px; + } + .lab-engine dl { + gap: 16px; + } +} +@media (prefers-reduced-motion: reduce) { + .semester-lab *, + .semester-lab *::before, + .semester-lab *::after { + animation: none !important; + transition: none !important; + scroll-behavior: auto !important; + } +}