-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Notifications > Comments: remove Notification when Comment is removed #17992
Conversation
…hen the next notification is viewed.
In split view, there is a legacy issue where, if you trash/spam a Comment while viewing it, the Notification is removed from the Notifications list but the details are still shown. Even though this PR improves that, it can still be seen by:
I'll look at this separately since it's not caused by this change. |
@@ -9,6 +9,7 @@ import CoreData | |||
protocol CommentDetailsNotificationNavigationDelegate: AnyObject { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized this protocol name isn't really accurate with the new method I added. I'll make a note to rename it in a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works as described. Changes are LGTM!
In split view, there is a legacy issue where, if you trash/spam a Comment while viewing it, the Notification is removed from the Notifications list but the details are still shown.
... I'll look at this separately since it's not caused by this change.
👍 .
I'd like to add that, for documentation purposes, this PR slightly changes the flow of comment moderation (especially related to Spam and Trash) in Notifications. Previously:
- When tapping Spam or Trash, the details view is immediately popped.
- In the Notifications list view, an undo overlay is displayed on top of the spammed/trashed Notification cell.
- The spam/trash action is only invoked from the list view after a certain timeout (
Syncing.undoTimeout
). - Finally, the list view is refreshed to remove the notification cell.
I think the flow needed some adjustments here because the moderation logic is now invoked by the (new) detail view instead of the list view. This led to the core issue mentioned in the implementation notes and addressed by this PR,
If the Notification in NotificationsViewController is updated as soon as its Comment is trashed or spammed, the Notification will be removed from fetched results.
Ref: #17790
When comments are moderated from the Notification Comment details view, the affected notifications are updated when the notifications list is re-shown. The effect is if a Comment is trashed, spammed, or deleted, its Notification is removed from the Notifications list.
In addition, comment moderation confirmation notices are no longer displayed for Notification comments.
Implementation notes:
If the Notification in
NotificationsViewController
is updated as soon as its Comment is trashed or spammed, the Notification will be removed from fetched results. This causes a couple of issues:So the affected Notifications are tracked by
NotificationCommentDetailCoordinator
.NotificationsViewController
syncs the Notifications when appropriate to update the Notifications list:viewWillAppear
).To test:
Regular View:
Delete Permanently
.Split View:
Delete Permanently
does not immediately nix the notification as in regular view. If you select another Notification, it will then be removed. I'll address this separately as it is related to the issue I commented on below.Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.