feat(fuselage): improve accessibility of Message components #1821
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR enhances accessibility and responsiveness across all Message components to ensure WCAG 2.1 compliance and improve user experience across all devices and assistive technologies.
Accessibility Enhancements:
role="article",role="group",role="region") to Message, MessageHeader, MessageBody, MessageReactions, and MessageMetricsaria-labelattributes for screen reader contextaria-busyandaria-selectedstate indicators to Message component<span>to semantic<time>element withdateTimeproparia-pressedstate to MessageReaction for toggle indicationResponsive Design Improvements:
clamp(8px, 3vw, 20px)for adaptive spacingclamp(0.875rem, 2.5vw, 1rem)and proper line-heightTesting:
jest-axeaccessibility validationIssue(s)
Closes #1819
Further comments
All changes are backward compatible and follow WCAG 2.1 Level AA guidelines. The implementation uses existing theme variables and breakpoint mixins to maintain consistency with the design system.