Skip to content

chore: update the anti-spam banner message#19

Merged
Alam-2U merged 1 commit intomasterfrom
ealam/COSMO2-819
Feb 13, 2026
Merged

chore: update the anti-spam banner message#19
Alam-2U merged 1 commit intomasterfrom
ealam/COSMO2-819

Conversation

@Alam-2U
Copy link

@Alam-2U Alam-2U commented Feb 13, 2026

Description

Updated the anti-spam message .

Ticket

https://2u-internal.atlassian.net/browse/COSMO2-819

Copilot AI review requested due to automatic review settings February 13, 2026 09:09
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

Updates the anti-spam warning copy shown on the discussions home page to explicitly mention external groups such as WhatsApp, improving clarity for learners.

Changes:

  • Updated spamWarningMessage default text to include an explicit WhatsApp example.
  • Updated the SpamWarningBanner bolded substring to match the new message text.

Reviewed changes

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

File Description
src/discussions/messages.js Updates the default anti-spam banner message copy.
src/components/SpamWarningBanner.jsx Keeps the bolded substring in sync with the updated message copy.
Comments suppressed due to low confidence (1)

src/components/SpamWarningBanner.jsx:66

  • The bolding logic depends on finding an exact hard-coded English substring inside the localized message (msg.indexOf(boldText)). This is brittle (any copy tweak requires updating boldText) and it won’t work for non-English translations (the substring won’t be found, so nothing is bolded). Consider switching to a single i18n message that marks the bold portion via a placeholder/rich-text value (e.g., FormattedMessage with a values function) or splitting the message into pre/bold/post segments using separate message IDs.
              const msg = intl.formatMessage(messages.spamWarningMessage);
              const boldText = 'never invite you to join external groups, such as on WhatsApp, or ask for personal or financial information';
              const idx = msg.indexOf(boldText);
              if (idx === -1) {
                return msg;
              }
              return (
                <>
                  {msg.slice(0, idx)}
                  <strong>{boldText}</strong>
                  {msg.slice(idx + boldText.length)}
                </>

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

@Alam-2U Alam-2U merged commit 006b17a into master Feb 13, 2026
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.

3 participants