-
Notifications
You must be signed in to change notification settings - Fork 30
Display semester half hours as Q1/Q2 or Q3/Q4 based on semester #174
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you screenshot what this looks like? i forget how much space there is there in that area
// Use Q1/Q2 for fall semester, Q3/Q4 for spring semester | ||
const [firstLabel, secondLabel] = state.term.semester === 'f' ? ['Q1', 'Q2'] : ['Q3', 'Q4']; | ||
|
||
return `\u2264 ${hours.toFixed(1)} hours (${hoursFirstHalf.toFixed(1)} ${firstLabel}, ${hoursSecondHalf.toFixed(1)} ${secondLabel})`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might as well use ≤ directly in the string
also, what's the rationale for having ≤ here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i see the rationale for ≤
can we have a tooltip instead though?
hours: number; | ||
hoursFirstHalf: number; | ||
hoursSecondHalf: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about the type
hours: { firstHalf: number; secondHalf: number; }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and omit the max hours, which i think we can recompute in the thing when we need to? unless we use it somewhere else
if ('rawClass' in act) { | ||
// Include if class is full semester or first half | ||
return !act.rawClass.half || act.rawClass.half === 1; | ||
} | ||
// Include all non-class activities in both halves | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you feel about
act => !('rawClass' in act) || !act.rawClass.half || act.rawClass.half === 1
or perhaps
act => [
!('rawClass' in act), // non-class activity
!act.rawClass.half, // full-semester class
act.rawClass.half === 1, // first half
].some(Boolean)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very nit-ty btw, so take it or leave it
also thanks for the pr! |
Addresses issue #147