Skip to content

WIP: implement quality-of-life changes for pre-enroll - #995

Open
ejcheng wants to merge 6 commits into
mainfrom
qol_changes_preenroll
Open

WIP: implement quality-of-life changes for pre-enroll#995
ejcheng wants to merge 6 commits into
mainfrom
qol_changes_preenroll

Conversation

@ejcheng

@ejcheng ejcheng commented Apr 14, 2025

Copy link
Copy Markdown
Member

See https://cornelldti.slack.com/archives/C05QHNY8TKL/p1744242627568859

Thanks @ambers7!

TODO:

  1. Use RequirementFulfillmentGraph.getConnectedRequirementsFromCourse() to add the requirement(s) a course satisfies to its course card in the semester plan
  2. Make "master requirements page" listing all unfulfilled requirements and the courses that fulfill them— similar to the paginated "see all courses" section in the left pane but for all unfulfilled requirements
  3. Fix course caution tooltip rendering behind course cards in semester view

@dti-github-bot

dti-github-bot commented Apr 14, 2025

Copy link
Copy Markdown
Member

[diff-counting] Significant lines: 64.

@github-actions

github-actions Bot commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit 9521050):

https://cornelldti-courseplan-dev--pr995-qol-changes-preenrol-5kc7oo53.web.app

(expires Wed, 14 May 2025 06:12:33 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6d4e0437c4559ed895272bbd63991394f1e0e933

Comment on lines +4 to +8
:style="{
background: `#${Math.floor(Math.random() * 0xffffff)
.toString(16)
.padEnd(6, '0')}`,
}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@cornell-dti/course-plan What do you think of this approach to ensure that no two tabs have the same color? It seems pretty questionable to me, but this is the best approach I could come up with for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree it's a bit questionable - since it’s random, there’s still a chance of collision (and color contrast might be inconsistent too). if we really want to ensure uniqueness and consistent colors we could:

  • generate colors from a fixed palette (e.g. COLORS = ['#FFAA00', '#4DA8DA', ...]) and assign them based on tab index or hash of the course ID
  • or use a seeded random function so the same course/tab always gets the same color
    that said, for a quick temporary solution this totally works - just maybe worth revisiting if it ends up looking chaotic in prod haha

@ejcheng
ejcheng marked this pull request as ready for review April 14, 2025 03:59
@ejcheng
ejcheng requested a review from a team as a code owner April 14, 2025 03:59
ejcheng added 2 commits April 14, 2025 00:12
I think this was mentioned in Clemént's design audit for accessibility reasons

@nidhi-mylavarapu nidhi-mylavarapu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the TODOs:

For RequirementFulfillmentGraph.getConnectedRequirementsFromCourse(courseId), we could call this when rendering each course card, and pass the result down as a fulfilledRequirements prop to display somewhere (maybe in a tooltip or under the title?).

for the "master requirements page", maybe we can reuse the existing paginated course list component logic, but instead group/filter by unfulfilled requirements as the top-level sections instead of course categories

$secondaryGray: #858585;
$activeGray: #5b676d;
$disabledGray: #cccccc;
$disabledGray: #78848a;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this changes disabledGray everywhere - was the incorrect hexcode being used originally according to design?

Comment on lines +4 to +8
:style="{
background: `#${Math.floor(Math.random() * 0xffffff)
.toString(16)
.padEnd(6, '0')}`,
}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree it's a bit questionable - since it’s random, there’s still a chance of collision (and color contrast might be inconsistent too). if we really want to ensure uniqueness and consistent colors we could:

  • generate colors from a fixed palette (e.g. COLORS = ['#FFAA00', '#4DA8DA', ...]) and assign them based on tab index or hash of the course ID
  • or use a seeded random function so the same course/tab always gets the same color
    that said, for a quick temporary solution this totally works - just maybe worth revisiting if it ends up looking chaotic in prod haha

return requirementsString.substring(0, requirementsString.length - 2);
}
return 'testingRequirementsString';
// todo: if requirements string is too long, the course card text gets crunched together

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the requirementsString length issue - maybe we could:

Limit the number of requirements shown (e.g. 2 or 3), and if there are more, add a +X more indicator (e.g. "MATH, CS, +2 more")

or switch to rendring them as separate badges (like small pill components) which could wrap or scroll more gracefully on smaller course cards

Either way we might also want to set a max-width or text-overflow: ellipsis style if we’re sticking with plain text for now

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.

3 participants