Skip to content

Add region role for Chat History#274

Merged
sushmi21 merged 2 commits intomainfrom
bug/112119-chat-log-role
Apr 29, 2026
Merged

Add region role for Chat History#274
sushmi21 merged 2 commits intomainfrom
bug/112119-chat-log-role

Conversation

@sushmi21
Copy link
Copy Markdown
Collaborator

@sushmi21 sushmi21 commented Apr 28, 2026

This is a minor accessibility improvement adding a role="region" landmark to the chat log container (ChatScroller).

role="log" was considered but rejected: that role implies aria-live="polite" behaviour, causing screen readers to automatically announce every new message appended to the container. The Webchat already has a dedicated ScreenReaderLiveRegion component (src/webchat-ui/components/presentational/ScreenReaderLiveRegion.tsx) that manages live announcements with aria-live="polite". Using role="log" on the scroll container would duplicate those announcements and create a noisy, unpredictable screen reader experience. Adding aria-live="off" to suppress the implicit live behaviour of role="log" was also considered, but browser and screen reader support for overriding a role's implicit aria-live value is inconsistent — some screen readers ignore the override and announce anyway. On the other hand, role="region" gives the area a named landmark without implying any live-region behaviour.

Success criteria

  • The chat log container in the Webchat UI is correctly identified as a landmark region by assistive technologies
  • Screen readers announce the chat history area as a "region" landmark, labelled by the existing webchatChatHistoryHeading element
  • Users navigating by landmarks (e.g. via screen reader shortcut) can jump directly to the chat log

How to test

  1. Open the Webchat UI in a browser with a screen reader enabled (e.g. NVDA + Firefox, or VoiceOver + Safari)
  2. Use the screen reader's landmark navigation shortcut to list or cycle through page regions
  3. Verify that the chat history area appears as a named region (e.g. "Chat History, region" or similar, depending on the screen reader)
  4. Confirm that the chat log content is accessible and that the region label matches the heading text tied to webchatChatHistoryHeading

Security

  • Possible injection vector
  • Authentication/Access controls touched
  • Sensitive Data could be exposed
  • XSS
  • Logging/Monitoring touched
  • Exchanges data with external systems
  • No security implications

Additional considerations

  • This PR might have performance implications

Copilot AI review requested due to automatic review settings April 28, 2026 13:36
@sushmi21 sushmi21 temporarily deployed to pr-preview-274 April 28, 2026 13:36 — with GitHub Actions Inactive
@graymalkin77
Copy link
Copy Markdown

graymalkin77 commented Apr 28, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

github-actions Bot added a commit that referenced this pull request Apr 28, 2026
@sushmi21 sushmi21 changed the title Add region role Add region role for Chat History Apr 28, 2026
Copy link
Copy Markdown
Contributor

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

Adds an accessibility landmark to the Webchat chat history container so assistive technologies can identify and navigate to the chat log as a named region.

Changes:

  • Add role="region" to the chat log container in ChatScroller.
  • Keep labeling via existing aria-labelledby="webchatChatHistoryHeading" to provide an accessible name without introducing implicit live-region behavior.

Comment thread src/webchat-ui/components/history/ChatScroller.tsx
@sushmi21 sushmi21 temporarily deployed to pr-preview-274 April 28, 2026 14:22 — with GitHub Actions Inactive
@sushmi21 sushmi21 requested a review from kwinto April 28, 2026 14:22
github-actions Bot added a commit that referenced this pull request Apr 28, 2026
@sushmi21 sushmi21 merged commit cf48d39 into main Apr 29, 2026
8 checks passed
github-actions Bot added a commit that referenced this pull request Apr 29, 2026
@sushmi21 sushmi21 mentioned this pull request Apr 29, 2026
8 tasks
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