Skip to content

feat: Post Reporting - Report entry in the news article view EXO-89471 - #902

Merged
akhanfir merged 1 commit into
feature/devxfrom
TASK-89471
Sep 1, 2026
Merged

feat: Post Reporting - Report entry in the news article view EXO-89471#902
akhanfir merged 1 commit into
feature/devxfrom
TASK-89471

Conversation

@akhanfir

@akhanfir akhanfir commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Adds the Report entry to the news article detail menu, driven by the activity's server-derived canReport/hasReported flags threaded down from the hosting activity view, with live state sync after reporting. Content edits (title/body) reset existing reports; posting/publishing/categories updates keep them active.

Note for PO/testers: the Report entry appears only when the article view is hosted by an activity (opened from the stream) — an article reached outside the stream (news app, direct link) offers no Report entry, since the eligibility flags travel with the activity payload.

Replaces #895 (retargeted from feature/mips to feature/devx).

@boubaker boubaker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — Round #1

Reviewed as part of the Post Reporting delivery (with Meeds-io/social#6039 and Meeds-io/analytics#435). No blocking finding on this PR — one observation and one nit, anchored inline where possible.


🟢 Observation — articles are reportable only from the stream-hosted view, by construction

The activity prop (and with it canReport) is threaded only through ExoNewsDetailsActivity, which content registers as an activity-stream extension — so the Report entry appears only when the article is opened from the stream page, where social's ActivityReportDrawer (an activity-stream-drawers extension) is mounted and the activity-report-drawer-open event has a listener. On the standalone news detail page the prop is null, the entry is hidden, and there is no dead click — coherent. Worth one line to the PO though: an article reached outside the stream (news app, direct link) offers no Report entry, while the same article in the stream does.

Also: this PR is part of the delivery but absent from the spec's Repositories touched table, and the spec's Functional divergences confirmed still says content-backed activities are excluded from reporting — the resync is tracked on social#6039's summary.


Verified conform: the explicit stale-flip fires only on CONTENT_AND_TITLE updates (posting/publishing/categories don't reset), with a test pinning each direction (testContentEditMarksArticleReportsStale / testNonContentEditKeepsArticleReportsActive) — this is the precise content-change gating the social-side lifecycle listener should also adopt (see the 🟠 on social#6039); the in-place comment explains why the explicit delegation exists (article edits never broadcast the activity update lifecycle); menu entry driven by the server-derived flags, never re-derived client-side; live sync via the activity-reported document event with the comment/post discrimination handled.


Classification: N3 taken alone (additive UI + a service-to-service delegation, no REST/DAO/schema/ACL surface); the delivery as a whole is N1 via social#6039 — max-severity aggregation applies at the feature/mips integration PR.

🤖 Generated with Claude Code

},
beforeDestroy() {
document.addEventListener(`extension-${this.extensionApp}-${this.extensionType}-updated`, this.refreshExtensions);
document.removeEventListener('activity-reported', this.handleActivityReported);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Nit — pre-existing bug one line above: beforeDestroy re-registers the extension listener instead of removing it

beforeDestroy() {
  document.addEventListener(`extension-${this.extensionApp}-${this.extensionType}-updated`, this.refreshExtensions); // pre-existing: should be removeEventListener
  document.removeEventListener('activity-reported', this.handleActivityReported); // your line is correct
}

Your new listener is cleaned up correctly, but the pre-existing line above it adds the extension-updated listener on destroy (leaking one registration per component lifecycle). Since this block is being touched, worth fixing to removeEventListener in the same PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0ec6bd (same amended commit): the pre-existing addEventListener in beforeDestroy is now removeEventListener, and the commit message records the leak fix.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Fixed in a0ec6bd, verified: beforeDestroy now removes the extension-updated listener, and the report flags moved to native booleans consistently with social's serialization change.

@akhanfir

Copy link
Copy Markdown
Contributor Author

Review fixes — addressed at a0ec6bd (amended into the single delivery commit)

  • 🟢 beforeDestroy pre-existing listener leak → ✅ fixed (thread).
  • 🟢 Stream-hosted-only observation → ✅ the PR description now carries the note for the PO/testers.
  • Flag consumption aligned with social#6039's boolean serialization (truthy checks).

🤖 Generated with Claude Code

@boubaker boubaker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — Round #2 (final)

Re-review scoped to 4a2e9e5..a0ec6bd plus verification of Round #1 items, at head a0ec6bd778b3ff73847970b7fdb85d432c865963.

Round #1 item Status
🟢 Pre-existing beforeDestroy re-registered the extension listener Fixed — now removeEventListener.
🟢 Observation: articles reportable only from the stream-hosted view Informational — no change requested; worth a line to the PO at Mips validation.

The incremental diff also aligns the report flags on the native booleans social#6039 now serializes — consistent, no new findings. Nothing outstanding from the AI review side on this PR.

Classification: N3 taken alone; the delivery as a whole is N1 via social#6039 — max-severity aggregation applies at the feature/mips integration PR.

🤖 Generated with Claude Code

Adds the Report entry to the news article detail menu, driven by the
server-derived canReport/hasReported flags threaded down from the hosting
activity view, with live state sync after reporting.

Content edits delegate the report stale flip explicitly to
ActivityReportService: updateNews updates the article activity with
broadcast=false, so the activity update lifecycle event that flips reports
stale for plain posts and comments never fires for articles.
Posting/publishing/categories updates keep reports active
(mutation-verified). The social Service is injected with required=false and
null-guarded - it reaches content through the cross-WAR bridge at runtime
but is absent from this module's own Spring test contexts (the App Center
badge contributors pattern). Also fixes the pre-existing beforeDestroy leak
that re-registered the extension-updated listener instead of removing it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@akhanfir
akhanfir merged commit 45a57b6 into feature/devx Sep 1, 2026
4 checks passed
@akhanfir
akhanfir deleted the TASK-89471 branch September 1, 2026 08:54
akhanfir added a commit that referenced this pull request Sep 2, 2026
…O-89471 (#906)

PO feedback on task 89471 (US01, tested and not validated): the design
places the Report action immediately before Delete in the contextual
menu — same fix as the activity/comment menus in Meeds-io/social (see
the sibling PR).

The Report block moves after the menu extensions, right above the Delete
entry; its behavior is unchanged (pure move, +16/-15).

Follow-up of #902 (merged).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
exo-swf pushed a commit that referenced this pull request Sep 2, 2026
#902)

Adds the Report entry to the news article detail menu, driven by the activity's server-derived canReport/hasReported flags threaded down from the hosting activity view, with live state sync after reporting. Content edits (title/body) reset existing reports; posting/publishing/categories updates keep them active.
exo-swf pushed a commit that referenced this pull request Sep 2, 2026
…O-89471 (#906)

PO feedback on task 89471 (US01, tested and not validated): the design
places the Report action immediately before Delete in the contextual
menu — same fix as the activity/comment menus in Meeds-io/social (see
the sibling PR).

The Report block moves after the menu extensions, right above the Delete
entry; its behavior is unchanged (pure move, +16/-15).

Follow-up of #902 (merged).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants