-
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 P2] Commen Moderation #23225
[Notifications P2] Commen Moderation #23225
Conversation
Generated by π« Danger |
π² You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
π² You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
|
||
private weak var changeStatusViewController: BottomSheetViewController? | ||
weak var changeStatusViewController: BottomSheetViewController? | ||
private var commentModerationViewModel: CommentModerationViewModel? |
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.
Nit: this viewModel
can be non-optional by making it lazy
:
private lazy var commentModerationViewModel: CommentModerationViewModel = createCommentModerationViewModel()
Hey @alpavanoglu, I've noticed a UI glitch in the moderations view where the hosting view doesn't properly resize when the state changes. While the SwiftUI view itself resizes, the hosting view fails to adjust accordingly. Here's how you can reproduce the issue:
This resizing issue occurs when changing to any state but is most noticeable when switching between "Approved" and "Trash/Spam." I encountered a similar issue in the past, and it was tricky to adjust the hosting view's height without breaking the animation. I think a simple fix for our case would be to set a fixed height for all states.
|
...ress/Classes/ViewRelated/Notifications/Comment Moderation/CommentModerationOptionsView.swift
Outdated
Show resolved
Hide resolved
...ress/Classes/ViewRelated/Notifications/Comment Moderation/CommentModerationOptionsView.swift
Outdated
Show resolved
Hide resolved
WordPress/Classes/ViewRelated/Notifications/Comment Moderation/CommentModerationViewModel.swift
Outdated
Show resolved
Hide resolved
isLoading = true | ||
coordinator.didSelectOption() | ||
commentService.approve(comment, success: { [weak self] in | ||
self?.handleStatusChangeSuccess(state: .approved(liked: false)) |
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.
Same comment as this one
Hey, @salimbraksa |
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 it and it works cool!
I'm confirming that the resizing issue happens when entering to the notification with ether "Spam" or "Trash" status.
One more minor thing is a clickable comment's author bar between Comment Approved
and Like comment
sections. It's clickable but is not actionable. Are there any plans for that or we can disable the click animation?
If you mean the reply component, that will be replaced with the new reply component once it is built. |
if initialIsLiked { | ||
track(withEvent: .notificationsCommentLiked) { comment in | ||
CommentAnalytics.trackCommentUnLiked(comment: comment) | ||
} |
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.
notificationsCommentUnliked
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.
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.
LG2M! π’
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.
LGTM! π
8704144
into
feature/notifications_refresh_p2
Fixes #https://github.com/Automattic/wordpress-mobile/issues/34
Fixes #https://github.com/Automattic/wordpress-mobile/issues/35
Fixes #https://github.com/Automattic/wordpress-mobile/issues/36
Description
This PR connects the moderation actions to Network along with tracks. It also improves the loading state for the buttons.
I moved a bunch of code from
CommentDetailViewController
toCommentModerationViewModel
. We should follow that up with tests to make it nicer since now it is possible. I'll try to do another PR for some tests.Screen Recording
Simulator.Screen.Recording.-.iPhone.15.-.2024-05-17.at.22.24.30.mp4
Testing Steps
Install & Login to Jetpack App
Navigate to Notifications
Every test step will proceed from this point.
Approve Comment
Like & Unlike
Trash
Spam
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: