Skip to content

Conversation

leslieyip02
Copy link
Member

@leslieyip02 leslieyip02 commented Jun 27, 2025

Context

Closes #3843.

Since the new AY's modules are going to be added soon, the ability to import/export planners would be quite helpful for planning.

Course.Planner.-.NUSMods.Mozilla.Firefox.2025-06-27.23-59-32.mp4

The video looks a bit weird because my screen recorder hides my download window.

Implementation

  • Users can download a .json file of their current conifg
  • Users can upload their .json config to write over the current config
  • Uses zod for schema validation (since it's used in the export service as well)

@leslieyip02 leslieyip02 self-assigned this Jun 27, 2025
Copy link

vercel bot commented Jun 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nusmods-export ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2025 4:47pm
nusmods-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2025 4:47pm

Copy link

vercel bot commented Jun 27, 2025

@leslieyip02 is attempting to deploy a commit to the modsbot's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 24.24242% with 50 lines in your changes missing coverage. Please review.

Project coverage is 52.94%. Comparing base (988c6fd) to head (cfa0f24).
Report is 111 commits behind head on master.

Files with missing lines Patch % Lines
website/src/views/planner/PlannerImportButton.tsx 0.00% 28 Missing ⚠️
website/src/actions/export.ts 0.00% 11 Missing ⚠️
website/src/views/planner/PlannerClearButton.tsx 0.00% 8 Missing ⚠️
website/src/views/planner/PlannerExportButton.tsx 0.00% 2 Missing ⚠️
...iews/planner/PlannerContainer/PlannerContainer.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4077      +/-   ##
==========================================
- Coverage   54.52%   52.94%   -1.58%     
==========================================
  Files         274      287      +13     
  Lines        6076     6612     +536     
  Branches     1455     1607     +152     
==========================================
+ Hits         3313     3501     +188     
- Misses       2763     3111     +348     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@ravern ravern left a comment

Choose a reason for hiding this comment

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

Cool feature!

I'm mostly okay with the code, but I have some comments about the overall UX of the feature.

Feel free to disagree with any of these, and if I agree on all the disagreements I'm happy to approve this.

  1. I think there should be a warning dialog for the "Clear" button, instead of a tooltip. This would make it similar to how the "Reset" button works on the timetable. Also, perhaps using the same icon and text ("Reset") as the timetable would make more sense.

  2. We can afford to be more descriptive on errors. I don't think we should display the gory syntax error, but perhaps something like "Something went wrong when trying to import the file. Try to re-download the planner file from the source!" could help non-tech-savvy users.

Finally, I'm not sure if it's a typo but the "closes #3483" seems to be pointing to an unrelated PR? Wrong number?

@leslieyip02
Copy link
Member Author

Oops, it should be closing #3843.

Copy link
Member

@ravern ravern left a comment

Choose a reason for hiding this comment

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

LGTM! speedy af

@ravern ravern merged commit 0f0c93d into nusmodifications:master Jun 28, 2025
4 of 6 checks passed
Copy link

sentry-io bot commented Jul 2, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Course Planner]: Download/upload/share planner configuration
2 participants