-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Accessibility: Add severity prefixes to notification aria-labels for WCAG 4.1.3 compliance #250864
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
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
…accessibility coverage Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
…essible view Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
@copilot in the test, there are import errors for these lines, fix it.
|
… imports Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Fixed the import errors by moving the test file to the proper test directory structure ( |
@copilot fix this CI error:
|
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
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.
@meganrogge can I kindly ask you to look over the entire change with engineering 👓 on and let me know if you really think this cannot be further improved?
@copilot don't duplicate the getPrefix function - instead export it and reference it from both places |
…ationsCommands and reference from all notification components Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Refactored to eliminate duplication by exporting Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot also remove the now unused severity import from the two files that no longer reference that |
…etSeverityPrefix Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Removed unused Severity imports from notificationsList.ts and notificationAccessibleView.ts since they now use getSeverityPrefix() instead. The imports in notificationsToasts.ts and notificationsCommands.ts remain as they still use Severity directly. Commit 4430e63 |
This should have not merged without my approval again. Cleanup in #251067 |
return notification.source ? localize('notification.accessibleViewSrc', '{0} Source: {1}', message, notification.source) : localize('notification.accessibleView', '{0}', message); | ||
// Add severity prefix to match WCAG 4.1.3 Status Messages requirements | ||
const severityPrefix = getSeverityPrefix(notification.severity); | ||
const messageWithSeverity = `${severityPrefix}${message}`; |
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.
@meganrogge please understand that this is is not good. You are concatenating a string for human display, but this should be a localizable message aka localize('severityPrefix.error', "Error: {0}", label)
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.
Makes sense, sorry for missing this @bpasero
Screen readers were not announcing notification severity/status before message content, violating WCAG 4.1.3 Status Messages requirements. When users navigated notifications in VS Code, they would hear the message directly without context about whether it was an error, warning, or info notification.
Changes Made
This PR adds severity prefixes ("Error: ", "Warning: ", "Info: ") to all notification accessibility interfaces:
1. Notification Center (
notificationsList.ts
)NotificationAccessibilityProvider.getAriaLabel()
to include severity prefixgetSeverityPrefix()
helper method"File not found, notification"
"Error: File not found, notification"
2. Notification Toasts (
notificationsToasts.ts
)getSeverityPrefix()
helper method3. Notification Accessible View (
notificationAccessibleView.ts
)getContentForNotification()
to prepend severity prefixgetSeverityPrefix()
helper method4. Comprehensive Tests
NotificationAccessibilityProvider
Impact
This provides complete WCAG 4.1.3 compliance across all notification interfaces:
Screen readers will now consistently announce notification type/status before message content, allowing users with visual impairments to understand the context and severity of notifications before hearing the details.
Fixes #249426.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
electronjs.org
node-gyp
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Demo:
demo.mov