Agent Skills
› alphaXiv/OpenResearch
› orx-accessibility
orx-accessibility
GitHub指导为 OpenResearch 应用实现无障碍功能,涵盖键盘导航、屏幕阅读器支持及 ARIA 规范。提供测试断言方法与设计组件使用规范,确保符合 WCAG 标准。
Trigger Scenarios
添加或更改 UI 控件、弹窗、菜单、列表或快捷键行为时
涉及屏幕阅读器、VoiceOver、NVDA、ARIA、键盘导航或 WCAG 相关需求时
Install
npx skills add alphaXiv/OpenResearch --skill orx-accessibility -g -y
SKILL.md
Frontmatter
{
"name": "orx-accessibility",
"description": "Make the OpenResearch app work by keyboard and assistive technology, and prove it without turning a screen reader on. Covers roles, names and states, ids, focus and Escape, keyboard shortcuts and the app menu, dialogs, menus and popovers through Base UI, live regions for status, long transcripts, reduced motion, contrast in both themes and on translucent surfaces, target sizes, zoom, and tests that assert on the accessibility tree. Use whenever you add or change a control, popup, dialog, menu, list, shortcut or focus behaviour in `ui\/`, and whenever someone mentions screen readers, VoiceOver, NVDA, ARIA, keyboard navigation or WCAG. In this repo, use it in place of any general accessibility skill, including when reviewing someone else's change."
}
Accessibility in OpenResearch
The tree is the test
Assert on roles, names, states, focus and live regions. Never turn VoiceOver, Narrator, NVDA or Orca on in the user's session or ask the user what they heard; a listening pass happens in a VM, when the user asks for one.
- In unit tests, mount with
renderorrenderAppfromui/tests/render.mjsand find things by what a screen reader exposes:find(`button[aria-label="${m.key()}"]`),[role=dialog],[aria-expanded=true].findmatches text content, so an icon button is found by its label. Afterpress("Escape"), assert wheredocument.activeElementis. - In
e2e/, use Playwright'sgetByRole, as the specs ine2e/tests/do. - Accessibility must not cost performance. The transcript mounts only its visible window, so it is an ARIA feed (
role="feed",aria-setsize,aria-posinset,aria-busy;ui/src/components/ChatPanel.tsx) rather than every message in the DOM. A long list follows the same pattern.
Use the parts that already handle it
- Dialogs come from
useWorkspace().dialogs(orx-flows). Base UI moves focus in, traps it, and returns it on close;DialogTitleandDialogDescriptionname and describe the dialog. A dialog with no visible title takesaria-label. - Menus, popovers and selects use Base UI (
@base-ui/react), which carries their roles, arrow keys and focus return. Never build one fromdivs and click handlers. - Buttons are
ButtonandIconButton. AnIconButtontakes anaria-labelfrom a Paraglide message naming the action, inside<Tooltip interactive>with the same message. ATooltipwithoutinteractiveis a focusablerole="img"info icon: right for a lone hint glyph, wrong around a control. - Semantic elements first:
button,a href,label, headings, lists. ARIA only where no element fits. - Never hard-code an
id. Every machine the user has opened stays mounted, soaria-labelledby,aria-describedbyandhtmlForpoint atuseId()oruseContext(WorkspaceDomContext).id(name).
Keyboard and focus
- Every action has a keyboard path. Tab reaches every control in visual order, including chips and pills inside an editor; Enter and Space press; Escape closes the innermost popup and nothing else.
- Escape is scoped. Wrap a surface that handles Escape in
EscapeScope(ui/src/components/EscapeScope.tsx), which gives it the key exclusively while it is open. - App shortcuts live in
appHotkeys(ui/src/hotkeys.ts), each named by a message.ui/src/appMenu.tsbuilds native menu items from those entries withcommand(appHotkeys[id]), added there by hand. Check a new chord against the existing ones and the ones each platform reserves, such as quit, close window and settings. - Focus is visible. Primitives draw the ring; a custom focusable copies theirs:
focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-focus focus-visible:outline-offset-2. The ring wraps the control itself, never the row around it. - Focus goes where the next action is. A surface opened to be typed into focuses its input, as a new chat focuses the composer (
useComposerFocus), and a closed popup or dialog returns focus to its trigger (Base UI). Follow the nearest existing mover; add a new one only with a reason.
Names, states and announcements
- A name is what a sighted user reads, unique among its siblings, and it names the action, not the icon ("Close tab", never "X").
- Expose every state the control has:
aria-pressedfor toggles,aria-expandedandaria-haspopupfor anything that opens,aria-selectedandaria-currentfor the current item,disabledwith the reason visible nearby. - Status that changes without focus moving is announced through a live region (
role="status", orrole="alert"for errors): a turn finishing, a run failing, a copy confirming. Drawn but silent is a bug. - Don't announce noise. Streaming tokens and log lines don't go into a live region; their completion does.
Visual floor
- Contrast: 4.5:1 for text, 3:1 for icons, control edges and focus rings, in light and dark, measured against what is actually behind the element: a translucent or blurred surface, a selected or hovered row, an image.
- Targets are at least 24×24 px (
IconButtonsmall is 28). - Motion is optional: Tailwind motion goes behind
motion-safe:, and a CSS animation inapp.cssgets a rule in itsprefers-reduced-motion: reduceblock, so it becomes an instant change. - Zoom works. The desktop app zooms with its zoom shortcuts in
appHotkeys; check the change at 150% and 200% for clipping and overlap. - Colour is never the only signal. A failed run is red and says "Failed".
Checklist
- role fits what it does, from a semantic element or a Base UI part
- name is a Paraglide message naming the action, unique among siblings
- every state the control has is exposed; ids come from
useId()orWorkspaceDomContext - reachable by Tab in visual order; focus ring wraps the control; Escape backs out of the innermost popup
- a popup takes focus and gives it back
- status changes are announced; streaming text is not
- contrast holds in both themes against what is behind it; targets are 24 px or more
- motion is optional; zoom to 200% doesn't clip
- a test asserts on the role and name of what changed
Version History
- c9123a6 Current 2026-11-07 10:18


