Skip to content

[$300] Update UI: Watching feature #577

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

Closed
Oanh-and-only-Oanh opened this issue Apr 15, 2021 · 13 comments
Closed

[$300] Update UI: Watching feature #577

Oanh-and-only-Oanh opened this issue Apr 15, 2021 · 13 comments

Comments

@Oanh-and-only-Oanh
Copy link

Oanh-and-only-Oanh commented Apr 15, 2021

Expected behavior:
PUBLIC FORUMS

  1. If user is "watching" a parents category, the eye ball should be turned on for all sub-threads in that parents category
  2. If user turns off the "watch" feature on any sub-thread, the eyeball icon should be turned off on the parent category
  3. Add "watch" eyeball icon on the parent level next to title. See screenshot below
@hokienick
Copy link

Sub-eyeball

@jmgasper
Copy link
Collaborator

@atelomycterus - Please see above and let me know your thoughts

My initial concerns relayed to the team were:

The problem is that, if a user has a watch on the main category, they do not have watches on each individual thread - that's implicit.
So, if the user un-watches a thread, we have to:

  • Unwatch the category
  • Watch every thread explicitly
  • Remove the watch for the single thread that was unclicked

And, if the user chooses to watch the whole category again, we have to:

  • Unwatch every thread
  • Add the watch to the category

Not a big deal, but I just wanted to point out that this is a little more complex than it may appear on the surface.

The other side effect that we have to think about is what happens if a user turns the watch off for a parent category and a new thread is added? Do we watch that thread by default or no?

@jmgasper jmgasper changed the title Update UI: Watching feature [$300] Update UI: Watching feature Apr 19, 2021
@jmgasper
Copy link
Collaborator

Challenge https://www.topcoder.com/challenges/eac0097e-cb13-4b16-9b5f-fc115c5fcec0 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator

@atelomycterus - Any thoughts on this one? Is there any way we can have a category level watch but ignore specific discussions underneath that category watch?

@jmgasper
Copy link
Collaborator

Challenge https://www.topcoder.com/challenges/eac0097e-cb13-4b16-9b5f-fc115c5fcec0 has been assigned to obog.

This is an automated message for ghostar via Topcoder X

@atelomycterus
Copy link
Collaborator

atelomycterus commented Apr 20, 2021

@jmgasper I keep in mind, but did not want to rush to this task.

From the screen above User is watching New Here & Getting Started category.

DB

Watching a category: data are stored in UserMeta table. 4 records should be inserted per a watched category:

Preferences.Email.NewComment.CATEGORY_ID
Preferences.Email.NewDiscussion.CATEGORY_ID
Preferences.Popup.NewComment.CATEGORY_ID
Preferences.Popup.NewDiscussion.CATEGORY_ID

Watching a category (discussions type)

Example, User is watching New Here & Getting Started category.

  1. If user is "watching" a parents category, the eye ball should be turned on for all sub-threads in that parents category

Ok, we can show the green eye ball.

  1. If user turns off the "watch" feature on any sub-thread, the eyeball icon should be turned off on the parent category
  • Unwatch the category
    Yes, remove data from UserMeta table.

  • Watch every thread explicitly

  • Remove the watch for the single thread that was unclicked

Yes, need to get all discussion IDs in CategoryID except unclicked discussionID and insert XXX records with Bookmaked flag (1) in UserDiscusssion table.

And, if the user chooses to watch the whole category again, we have to:

  • Unwatch every thread
    For consistency, it'd better to set Bookmarked flag = 0 for all discsussion with this categoryID in UserDiscussion table.
  • Add the watch to the category
    Yes, insert data into UserMeta table.

The other side effect that we have to think about is what happens if a user turns the watch off for a parent category and a new thread is added?
Do we watch that thread by default or no?

No notifications if a new thread is added or a new comment is added for previously created threads.

I think a small change will help simplify it and we can meet the requirements.

  1. If user is "watching" a parents category, the eye ball should be turned on for all sub-threads in that parents category.

  2. If user turns off the "watch" feature on any sub-thread, the eyeball icon IS NOT changed on the parent category.
    We don't remove data from UserMeta table. So user can receive notifications if a new thread is added or new comment is added for other threads.

Show the grey eye ball icon for an unwatched sub-thread only.

We add only one record in UserDiscussion with Bookmaked flag = 0. Bookmaked column has existed in UserDiscussion.
So we don't need to insert a bunch of new records in UserDiscussion.

Need to fix Vanilla notifications if user watches a category and new comments are added to unwatched thread then don't send any notifications.

If user turns on the "watch" feature on this sub-thread again. We need to update Bookmaked flag = 1.

3.Add "watch" eyeball icon on the parent level next to title. See screenshot below

Ok

Let me know your feedback. Thanks!

Watching a category (nested type)

Example, Watching General category, the parent of New Here & Getting Started category
It's more complicated case. Let's me know if this is in the scope.

@jmgasper
Copy link
Collaborator

@atelomycterus - This is great information, thanks, and in-line with what I was hoping we'd be able to do. Let's skip watching the root category, like General for now - we can figure that out later.

@atelomycterus
Copy link
Collaborator

@jmgasper Please apply PRs:

Thanks!

Testing

Please clear browser cache before testing. Let me know if you have any questions.

image

image

@jmgasper
Copy link
Collaborator

@atelomycterus - This looks really good to me, thanks! I'm just getting feedback from Topcoder as well.

@jmgasper
Copy link
Collaborator

@atelomycterus - One clarification from Topcoder:

If a user is watching a category and turns "off" the watch on a discussion underneath that category, Topcoder would like the category watch to be turned off.

@atelomycterus
Copy link
Collaborator

atelomycterus commented Apr 21, 2021

@jmgasper

If a user is watching a category and turns "off" the watch on a discussion underneath that category, Topcoder would like the category watch to be turned off.

Fixed.

Testing

Please correct me if I am wrong. This is implemented only for Public Forums.

action results
watch a category (grey + init state: default, it means user hasn't clicked on watching/unwatching a discussion) category - green , all discussions - green, email notifications (new discussions/comments)
category(green) , unwatch it category - gray , discussions - gray, no notifications
action results
watch another category (grey+init state: default) category - green , discussions - green, get email notifications (comments+new discussions)
unwatch a discussion in this category category - grey, unwatched discussion - grey, other discussions without changes (green), get email notifications (new discussions + new comments for discussions with green icons), no email notifications about new comments for the unwatched discussion
new discussion added by an user new discussion with the green icon + get email notifications about new comments
unwatch this discussion no email notifications about new comments for this discussion
a category (green), unwatch it no email notificatins for new discussions/comments, discussions unwatched/watched manually - no changes, other discussions - grey icons
a category (grey, but has been watched earlier), watch again email notificatins for new discussions/comments, discussions unwatched/watched manually - no changes, other discussions - green icons

Please apply PRs:

topcoder-platform/forums-groups-plugin#85
#591

Thanks!

@jmgasper
Copy link
Collaborator

@atelomycterus - Looks good, thanks. I'm going to close this out now and will take any additional feedback from Topcoder as new tickets.

@jmgasper
Copy link
Collaborator

Payment task has been updated: https://www.topcoder.com/challenges/eac0097e-cb13-4b16-9b5f-fc115c5fcec0
Payments Complete
Winner: obog
Copilot: ghostar
Challenge eac0097e-cb13-4b16-9b5f-fc115c5fcec0 has been paid and closed.

This is an automated message for ghostar via Topcoder X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants