Skip to content
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

[DRAFT] Refactor NotificationsPage and NotificationSection #6815

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

mcbouslog
Copy link
Contributor

@mcbouslog mcbouslog commented Sep 7, 2023

Staging branch URL: https://pr-6815.pfe-preview.zooniverse.org

Closes #6793 . Issue summary - the NotificationsPage is requesting 50 notifications then grouping into project/Zooniverse sections. If a user has a notification from a project not included in the 50 notification response, then that project and related notification(s) will not show.

Describe your changes.

  • refactor NotificationsPage and NotificationSection to remove componentWillMount and componentDidMount
  • request all notifications from NotificationsPage
  • refactor NotificationSection to remove notification requests (all notifications are requested in and passed down from NotificationPage)
  • update and add tests per refactors

DMed user that noted issue in Talk, confirmed with staged branch that issue is resolved.

Let me know if you'd like me to mention your username in Talk somewhere or comment on a Discussion your subscribed to, so you have unread (delivered: false) notifications.

Note: initially refactored as functional component, but had issues with tests, ended up keeping as class component to maintain (ended up increasing) test coverage. Not ideal and open to suggestion, but I think ok based on limited time to refactor PFE.

Based on my notifications (127 Zooniverse, 1 NfN Big Bee Bonanza, 1 test project)
Comparison of https://talk.zooniverse.org/notifications? requests from NotificationsPage and NotificationSection:

CURRENT:

PR/CHANGES

Required Manual Testing

  • Does the non-logged in home page render correctly?
  • Does the logged in home page render correctly?
  • Does the projects page render correctly?
  • Can you load project home pages?
  • Can you load the classification page?
  • Can you submit a classification?
  • Does talk load correctly?
  • Can you post a talk comment?

Review Checklist

  • Does it work in all major browsers: Firefox, Chrome, Edge, Safari?
  • Does it work on mobile?
  • Can you npm ci and app works as expected?
  • If the component is in coffeescript, is it converted to ES6? Is it free of eslint errors? Is the conversion its own commit?
  • Are the tests passing locally and on GitHub Actions?

Optional

Copy link
Contributor

@eatyourgreens eatyourgreens left a comment

Choose a reason for hiding this comment

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

The React global was removed from React in 16.14. Importing it won't break anything but won't do anything either.

https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html

app/pages/notifications/index.jsx Outdated Show resolved Hide resolved
@mcbouslog mcbouslog marked this pull request as ready for review September 11, 2023 21:17
@mcbouslog mcbouslog changed the title [DRAFT] Refactor NotificationsPage and NotificationSection Refactor NotificationsPage and NotificationSection Sep 11, 2023
@coveralls
Copy link

coveralls commented Sep 11, 2023

Coverage Status

coverage: 57.391% (+0.2%) from 57.194% when pulling 4d11701 on notifications-getAll into 3d4487f on master.

@eatyourgreens
Copy link
Contributor

The updated page is very slow for me (I have a lot of notifications.) Maybe update state incrementally as each request resolves?

@mcbouslog
Copy link
Contributor Author

The updated page is very slow for me (I have a lot of notifications.) Maybe update state incrementally as each request resolves?

This is a great suggestion, thanks! I will attempt to refactor accordingly.

I also want to try a more substantive UX change where there's an unread (any/all projects/zooniverse) section and a contextual section (i.e. within project, then that all of project's notifications paginated, within zoonvierse, then zooniverse section of all zooniverse notifications paginated).

I'm going to change this to draft for now, refactor, and eventually open the other UX option as well, to compare.

@mcbouslog mcbouslog marked this pull request as draft November 10, 2023 20:28
@mcbouslog mcbouslog changed the title Refactor NotificationsPage and NotificationSection [DRAFT] Refactor NotificationsPage and NotificationSection Nov 10, 2023
@mcbouslog mcbouslog mentioned this pull request Dec 1, 2023
18 tasks
@mcbouslog mcbouslog removed the request for review from a team December 29, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing notifications
3 participants