Skip to content

ECHOES-1356 Add announcement modes to MessageCallout and MessageInline#701

Merged
david-cho-lerat-sonarsource merged 1 commit into
ECHOES-1341-add-alert-and-status-announcement-modes-to-bannerfrom
ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline
Jun 11, 2026
Merged

ECHOES-1356 Add announcement modes to MessageCallout and MessageInline#701
david-cho-lerat-sonarsource merged 1 commit into
ECHOES-1341-add-alert-and-status-announcement-modes-to-bannerfrom
ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline

Conversation

@david-cho-lerat-sonarsource

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary by Gitar

  • New accessibility features:
    • Added announcementMode prop to MessageCallout and MessageInline to enable alert or status live-region semantics.
  • Component updates:
    • Integrated LiveRegionAnnouncementMode into both components to manage ARIA roles dynamically.
  • Testing and documentation:
    • Added unit tests for default behaviors and live-region support.
    • Updated Storybook stories with new announcementMode controls and examples.
  • Refactoring:
    • Corrected the ARIA-label description for the MessageCallout dismiss button in i18n/keys.json and component code.

This will update automatically on new commits.

@netlify

netlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploy Preview for echoes-react ready!

Name Link
🔨 Latest commit 6a89b75
🔍 Latest deploy log https://app.netlify.com/projects/echoes-react/deploys/6a2ab9ed2f2f9c0008dfe58e
😎 Deploy Preview https://deploy-preview-701--echoes-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jun 11, 2026

Copy link
Copy Markdown

ECHOES-1356

Comment thread src/components/messages/MessageCallout.tsx Outdated
@david-cho-lerat-sonarsource david-cho-lerat-sonarsource force-pushed the ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline branch 2 times, most recently from 0e1d1c3 to 5987727 Compare June 11, 2026 09:40

This comment was marked as outdated.

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource force-pushed the ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline branch from 5987727 to 320466b Compare June 11, 2026 09:53

This comment was marked as outdated.

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource force-pushed the ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline branch from 320466b to 9cad103 Compare June 11, 2026 10:08

This comment was marked as outdated.

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource force-pushed the ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline branch from 9cad103 to 0a0b02f Compare June 11, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown

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 9 out of 9 changed files in this pull request and generated no new comments.

@gregaubert gregaubert 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.

Looks good!

It might be worth adding the MessageInline and MessageCallout typescript documentation since we are touching these components.

Comment thread src/components/messages/MessageInline.tsx Outdated
@david-cho-lerat-sonarsource david-cho-lerat-sonarsource force-pushed the ECHOES-1341-add-alert-and-status-announcement-modes-to-banner branch from 465d604 to 2ea6db5 Compare June 11, 2026 13:29
@david-cho-lerat-sonarsource david-cho-lerat-sonarsource force-pushed the ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline branch from 0a0b02f to f67ba13 Compare June 11, 2026 13:30
@david-cho-lerat-sonarsource david-cho-lerat-sonarsource force-pushed the ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline branch from f67ba13 to 6a89b75 Compare June 11, 2026 13:36
@sonarqube-next

Copy link
Copy Markdown

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource merged commit 87a0947 into ECHOES-1341-add-alert-and-status-announcement-modes-to-banner Jun 11, 2026
10 checks passed
@david-cho-lerat-sonarsource david-cho-lerat-sonarsource deleted the ECHOES-1356-add-announcement-modes-to-messagecallout-and-messageinline branch June 11, 2026 13:52
@gitar-bot

gitar-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Integrates announcementMode into MessageCallout and MessageInline to support ARIA live-region semantics. This update addresses the missing live-region announcement issue and improves dismiss button accessibility.

✅ 1 resolved
Edge Case: Live-region announcement may not fire when rendered with content

📄 src/components/messages/MessageCallout.tsx:78 📄 src/components/messages/MessageInline.tsx:62 📄 src/components/messages/MessageTypes.tsx:29-32
MessageCallout and MessageInline apply role={announcementMode} (status/alert) on the same container element that already contains the message text at mount time. ARIA live regions—especially role="status" (aria-live="polite")—are most reliably announced when the live-region element already exists in the DOM and content is added/changed afterward. When a consumer conditionally mounts the whole component with its text already present (the common usage shown in the new StatusAnnouncement/AlertAnnouncement stories), some screen readers may not announce the message. role="alert" generally fires on insertion, but status is less consistent.

This is the core purpose of the feature, so it is worth documenting the limitation in the prop JSDoc (e.g., note that announcements are reliable when the message is updated/inserted into an already-mounted region) and, if feasible, considering keeping the live region mounted while toggling its content. The unit tests only assert the role/text is present in the DOM, not that an announcement is actually triggered, so this gap isn't caught by tests.

Sources: src/components/messages/MessageCallout.tsx:78, src/components/messages/MessageInline.tsx:62

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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