This skill sets requirements and implementation patterns for making new and updated VS Code interfaces accessible. It includes steps and code examples for accessibility help dialogs, accessible views, verbosity settings, signals, ARIA announcements, keyboard navigation, and labels and roles. A checklist and key-file references support feature work and testing.
82%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Use this skill for any VS Code feature work that introduces or changes interactive UI. Use this skill by default for new features and contributions, including when the request does not explicitly mention accessibility.
Trigger examples:
Do not skip this skill just because accessibility is not named in the prompt.
When adding a new interactive UI surface to VS Code — a panel, view, widget, editor overlay, dialog, or any rich focusable component the user interacts with — you must provide three accessibility components (if they do not already exist for the feature):
Examples of existing features that have all three: the terminal, chat panel, notebook, diff editor, inline completions, comments, debug REPL, hover, and notifications. Features with only a help dialog (no accessible view) include find widgets, source control input, keybindings editor, problems panel, and walkthroughs.
Sections 4–7 below (signals, ARIA announcements, keyboard navigation, ARIA labels) apply more broadly to any UI change, including modifications to existing features.
When updating an existing feature, review whether the change affects how screen reader users discover, navigate, or read it. Update its accessibility help only when users need new instructions to perform those tasks; an ordinary behavior change, bug fix, announcement, or focus-restoration fix does not automatically need help text.
An accessibility help dialog is a concise orientation and navigation guide for screen reader users, not a feature manual or change log.
Before adding or changing a sentence, identify the screen-reader task it helps the user perform. Keep only:
Do not document implementation details, visual styling or animation, rollout or deprecation plans, exhaustive feature settings, persistence rules, or routine success/failure and focus-management guarantees. Controls should announce their own labels, state, unavailable reasons, and outcomes; do not repeat all of that in help. Keep only the context needed to use a control without seeing it.
Prefer "Use Chat: Focus Chat Confirmation to reach Authenticate; press Enter or Space to activate it" over "Authentication progress and its outcome are announced; cancelled attempts are not reported as success." A fix that moves focus away from a temporarily unavailable control belongs in a regression test, not in instructions users must memorize.
Keep help scoped to the surface that owns the interaction. In particular, src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts is not the destination for every chat behavior change: use an existing focused provider when appropriate, and leave the window-wide help unchanged when no new screen-reader instruction is needed. Replace or shorten existing guidance rather than appending overlapping paragraphs.
Create a class implementing IAccessibleViewImplementation with type = AccessibleViewType.Help.
priority (higher = shown first when multiple providers match).when to a ContextKeyExpression that matches when the feature is focused.getProvider(accessor) returns an AccessibleContentProvider.Return an AccessibleContentProvider directly, as in the example below. Use a custom class implementing IAccessibleViewContentProvider only when it needs state or injected services.
id — add a new entry in the AccessibleViewProviderId enum in src/vs/platform/accessibility/browser/accessibleView.ts.verbositySettingKey — reference the new AccessibilityVerbositySettingId entry (see §3).options — { type: AccessibleViewType.Help }.provideContent() — return localized, multi-line help text.Implement onClose() to restore focus to whatever element was focused before the help dialog opened. This ensures keyboard users and screen reader users return to their previous context.
Register the implementation:
AccessibleViewRegistry.register(new MyFeatureAccessibilityHelp());in the feature's *.contribution.ts file.
The simplest approach is to return an AccessibleContentProvider directly from getProvider(). This is the most common pattern in the codebase (used by chat, inline chat, quick chat, etc.):
import { AccessibleViewType, AccessibleContentProvider, AccessibleViewProviderId } from '../../../../platform/accessibility/browser/accessibleView.js';
import { IAccessibleViewImplementation } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js';
import { AccessibilityVerbositySettingId } from '../../../../platform/accessibility/common/accessibilityConfiguration.js';
export class MyFeatureAccessibilityHelp implements IAccessibleViewImplementation {
readonly priority = 100;
readonly name = 'my-feature';
readonly type = AccessibleViewType.Help;
readonly when = MyFeatureContextKeys.isFocused;
getProvider(accessor: ServicesAccessor) {
const helpText = [
localize('myFeature.help.overview', "You are in My Feature. …"),
localize('myFeature.help.key1', "- {0}: Do something", '<keybinding:myFeature.doSomething>'),
].join('\n');
return new AccessibleContentProvider(
AccessibleViewProviderId.MyFeature,
{ type: AccessibleViewType.Help },
() => helpText,
() => { /* onClose — refocus whatever was focused before */ },
AccessibilityVerbositySettingId.MyFeature,
);
}
}Alternatively, if the provider needs injected services or must track state (e.g., storing a reference to the previously focused element), create a custom class that extends Disposable and implements IAccessibleViewContentProvider, then instantiate it via IInstantiationService (see CommentsAccessibilityHelpProvider for an example):
class MyFeatureAccessibilityHelpProvider extends Disposable implements IAccessibleViewContentProvider {
readonly id = AccessibleViewProviderId.MyFeature;
readonly verbositySettingKey = AccessibilityVerbositySettingId.MyFeature;
readonly options: IAccessibleViewOptions = { type: AccessibleViewType.Help };
provideContent(): string { /* … */ }
onClose(): void { /* … */ }
}
// In getProvider():
getProvider(accessor: ServicesAccessor) {
return accessor.get(IInstantiationService).createInstance(MyFeatureAccessibilityHelpProvider);
}An accessible view presents the feature's visual content as plain text in a read-only editor. It is required when the feature renders rich or visual content that a screen reader cannot directly read (for example: chat responses, hover tooltips, notifications, terminal output, inline completions).
If the feature is purely keyboard-driven with native text input/output (e.g., a simple input field), an accessible view is not needed — only an accessibility help dialog is required.
IAccessibleViewImplementation with type = AccessibleViewType.View.options — { type: AccessibleViewType.View }, optionally with a language for syntax highlighting.provideContent() — return the feature's current content as plain text.provideNextContent() / providePreviousContent() for item-by-item navigation.onClose() to restore focus to whatever was focused before the accessible view was opened.actions for actions the user can take from the accessible view.AccessibleViewRegistry.register(new MyFeatureAccessibleView());export class MyFeatureAccessibleView implements IAccessibleViewImplementation {
readonly priority = 100;
readonly name = 'my-feature';
readonly type = AccessibleViewType.View;
readonly when = MyFeatureContextKeys.isFocused;
getProvider(accessor: ServicesAccessor) {
// Retrieve services, build content from the feature's current state
const content = getMyFeatureContent();
if (!content) {
return undefined;
}
return new AccessibleContentProvider(
AccessibleViewProviderId.MyFeature,
{ type: AccessibleViewType.View },
() => content,
() => { /* onClose — refocus whatever was focused before the accessible view opened */ },
AccessibilityVerbositySettingId.MyFeature,
);
}
}A verbosity setting controls whether a hint such as "press Alt+F1 for accessibility help" is announced when the feature gains focus. Users who already know the shortcut can disable it.
Add an entry to AccessibilityVerbositySettingId in src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts:
export const enum AccessibilityVerbositySettingId {
// … existing entries …
MyFeature = 'accessibility.verbosity.myFeature'
}Register the configuration property in the same file's configuration.properties object:
[AccessibilityVerbositySettingId.MyFeature]: {
description: localize('verbosity.myFeature.description',
'Provide information about how to access the My Feature accessibility help menu when My Feature is focused.'),
...baseVerbosityProperty
},The baseVerbosityProperty gives it type: 'boolean', default: true, and tags: ['accessibility'].
Reference the setting key in both the help-dialog provider (verbositySettingKey) and the accessible-view provider so the runtime can check whether to show the hint.
Accessibility signals provide audible and spoken feedback for events that happen visually. Use IAccessibilitySignalService to play signals when something important occurs (e.g., an error appears, a task completes, content changes).
AccessibilitySignal.* static members — e.g., AccessibilitySignal.error, AccessibilitySignal.terminalQuickFix, AccessibilitySignal.clear).Each signal has two modalities controlled by user settings:
auto (on when screen reader attached), on, or off.aria-live, configurable to auto or off.// Inject the service via constructor parameter
constructor(
@IAccessibilitySignalService private readonly _accessibilitySignalService: IAccessibilitySignalService
) { }
// Play a signal
this._accessibilitySignalService.playSignal(AccessibilitySignal.terminalQuickFix);
// Play with options
this._accessibilitySignalService.playSignal(AccessibilitySignal.error, { userGesture: true });Use the alert() and status() functions from src/vs/base/browser/ui/aria/aria.ts to announce dynamic changes to screen readers.
alert(msg) — Assertive live region (role="alert")status(msg) — Polite live region (aria-live="polite")status() over alert() unless the information is time-sensitive or the result of a direct user action. Overusing alert() creates a noisy, disruptive experience.alert() / status() for the same information.nls.localize().Every interactive UI element must be fully operable via the keyboard.
Tab / Shift+Tab in a logical order.focusBorder).Escape, returning focus to the previous element.:focus-visible, focus restoration, or screen-reader navigation works..monaco-tl-row; do not clear that inner outline unless another visible solid ring remains.aria-expanded="true" and aria-pressed="true" communicate open/pressed state, while :focus-visible communicates keyboard location. Both use solid boundaries in HC, but keyboard focus remains the higher-priority owner when combined.<details>/<summary> already exposes disclosure semantics to assistive technology, but <summary> does not receive an aria-expanded attribute. Use the native open state for visual styling rather than adding redundant ARIA.For deterministic component fixtures, focus the actual element through the fixture focus API and render any focus-triggered tooltip/hover through the production hover service. Do not replace the service with a no-op merely to simplify a screenshot; the omitted content may be part of the keyboard experience.
Follow the discoverable unavailable-feature pattern: a feature promoted in documentation should not become inexplicably absent solely because the user cannot enable it. Announce both the disabled state and its reason using the control's supported ARIA semantics; a grey label, briefcase icon, or hover alone is insufficient. Keep icons decorative when text already conveys their meaning.
Explanatory links must remain independently mouse- and keyboard-operable without activating the disabled option. Verify actual Tab/Shift+Tab and Enter behavior, not just tabIndex or a programmatic focus(); list navigation may skip disabled rows. Preserve focus/selection on policy refresh and guard stale actions. Add help only if reaching the explanation or next step requires non-obvious navigation, following the content relevance gate in §1. Reuse the settings, model, harness, and permission-picker examples linked in the design guidance.
All interactive UI elements must have appropriate ARIA attributes so screen readers can identify and describe them.
aria-label: Every interactive element without visible text (icon buttons, icon-only actions, custom widgets) must have a descriptive aria-label. Labels should be localized.aria-labelledby / aria-describedby: Use these to associate elements with existing visible text rather than duplicating strings.role: Custom widgets that do not use native HTML elements must declare the correct ARIA role (e.g., role="button", role="tree", role="tablist").aria-expanded, aria-selected, aria-checked: Toggle and selection states must be communicated via the appropriate ARIA state attributes.aria-hidden="true": Decorative or redundant elements (icons next to text labels, decorative separators) must be hidden from the accessibility tree.aria-setsize and aria-posinset when virtualized so screen readers report the correct count.AccessibleViewProviderId entry added in accessibleView.tsAccessibilityVerbositySettingId entry added in accessibilityConfiguration.ts...baseVerbosityPropertyIAccessibleViewImplementation with type = Help created and registeredverbositySettingKeynls.localize()<keybinding:commandId> syntax for dynamic resolutionwhen context key is set so the dialog only appears when the feature is focusedIAccessibleViewImplementation with type = View created and registered*.contribution.ts fileAccessibilitySignal.* or register a new one)aria.alert() or aria.status() used appropriately for dynamic changes (prefer status() unless urgent)aria-labelrole and state attributesaria-hidden="true"src/vs/platform/accessibility/browser/accessibleView.ts — AccessibleViewProviderId, AccessibleContentProvider, IAccessibleViewContentProvidersrc/vs/platform/accessibility/browser/accessibleViewRegistry.ts — AccessibleViewRegistry, IAccessibleViewImplementationsrc/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts — AccessibilityVerbositySettingId, verbosity setting registrationsrc/vs/platform/accessibilitySignal/browser/accessibilitySignalService.ts — IAccessibilitySignalService, AccessibilitySignalsrc/vs/base/browser/ui/aria/aria.ts — alert(), status() for ARIA live region announcementsmicrosoft/vscode
65981f4
Also appears in
last in sync Sep 17, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.