Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HPoincare
Copy link

Addresses issue #147

  • Updated state calculation to track hours separately for each semester half
  • Modified display format to use Q1/Q2 or Q3/Q4 based on semester

Copy link
Member

@cjquines cjquines left a 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})`;
Copy link
Member

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?

Copy link
Member

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?

Comment on lines 35 to +37
hours: number;
hoursFirstHalf: number;
hoursSecondHalf: number;
Copy link
Member

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; }

Copy link
Member

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

Comment on lines +203 to +208
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;
Copy link
Member

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)

Copy link
Member

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

@cjquines
Copy link
Member

cjquines commented Apr 6, 2025

also thanks for the pr!

@HPoincare
Copy link
Author

Here is a screenshot:
Screenshot 2025-04-06 at 6 54 35 PM

I'll look over your other comments soon. On a cursory glance I agree with all of them.

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.

2 participants