Skip to content

Conversation

@santhosh-apphelix-2u
Copy link

This PR introduces the Auto-Flag Banner feature as part of the AI Moderation UI implementation.
The banner is automatically displayed when content is flagged as possible spam, based on the is_spam flag returned from the API response.

Key Updates

  • Added Auto-Flag Banner component for thread, response, and comment levels.
  • Banner message: "Content automatically reported as possible spam pending staff review."
  • Applied consistent styling aligned with the existing “Content Reported for Staff Review” banner.
  • Integrated banner visibility logic using the is_spam key from API response.
  • Added an **information ** icon at the end of the banner:
  • On click, it opens a modal explaining the purpose of the automatic spam detection.

Ref Ticket - https://2u-internal.atlassian.net/browse/COSMO2-771

Copilot AI review requested due to automatic review settings November 7, 2025 12:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds automatic spam detection and flagging functionality to the discussions feature. It introduces a new AutoSpamAlertBanner component that displays a warning when content is automatically flagged as potential spam, with an explanatory modal providing details about the automated flagging process.

Key changes:

  • Created AutoSpamAlertBanner component with danger alert banner and explanatory modal
  • Integrated spam detection banner into Post, Comment, and Reply components
  • Added internationalized messages for spam alert banner and modal content

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/discussions/common/AutoSpamAlertBanner.jsx New component that renders spam warning banner with help modal
src/discussions/common/index.js Exports the new AutoSpamAlertBanner component
src/discussions/posts/post/Post.jsx Integrates spam banner, extracts is_spam from thread data
src/discussions/post-comments/comments/comment/Comment.jsx Integrates spam banner, extracts is_spam from comment data
src/discussions/post-comments/comments/comment/Reply.jsx Integrates spam banner with proper layout, extracts is_spam from comment data
src/discussions/messages.js Adds internationalization messages for spam banner and modal

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 7, 2025 12:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 10, 2025 10:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@santhosh-apphelix-2u santhosh-apphelix-2u force-pushed the COSMO2-771-ai-moderation-ui branch from 1e079de to f25cbf5 Compare November 10, 2025 11:08
Copilot AI review requested due to automatic review settings November 10, 2025 11:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 10, 2025 11:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 11, 2025 02:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@santhosh-apphelix-2u santhosh-apphelix-2u force-pushed the COSMO2-771-ai-moderation-ui branch from 782ccb8 to 12a6048 Compare November 11, 2025 03:02
Copilot AI review requested due to automatic review settings November 11, 2025 03:19
Copilot finished reviewing on behalf of santhosh-apphelix-2u November 11, 2025 03:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chintanjoshi-apphelix-2u chintanjoshi-apphelix-2u left a comment

Choose a reason for hiding this comment

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

A minor comment, is approved otherwise

Copilot AI review requested due to automatic review settings November 11, 2025 05:53
Copilot finished reviewing on behalf of santhosh-apphelix-2u November 11, 2025 05:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +79 to +80
// If isSpam is not provided in the API response, default to false
const isSpamFlagged = isSpam || false;
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment and the code logic are redundant. The expression isSpam || false already provides the default value when isSpam is undefined, null, or false. Either remove the comment as it describes obvious behavior, or simplify to const isSpamFlagged = Boolean(isSpam); if you want to be more explicit about type conversion.

Suggested change
// If isSpam is not provided in the API response, default to false
const isSpamFlagged = isSpam || false;
const isSpamFlagged = Boolean(isSpam);

Copilot uses AI. Check for mistakes.
@santhosh-apphelix-2u santhosh-apphelix-2u merged commit c79a583 into master Nov 13, 2025
9 checks passed
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.

4 participants