Skip to content

gpuix does not expose GPUI's accessibility APIs #47

Closed
liuyanghejerry/gpuiv
#54

Description

@khromov

GPUI has a complete AccessKit integration and @gpuix/native uses none of it. A gpuix
window is empty to a screen reader — no roles, no labels, nothing to navigate — and there
is no workaround from JS.

What GPUI provides

The pinned zed submodule (8b94defe, what @gpuix/[email protected] builds against) has
crates/gpui/src/window/a11y.rs, a guide in _accessibility.rs, a working
examples/a11y.rs, and AccessKit 0.24 with all three platform adapters (macOS, Windows,
AT-SPI). The builder API on div is ARIA-shaped: .role(Role::…), 21 aria_* setters
(label, description, value, numeric value + min/max/step, level, expanded, selected,
toggled, …), .focusable(), .tab_stop(), .on_a11y_action(AccessibleAction::…), and
Element::a11y_synthetic_children for custom elements.

None of it is behind a cargo feature — accesskit is an unconditional dependency — so
default-features = false in packages/native/Cargo.toml does not turn it off.

What gpuix does with it

Nothing. At the @gpuix/[email protected] tag, packages/native/src has zero matches for
role(, aria_, accesskit or on_a11y_action, and index.d.ts exposes no
accessibility surface at all.

The hard part is already done, though — build_host_container gives every element a stable
id (renderer.rs:4243), which is exactly what GPUI derives AccessKit node ids from:

let mut el = gpui::div().id(gpui::ElementId::Integer(element.id));

But a node is reported only when it has both an id and a non-None role, so the tree
walk finds nothing. What exists today is focus, not accessibility: tabIndex reaches
.tab_index()/.tab_stop() (renderer.rs:4339) and the renderer exposes
focusElement/focusNext/focusPrevious, but nothing is announced when focus lands.

Suggested fix

Pass roles and ARIA props through custom_props, beside tabIndex, which already takes
this exact path for div/text:

{ "role": "button", "ariaLabel": "Delete note", "ariaExpanded": false }

accesskit::Role derives enumn, so the string lookup is cheap. aria_label and
aria_description alone would get most apps to something readable; value and state setters
can follow, and on_a11y_action last, since click already auto-registers one.

Two calls worth making up front: <input>/<textarea> hold real text state, so they want
Role::TextInput and probably a11y_synthetic_children for caret and selection rather than
an opt-in prop. And since GPUI reports nothing without a role, a framework on top starts at
zero unless every app author opts in — <text> defaulting to Role::Label and a
click-handling element to Role::Button would make the common case work.

We maintain gpuix-svelte, a Svelte custom renderer
targeting gpuix. Svelte's compiler emits a11y_* warnings for exactly this and we silence
all of them today, because there is nothing on the other side to map them onto.

Activity

  1. added a commit that references this issue on Sep 6, 2026
    8138d4c
  2. added a commit that references this issue on Sep 7, 2026
    e07e390
  3. added a commit that references this issue on Sep 14, 2026
    89b6799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions