Skip to content

[Refactor:Notifications] Individual Notification Component#12137

Merged
bmcutler merged 2 commits intomainfrom
individual-noti-component
Oct 17, 2025
Merged

[Refactor:Notifications] Individual Notification Component#12137
bmcutler merged 2 commits intomainfrom
individual-noti-component

Conversation

@JManion32
Copy link
Contributor

@JManion32 JManion32 commented Oct 10, 2025

Why is this Change Important & Necessary?

HomePage.vue has a component, AllNotificationsDisplay.vue, that functions as the entire notification panel for that page.

As more things are added to this file (such as new buttons when we implement it for the Course Notifications page), it is becoming large (~400 lines), and we losing the benefits of the component-based approach that Vue offers.

What is the New Behavior?

Essentially, this PR splits up the AllNotificationsDisplay.vue file. Instead of looping through and displaying divs defined in that file for each individual notification, it now loops through and displays a component, Notification, for each notification. All styling and notification-specific logic has been moved to the new file, Notification.vue, dividing the original file into two ~200 line files.

This change just abstracts logic to improve maintainability. This may help visualize the it (think of these are Vue components):

Before:

HomePage/
├── AllNotificationsDisplay (~400 lines)

After:

HomePage/
├── AllNotificationsDisplay (142 lines)
       ├── Notification (196 lines)

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

Ensure that the functionality of the notifications panel on the home page is unchanged.

Automated Testing & Documentation

There are no automated tests for the notifications system, see #11908.

Other information

This is not a breaking change. I intend to create a follow-up PR to this to convert the Course Notifications page. By breaking the existing code into multiple components, it will be easier to migrate, and maintain.

There is potential to add even more components beyond this, such as one for the header, but these are subject for discussion. I think the individual notifications is the most important for now.

@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.68%. Comparing base (9733059) to head (6fb32e9).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12137   +/-   ##
=========================================
  Coverage     21.68%   21.68%           
  Complexity     9598     9598           
=========================================
  Files           268      268           
  Lines         36620    36620           
  Branches        475      475           
=========================================
  Hits           7941     7941           
  Misses        28208    28208           
  Partials        471      471           
Flag Coverage Δ
autograder 21.39% <ø> (ø)
js 2.07% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.69% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 90.72% <ø> (ø)

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.

Copy link
Contributor

@Rkoester47 Rkoester47 left a comment

Choose a reason for hiding this comment

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

I tested the homepage notifications for this branch, and everything seems to be working properly. I tested: mark as seen, clicking on the notification itself, and clicking on the course hyperlink. All of it functioned properly in both Firefox and Edge, in light and dark themes. The changes you've made to the code seem to have left the homepage notifications in proper working order.

@github-project-automation github-project-automation bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Oct 14, 2025
lavalleeale

This comment was marked as off-topic.

@lavalleeale lavalleeale self-requested a review October 14, 2025 20:27
@automateprojectmangement automateprojectmangement bot moved this from Awaiting Maintainer Review to In Review in Submitty Development Oct 14, 2025
Copy link
Contributor

@lavalleeale lavalleeale left a comment

Choose a reason for hiding this comment

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

Splitting looks good, and local testing showed functionality to be the same

@github-project-automation github-project-automation bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Oct 14, 2025
Copy link
Contributor

@RyanStyron RyanStyron left a comment

Choose a reason for hiding this comment

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

Great refactor without affecting functionality.

@bmcutler bmcutler merged commit ff5bc3b into main Oct 17, 2025
48 of 51 checks passed
@bmcutler bmcutler deleted the individual-noti-component branch October 17, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants