Repository navigation
TIG-337: side-by-side compare view for two plans - #546
Conversation
Students pick a second plan and see both semester boards side by side, each with its own requirement progress. The active plan stays editable on the left; the compared plan is read-only on the right. - Backend: get_schedule / get_requirements take an optional ?planId= (GET only, scoped to the user's plans, 404 otherwise). Reads never change the active plan or write anything. - usePlanner: comparePlanId with read-only compare schedule and requirements; stale responses dropped; closes if the plan is deleted; selecting the compared plan's tab swaps the sides. - Board gains a readOnly mode without drag-and-drop or remove buttons. - Compact per-major/minor summaries per side; below 1100px one board at a time with a toggle. - Tests: 5 backend (own majors per plan, no writes, 404s, save ignores planId) and compare helper unit tests. Decision log: docs/decisions/TIG-337-compare-view.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc8966c34b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Close compare if its plan disappears (deleted) and keep the two sides distinct. | ||
| useEffect(() => { | ||
| if (comparePlanId == null) return; | ||
| if (!plans.some((p) => p.id === comparePlanId)) { |
There was a problem hiding this comment.
Close comparison when deletion makes both sides identical
When compare mode has two plans and the user deletes the active plan, delete_plan makes the remaining compared plan active. This effect leaves comparison open because it only checks whether the compared plan still exists, so activePlanId and comparePlanId become identical and both sides display the same plan. Also close or otherwise repair comparison when comparePlanId === activePlanId.
Useful? React with 👍 / 👎.
| .getRequirements(planId) | ||
| .then((data) => seq === compareSeq.current && setCompareRequirements(unwrapGroupedRequirements(data))) |
There was a problem hiding this comment.
Reload compared requirements after a class-year change
Compared requirements are fetched only when loadCompare runs, while the Settings save callback still calls reloadPlan(), which reloads only the active plan. Because the backend evaluates requirements using profile.year, changing class year during comparison updates the left summary but leaves the right summary calculated for the previous year until comparison is closed or switched.
Useful? React with 👍 / 👎.
…lans Compare mode now opens in a By year layout: one row per semester, each plan's courses on a single line, the two plans side by side so every semester lines up for easy diffing. Courses only in one plan get a solid outline; courses in a different semester there get a dashed outline with a tooltip saying where. A summary counts both. The left plan stays editable (horizontal drop targets); below 1100px the toggle shows one column. The two-board layout remains under "Boards". Adds diffSchedules (unit-tested). Decision log D10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the' into tig-337-tigerpath-side-by-side-parallel-view-for-comparing
- Deleting the active plan while comparing made the compared plan active, so both sides showed the same plan; compare now closes in that case (a tab-click swap is exempt while it's in flight, and is reverted if the switch fails). - Changing class year in Settings reloaded only the active plan; it now reloads the compared plan too, since requirements depend on the year. (Codex review on #546.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d216769052
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| .catch(() => seq === compareSeq.current && setCompareSchedule(emptySchedule())); | ||
| api | ||
| .getRequirements(planId) | ||
| .then((data) => seq === compareSeq.current && setCompareRequirements(unwrapGroupedRequirements(data))) | ||
| .catch(() => seq === compareSeq.current && setCompareRequirements(unwrapGroupedRequirements(null))); |
There was a problem hiding this comment.
Preserve errors from failed comparison reads
When either comparison request fails because of a transient network/server error or a stale plan ID, these handlers replace the response with an empty schedule or empty requirements. The UI then reports every active course as unique to that plan and says the compared plan has no programs, presenting fabricated comparison results rather than an error; retain an error state and prompt the user to retry or close comparison instead.
Useful? React with 👍 / 👎.
| if (!otherWhere.has(key)) marks.set(key, { status: 'only' }); | ||
| else if (otherWhere.get(key) !== index) marks.set(key, { status: 'moved', otherIndex: otherWhere.get(key) }); | ||
| else marks.set(key, { status: 'same' }); |
There was a problem hiding this comment.
Track duplicate course occurrences independently
When an existing plan contains the same catalog course in multiple semesters—a case the board explicitly supports by warning about duplicates—every occurrence shares one entry in this map, so the last occurrence overwrites the others. For example, if the left plan has a course in semesters 0 and 2 while the right has it in semester 0, both left chips receive the final moved mark even though the first matches, and the legend count is also wrong; compute marks per occurrence rather than solely by course key.
Useful? React with 👍 / 👎.
…the' into tig-337-tigerpath-side-by-side-parallel-view-for-comparing
- A failed read of the compared plan used to show it as empty, so every course looked 'only in this plan'. It now shows an error with Try again and Close compare. - Diff marks are computed per occurrence (course + semester), so a course scheduled twice gets the right mark on each copy and the counts are right. Test added. (Codex review on #546.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
…the' into tig-337-tigerpath-side-by-side-parallel-view-for-comparing
TIG-337: side-by-side compare view for two plans
Closes TIG-337. Stacked on TIG-330 (#545). Base:
tig-330-tigerpath-implement-lucys-color-gradient-ui-on-the. Retarget toparallel-planning/viewonce #545 merges.What it does
Pick Compare next to the plan tabs and choose a second plan. The active plan stays editable on the left; the compared plan is read-only on the right, with drag-and-drop disabled. Each side shows its own requirement progress.
There are two layouts, switched with By year | Boards:
Below 1100px, either layout shows one plan at a time, with a toggle.
Changes
tigerpath/views.py):get_scheduleandget_requirementsaccept an optional?planId=. It's honored on GET only, scoped to the user's own plans, and returns 404 for anything else. Without it, both behave exactly as before.usePlanner.js: addscomparePlanId,compareScheduleandcompareRequirements, loaded through those GETs only. Stale responses are dropped, compare closes if its plan is deleted, and clicking the compared plan's tab swaps the sides.Board.jsx: areadOnlymode with static markup (no droppable id collisions, no remove button, no#semestersid).ComparePicker(never lists the active plan) andCompareSummary(compact per-major/minor progress).Checks
additional_major_idseach show their own requirements: backend test, plus the preview (plan b has two majors).scheduleandupdated_atare unchanged, and the preview saw zero non-GET requests across open, switch and close.Decisions
Full log in
docs/decisions/TIG-337-compare-view.md. The ones to review:set_active_plan), because the user deliberately changed the active plan.Testing
pytest tigerpath/tests.pypasses 41 tests, 5 of them new inComparePlanApiTest.bun run testpasses 25 tests, includinghelpers/compare.test.js(plan options, summaries and the per-course diff).vite buildpasses.Screenshots
By year, 1440px. Solid outline: only in this plan. Dashed: in a different semester in the other plan.
By year, 1100px: one plan at a time, with the toggle.
Boards, 1440px
Boards, 1100px
Feedback
Helen, @seowonlpark: please look at the layouts (D3, D10), the diff outlines and the compact summaries, since there's no finished Figma for this view. Updated since the first review: the By year layout is new and is now the default.
🤖 Generated with Claude Code