Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TA mode #3875

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

leslieyip02
Copy link
Contributor

Context

Closes #3804.

Adds an option for TAs to hide non-TA lessons. The original issue requested an option to hide non-tutorial lessons, but this would hide labs and recitations as well, so I decided to implement a dropdown menu to toggle TA mode for different lesson types.

I have not been a TA before, so do let me know if this makes sense?

Implementation

  • Each module has a few different lesson types, so TimetableState was updated to have a TaModuleConfig, which maps each module to an array of lesson types.
  • For modules with TA lessons, TimetableContent only renders lessons which are marked as TA and ignores other lesson types.
  • TA modules will not be counted towards total units, and will also not be shown in the exam calendar.
  • TA modules are suffixed with (TA) in the timetable
  • The ColorPicker for TA modules has a half-filled color box

Toggle TA mode

Timetable.-.NUSMods.Mozilla.Firefox.2024-12-01.16-56-42.mp4

No TA-able mods

When the mod has no TA-able mods (i.e. just lectures), the menu button is disabled.

image

Export/Import

Mozilla.Firefox.Private.Browsing.2024-12-01.17-39-17.mp4

Exam clash

TA mods are not shown in the exam calendar, and do not contribute to exam clashes.

Left: Updated, Right: Current

Screenshot 2024-12-01 165844

I also made it so that hidden mods no longer creates a clash warning.

Screenshot 2024-12-01 165811

Other Information

I had some trouble trying to get Tooltip to work with Downshift. When using Tooltip inside DownShift, I needed to call getRootProps, but it seems to be creating these warnings from tippy.js:

Screenshot 2024-12-01 170802

Since the versions of both @tippy.js/react and downshift are quite outdated, I wasn't able to find docs to resolve the warnings.

Copy link

vercel bot commented Dec 1, 2024

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 Dec 17, 2024 9:05am

Copy link

vercel bot commented Dec 1, 2024

@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 Dec 1, 2024

Codecov Report

Attention: Patch coverage is 71.61290% with 44 lines in your changes missing coverage. Please review.

Project coverage is 55.01%. Comparing base (988c6fd) to head (3eae3a6).
Report is 28 commits behind head on master.

Files with missing lines Patch % Lines
...site/src/views/timetable/TimetableModulesTable.tsx 39.13% 14 Missing ⚠️
website/src/utils/timetables.ts 70.96% 9 Missing ⚠️
website/src/reducers/timetables.ts 77.14% 8 Missing ⚠️
website/src/actions/timetables.ts 62.50% 6 Missing ⚠️
website/src/views/timetable/TimetableContainer.tsx 50.00% 4 Missing ⚠️
website/src/actions/export.ts 0.00% 2 Missing ⚠️
website/src/views/timetable/TimetableContent.tsx 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3875      +/-   ##
==========================================
+ Coverage   54.52%   55.01%   +0.49%     
==========================================
  Files         274      276       +2     
  Lines        6076     6247     +171     
  Branches     1455     1515      +60     
==========================================
+ Hits         3313     3437     +124     
- Misses       2763     2810      +47     

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

Copy link
Member

@zwliew zwliew left a comment

Choose a reason for hiding this comment

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

This looks quite good so far! Thanks for even considering timetable exports and adding some tests.

However, the ability to add multiple tutorials/lab/recitations slots to the timetable in TA mode is missing. This is useful for those TA-ing multiple slots. I suggest making each tutorial/lab/recitation slot toggleable in TA mode, instead of the usual behaviour that switches between slots.

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.

Allow TA's to hide non tutorial lessons
2 participants