Skip to content

[Feature:InstructorUI] Format notification due dates#12846

Closed
AtCloudDiwash wants to merge 39 commits into
Submitty:mainfrom
AtCloudDiwash:feature/dynamic-notification-due-date-formatting
Closed

[Feature:InstructorUI] Format notification due dates#12846
AtCloudDiwash wants to merge 39 commits into
Submitty:mainfrom
AtCloudDiwash:feature/dynamic-notification-due-date-formatting

Conversation

@AtCloudDiwash

@AtCloudDiwash AtCloudDiwash commented May 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #12845

This PR is the intended to build on #12844

Why is this Change Important & Necessary?

Gradeable release notifications currently store the due date as part of the final notification message. Because of that, the displayed due date does not update when a user changes their selected date/time format preference.

This change stores the due date separately so notification banner dates can be formatted dynamically for the current user.

What is the New Behavior?

Gradeable release notifications now store extra metadata, including the gradeable title and raw due date.

When the notification is displayed, the due date is formatted using the current user’s selected date/time format. If metadata is missing, the old notification text is still used as a fallback.

What steps should a reviewer take to reproduce or test the bug or new feature?

This PR depends on the user date/time format preference feature. Test this after that PR is merged, or test from a branch that includes those changes.

  1. Change the user preferred date format
  2. Navigate to home page and observe the notifications
  3. You'll see the date formats don't change in notification banner
Screenshot 2026-05-09 at 5 49 56 AM

Steps taken to solve

  1. Changed the notification sender so new gradeable release notifications save extra metadata.
  2. Stored the gradeable title and raw due date in that metadata.
  3. Kept the old notification text as a fallback, so old behavior still works if metadata is missing.
  4. Updated the notification model to read the metadata when showing the notification.
  5. Made the notification model format the due date using the current user’s date format preference.
  6. Added a migration to fill in metadata for old gradeable release notifications already in the database.

###Steps to run migration

  1. vagrant ssh
  2. sudo python3 GIT_CHECKOUT/Submitty/migration/run_migrator.py -e course create gradeable_release_notification_metadata.py

@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.63%. Comparing base (b9135e9) to head (9200ee5).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #12846      +/-   ##
============================================
- Coverage     21.64%   21.63%   -0.02%     
- Complexity     9861     9871      +10     
============================================
  Files           268      268              
  Lines         36920    36938      +18     
  Branches        495      495              
============================================
  Hits           7990     7990              
- Misses        28439    28457      +18     
  Partials        491      491              
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.01% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.69% <0.00%> (-0.02%) ⬇️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AtCloudDiwash

Copy link
Copy Markdown
Contributor Author

This PR heavily depends on whether #12844 gets merged, since it is an addition/enhancement to the changes introduced there.

PR #12844 had some issues with how the data was being stored in the database. I felt it would be better practice to separate that concern into its own issue/PR instead of expanding the scope of #12844 further.

So, this PR is intended to build on #12844.

@AtCloudDiwash

Copy link
Copy Markdown
Contributor Author

@jndlansh , this is the pr that fixes the issue related to notification panel. Could you please take a look at it.

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Refer to my review on PR#12844 for changes that should overlap with this PR. Also, one of the user date format preference migrations should be removed.

:type database: migrator.db.Database
"""
database.execute("""
ALTER TABLE users DROP COLUMN IF EXISTS date_format

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't want to drop the column and lose data.

@AtCloudDiwash AtCloudDiwash Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dagemcn completed the requested change with other several overlapping change with pr #12844

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jun 4, 2026
@AtCloudDiwash
AtCloudDiwash requested a review from dagemcn June 4, 2026 15:56
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Jun 4, 2026

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Functionality and code here look good. Tested persistence across log-outs, changing users and different tabs. I'll fully approve once PR#12844 gets merged.

@AtCloudDiwash
AtCloudDiwash requested a review from dagemcn June 9, 2026 03:08

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested with light and dark mode, persists per account when switching accounts and when clearing cookies. Functionality and code look good. Good work on this.

@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Jun 9, 2026

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After talking with our maintainers we would prefer to take a different approach instead of using a migration here. We think it is fine if new notifications are built using the current preference, but we don't need to go back and change all the old ones.

@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Work in Progress in Submitty Development Jun 9, 2026
@dagemcn

dagemcn commented Jun 22, 2026

Copy link
Copy Markdown
Member

closing due to inactivity

@dagemcn dagemcn closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Notification due dates ignore user preferred date format

2 participants