Skip to content

Conversation

@martim07833
Copy link
Contributor

@martim07833 martim07833 commented Nov 3, 2025

Closes #1624
As a way to improve the user experience while using UNI, the way the schedule section of the homepage functioned was changed. Instead of always showing the next two classes, regardless if they are today, tommorow or in a week, a new message appears on top of the schedule card, that states if the user has no more classes for that day and what the day of the week the user's next class is. Also, if the user's next two classes are on different days, only the next class will show up.
For the sake of testing, new mock lectures were added in order to see how the code works. Naturally, these will be removed.

Here are a few of said test cases:

Both classes are today

Lecture(
      'ESOF',
      'ESOF',
      'T',
      now.add(const Duration(days: 0, hours: 1)),
      now.add(const Duration(days: 0, hours: 2)),
      'Room B123',
      'ademaraguiar',
      'ademaraguiar',
      101,
      '1',
      1001,
    ),
    Lecture(
      'LTW',
      'LTW',
      'TP',
      now.add(const Duration(days: 0, hours: 2)),
      now.add(const Duration(days: 0, hours: 3)),
      'Room B234',
      'arestivo',
      'arestivo',
      102,
      '2',
      1002,
    )

Only one of the users classes is today

    Lecture(
      'ESOF',
      'ESOF',
      'T',
      now.add(const Duration(days: 1, hours: 1)),
      now.add(const Duration(days: 1, hours: 2)),
      ...

    Lecture(
      'LTW',
      'LTW',
      'TP',
      now.add(const Duration(days: 0, hours: 2)),
      now.add(const Duration(days: 0, hours: 3)),
      ...

The user's next classes are tomorrow

    Lecture(
      'ESOF',
      'ESOF',
      'T',
      now.add(const Duration(days: 1, hours: 1)),
      now.add(const Duration(days: 1, hours: 2)),
      ...

    Lecture(
      'LTW',
      'LTW',
      'TP',
      now.add(const Duration(days: 1, hours: 2)),
      now.add(const Duration(days: 1, hours: 3)),
      ...

One of the user's classes is 3 days from now, the other is more than a week from now

Note: this was written on a tuesday.

    Lecture(
      'ESOF',
      'ESOF',
      'T',
      now.add(const Duration(days: 3, hours: 1)),
      now.add(const Duration(days: 3, hours: 2)),
      ...

    Lecture(
      'LTW',
      'LTW',
      'TP',
      now.add(const Duration(days: 8, hours: 2)),
      now.add(const Duration(days: 8, hours: 3)),
      ...

No more classes this week

    Lecture(
      'ESOF',
      'ESOF',
      'T',
      now.add(const Duration(days: 8, hours: 1)),
      now.add(const Duration(days: 8, hours: 2)),
      ...

    Lecture(
          'LTW',
          'LTW',
          'TP',
          now.add(const Duration(days: 8, hours: 2)),
          now.add(const Duration(days: 8, hours: 3)),
    ...

Review checklist

  • Terms and conditions reflect the changes

View Changes

  • Description has screenshots of the UI changes.
  • Tested both in light and dark mode.
  • New text is both in portuguese (PT) and english (EN).
  • Works in different text zoom levels.
  • Works in different screen sizes.

Performance

  • No helper functions to return widgets are added. New widgets are created instead.
  • Used ListView.builder for Long Lists.
  • Controllers (TextEditingController, ...) are beeing disposed of in dispose() method.

@pedroafmonteiro pedroafmonteiro changed the title began development for schdule message fixes fix: began development for schdule message fixes Nov 3, 2025
@pedroafmonteiro pedroafmonteiro changed the title fix: began development for schdule message fixes fix: better way to represent classes on the home page card Nov 3, 2025
@martim07833 martim07833 marked this pull request as ready for review November 4, 2025 22:11
@martim07833
Copy link
Contributor Author

martim07833 commented Nov 4, 2025

Note: i noticed a bug when using the lectures that are scraped off sigarra, that when a lecture happened today, regardless of it ending or not, it will appear. For example today I had RCOM from 8:30 AM - 10:30 AM, it's now 10:14 PM, the message appears saying I have no more classes today however that said class that has already ended appears on my schedule. Will investigate what's wrong later on

@pedroafmonteiro pedroafmonteiro marked this pull request as draft November 5, 2025 09:20
@pedroafmonteiro
Copy link
Member

Hi! Just a heads up on this PR after reviewing with the team on the latest meeting, I think the icon should be changed to a beer icon instead of the sun to keep consistency.

@martim07833
Copy link
Contributor Author

Hi! Just a heads up on this PR after reviewing with the team on the latest meeting, I think the icon should be changed to a beer icon instead of the sun to keep consistency.

Okay, good point. I will change it to mantain the visual consistency.

@martim07833 martim07833 self-assigned this Nov 11, 2025
@martim07833
Copy link
Contributor Author

martim07833 commented Nov 11, 2025

It's currently functional!

Testing

I do understand how inconvenient it is to test a feature like this, so I will keep the mock lectures for now. I also am aware of the importance of doing actual tests, but I don't hate myself that much.

@martim07833 martim07833 marked this pull request as ready for review November 11, 2025 16:47
@martim07833 martim07833 requested a review from a team November 11, 2025 16:47
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60%. Comparing base (b826e54) to head (dc1aa8b).
⚠️ Report is 1 commits behind head on develop.

❌ Your project check has failed because the head coverage (60%) is below the target coverage (70%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #1715   +/-   ##
=======================================
  Coverage       60%     60%           
=======================================
  Files            2       2           
  Lines           81      81           
=======================================
  Hits            48      48           
  Misses          33      33           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pedroafmonteiro
Copy link
Member

Hi! While testing I noticed something. At the moment is friday night, meaning I don't have any more classes today or this week. However it's showing me my classes for monday. Is this how it is supposed to be? maybe only show the next week classes on sunday, what do you think?

@martim07833
Copy link
Contributor Author

Hi! While testing I noticed something. At the moment is friday night, meaning I don't have any more classes today or this week. However it's showing me my classes for monday. Is this how it is supposed to be? maybe only show the next week classes on sunday, what do you think?

Yes, I thought the idea would be to only display the "You don't have any more classes this week", if I had no classes planned in the next 7 days. I could make it so it displays that message as soon as the week is "over" but I don't see why it would be beneficial to only display monday's classes on sunday in this case.

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.

Add a brief description indicating the day of the week in schedule card

3 participants