PROD-9616 - #5025
Conversation
…wn activity is deleted
…when the shown activity is deleted
Follow-up hardening on the "view more comments" modal delete fix, from the two-reviewer pass: - Clear activityPinHasUpdates before triggering the modal close (legacy). Pinning the post from inside the modal and then deleting it made the close-button's sync handler call refreshActivities() unconditionally, reloading the whole feed from page 1 over the anchor scroll and losing the member's scroll position. - Make the feed anchor lookup robust. prev()/next() only filter the immediate sibling, so a load-more row silently skipped the anchoring, and the trailing placeholder li (which carries the activity-item class) could become the scroll target. Use prevAll()/nextAll().first() and exclude the placeholder per theme (.activity-popup on legacy, .bb-rl-activity-popup on ReadyLaunch). - Fix the media-path close gate, which was dead code. The pre-existing cleanup selector goes through querySelectorAll, which matches duplicate ids, so it already removes the modal's copy of the activity li - the old gate then looked for that same li and could never pass. Gate on "modal visible and its activity list now empty" instead, which fires exactly when the displayed activity is gone and keeps a modal showing a different activity open. Comments reworded to state the real mechanism. - Fall back to hiding the model wrapper when a theme override renames the close control, instead of silently leaving the emptied modal open. - Document the post-close slideUp as an intentional detached-node no-op for the modal path (an early return there would skip the bp_activity_ajax_delete_request triggers the theatre listeners use).
The media-path close (deleting the last attached photo via its own delete control, which removes the whole activity) triggers the same close button as the direct-delete path, so activitySyncOnModalClose runs its unconditional refreshActivities() branch when a pin was toggled from inside the modal - reloading the feed from page 1 and losing the member's scroll position. Apply the same activityPinHasUpdates reset the direct-delete path got in 99a3a01, typeof-guarded since this runs in buddypress-media.js. ReadyLaunch needs no change - its sync handler has no unconditional pin branch.
|
@claude |
|
Claude finished @jitendrabanjara1991's task in 4m 54s —— View job Code Review
SummaryThis PR fixes a real bug: deleting (or spamming) an activity from inside the "view more comments" modal only removed the modal's copy of the The four commits show a genuine two-pass self-review: the third commit ("Harden the modal-delete flow per review") already fixes the exact issues I'd normally flag — Things verified while reviewing
Minor/non-blocking observations
I did not run Overall: solid, well-reasoned fix with good edge-case handling. No blocking issues found. |
|
@claude |
Code Review
SummaryThis PR fixes a real bug: deleting (or spamming) an activity from inside the "view more comments" modal only removed the modal's copy of the Verified correct
Minor/non-blocking observations
I did not run Overall: solid, well-reasoned fix with good edge-case handling. No blocking issues found. |
|
@claude "Confirmed real, cosmetic only — activity.js has no cached modal object to scope from (its gate uses closest().length directly), media.js scopes because it already held the object for its gate. Accepting the variance; will align if these blocks are touched again." |
Tasks
VerificationConfirmed — the explanation is accurate. Checked all four files directly:
ReadyLaunch equivalents follow the identical pattern:
So the root cause is structural, not an oversight: |
Jira Issue:
https://buddyboss.atlassian.net/browse/PROD-9616
General Note
Keep all conversations related to this PR in the associated Jira issue(s). Do NOT add comment on this PR or edit this PR’s description.
Notes to Developer
Notes to Reviewer