Show a toast after successfully submitting a comment. - #25945
Show a toast after successfully submitting a comment.#25945Vivek09Chahal wants to merge 3 commits into
Conversation
|
Currently only implemented Toast message show up, as we don't have access to the unapproved comments. So can't implement
this for now as comment API only send the data of the approved comments. |
| iconColor: UIAppColor.success, title: Strings.commentHeldForModeration | ||
| )) | ||
| .post() | ||
| } |
There was a problem hiding this comment.
This notice does not apply to all sites, right? Some site you can just publish without being reviewed. Like, if you are member of another site, your comments on that site should go straight to approved?
There was a problem hiding this comment.
ok will update according to that 🤔
There was a problem hiding this comment.
Updated Code, now toast will show only when comment is unapproved.
The core problem: the composer had no way to know whether a comment was actually held for moderation. I traced the real status through the whole call chain and made it flow back to the UI.
Description
Open issue: #24573
When a user submits a comment (or a reply) on a post, the composer previously just dismissed with no feedback. This adds a toast/notice confirming the submission, shown only when the comment is held for moderation (i.e. not auto-approved), so the user understands why their comment isn't visible yet.
Changes
The core problem: the composer had no way to know whether a comment was actually held for moderation. I traced the real status through the whole call chain and made it flow back to the UI.
CommentService(replyToPost:/replyToHierarchicalCommentWithID:) — thesuccessblock now passes back the createdComment(void (^)(Comment * _Nullable)) so callers can inspect its approval status. The reply object is re-fetched from the main context viaexistingObjectWithID:error:.CommentCreateViewModel—save(content:)and the internal_save/sendCommentclosures now returnBool("is pending moderation"), derived fromnewComment?.isApproved() == false.CommentCreateViewController— after a successful save, once the composer is dismissed it posts aNoticewithInAppUpdateNoticeStylewhenisPendingModerationistrue. Copy: "Comment is awaiting review" (new localized stringcommentCreate.commentHeldForModeration).CommentDetailViewController—createReply/createPostCommentReplyupdated to propagate the sameBoolthrough to the composer.InAppUpdateNoticeStyle— extended with a new initializer taking an optional SF Symbolicon,iconColor, andtitle:titleis given → builds anattributedMessage(icon inline before bold text) and makes the notice auto-dismiss.nil→ keeps the original persistent in-app-update banner behavior.isDismissableis now set per-instance instead of a hardcodedfalse.checkmark.seal.filltintedUIAppColor.success.Testing instructions
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-08-26.at.18.18.44.mov