Skip to content

TIG-337: side-by-side compare view for two plans - #546

Open
Windshield-Viper wants to merge 7 commits into
tig-330-tigerpath-implement-lucys-color-gradient-ui-on-thefrom
tig-337-tigerpath-side-by-side-parallel-view-for-comparing
Open

Windshield-Viper wants to merge 7 commits into
tig-330-tigerpath-implement-lucys-color-gradient-ui-on-thefrom
tig-337-tigerpath-side-by-side-parallel-view-for-comparing

Conversation

@Windshield-Viper

@Windshield-Viper Windshield-Viper commented Nov 24, 2026 •

Copy link
Copy Markdown

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 to parallel-planning/view once #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:

  • By year (default). Freshman to Senior run top to bottom, with a Fall row and a Spring row each. Each row shows that semester's courses on one line for both plans, side by side, so semesters line up for easy comparison. A solid outline marks a course that's only in one plan; a dashed outline marks a course that's in a different semester in the other plan, and hovering says where. A summary line counts both. Requested in review; see D10.
  • Boards. Two full four-year grids, as the issue describes.

Below 1100px, either layout shows one plan at a time, with a toggle.

Changes

  • Backend (tigerpath/views.py): get_schedule and get_requirements accept 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: adds comparePlanId, compareSchedule and compareRequirements, 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: a readOnly mode with static markup (no droppable id collisions, no remove button, no #semesters id).
  • New components: ComparePicker (never lists the active plan) and CompareSummary (compact per-major/minor progress).
  • Tutorial: closes compare mode before starting the tour.

Checks

  • Plans with different additional_major_ids each show their own requirements: backend test, plus the preview (plan b has two majors).
  • Opening and closing compare never changes the active plan or writes a schedule: a backend test checks that each plan's schedule and updated_at are unchanged, and the preview saw zero non-GET requests across open, switch and close.
  • Selecting the same plan twice is blocked: the picker excludes the active plan (unit-tested), and the hook refuses it too.
  • Screenshots at 1440px and 1100px: below.

Decisions

Full log in docs/decisions/TIG-337-compare-view.md. The ones to review:

  • D2: the Figma has no finished side-by-side design (only a low-fidelity "STEP 2: COMPARE" wireframe), so this follows the issue's spec in the existing new-planner style.
  • D3: while comparing, search and the full requirements panel are hidden so each board keeps about 680px. Each side gets a compact summary instead, which is the issue's suggested fallback.
  • D5: clicking the compared plan's tab swaps the sides. That's the only flow that writes (set_active_plan), because the user deliberately changed the active plan.
  • D6: compare state isn't persisted, since persisting it would require a write.

Testing

  • Backend: pytest tigerpath/tests.py passes 41 tests, 5 of them new in ComparePlanApiTest.
  • Frontend: bun run test passes 25 tests, including helpers/compare.test.js (plan options, summaries and the per-course diff).
  • Build: vite build passes.
  • Ruff: the new code adds no findings.
  • Manual: the real new-planner UI was driven against mocked API data at 1440px, 1100px and 1101px in all four themes. I checked open, switch, close, swap and the tutorial, plus that the read-only board has no drag-and-drop nodes.

Screenshots

By year, 1440px. Solid outline: only in this plan. Dashed: in a different semester in the other plan.

By year compare at 1440px

By year, 1100px: one plan at a time, with the toggle.

By year compare at 1100px

Boards, 1440px

Boards compare at 1440px

Boards, 1100px

Boards compare at 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

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>
@linear

linear Bot commented Nov 24, 2026

Copy link
Copy Markdown

TIG-337

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T20:04:30.233576Z 676d1c1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread frontend/src/new/usePlanner.js Outdated
// 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)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +193 to +194
.getRequirements(planId)
.then((data) => seq === compareSeq.current && setCompareRequirements(unwrapGroupedRequirements(data)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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>
Windshield-Viper and others added 2 commits November 24, 2026 14:48
…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>
@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread frontend/src/new/usePlanner.js Outdated
Comment on lines +195 to +199
.catch(() => seq === compareSeq.current && setCompareSchedule(emptySchedule()));
api
.getRequirements(planId)
.then((data) => seq === compareSeq.current && setCompareRequirements(unwrapGroupedRequirements(data)))
.catch(() => seq === compareSeq.current && setCompareRequirements(unwrapGroupedRequirements(null)));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread frontend/src/new/helpers/compare.js Outdated
Comment on lines +64 to +66
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' });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Windshield-Viper and others added 2 commits November 24, 2026 14:59
…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>
@Windshield-Viper

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 676d1c1bfc

ℹ️ 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".

…the' into tig-337-tigerpath-side-by-side-parallel-view-for-comparing

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant