-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Implement automatic spam detection banners #8
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
Conversation
fix: resolve InContext Sidebar post menu dropdown clipping that triggered scroll
Added AutoSpamAlertBanner component to display spam alerts.
Added AutoSpamAlertBanner to Post component and adjusted spam flag logic.
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.
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
AutoSpamAlertBannercomponent 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.
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.
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.
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.
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.
1e079de to
f25cbf5
Compare
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.
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.
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.
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.
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.
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.
782ccb8 to
12a6048
Compare
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.
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.
chintanjoshi-apphelix-2u
left a 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.
A minor comment, is approved otherwise
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.
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.
| // If isSpam is not provided in the API response, default to false | ||
| const isSpamFlagged = isSpam || false; |
Copilot
AI
Nov 11, 2025
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.
[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.
| // If isSpam is not provided in the API response, default to false | |
| const isSpamFlagged = isSpam || false; | |
| const isSpamFlagged = Boolean(isSpam); |
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_spamflag returned from the API response.Key Updates
is_spamkey from API response.Ref Ticket - https://2u-internal.atlassian.net/browse/COSMO2-771