Skip to content

fix(agent): make Maple Work readable through accessibility - #1451

Merged
AnthonyRonning merged 1 commit into
masterfrom
claude/agent-accessibility-tree
Nov 6, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
claude/agent-accessibility-tree

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Screen readers and Cua read the same accessibility tree, and most of Maple Work was missing from it. A test with Cua found four gaps: message text was not there, sidebar rows came and went, typed input never showed up, and the quit prompt's buttons could not be found. This PR fixes all four and a crash the fix exposed.

There are two root causes:

  • Cached views drop out of the tree. GPUI builds the tree during prepaint, and a cached view that reuses its frame skips prepaint. Each update replaces the whole tree, so any repaint elsewhere removed the sidebar along with its focus and action handlers. This also affects the project folder dialog.
  • Plain text has no node. GPUI only reports elements with an id and a role, so .child("Save") is invisible and a button with only that child has no name.

Changes

  • Cached views: embed_cached_view renders the sidebar and folder dialog every frame while an accessibility client is connected, and stays cached otherwise.
  • Reply text: RichText takes an id from its ordinal and reports as a label, which covers messages, code blocks and table cells. Tool arguments and output, error rows, permission rows and system rows are exposed too.
  • Field values: TextInput exposes its value. Masked fields and SecretInput do not.
  • Button names: 53 pill button call sites outside Settings now get their name from a gpui::text! child. This is a mechanical change, and most of the diff.
  • Quit prompt: it is now a named dialog with readable text and named buttons.
  • Crash fix: pressing Keep open aborted the app. At the pinned gpui the AccessKit adapter outlives a closed window, and accesskit_macos then panics across the FFI boundary. The prompt now draws one empty frame before closing, which covers the buttons and the red close button. Zed commit 0eda7703f6 fixes the cause, so this can go when the pin includes it. Other windows only close as Maple exits, or hide.

CLAUDE.md gains a short accessibility section.

Verification

Cua 0.38 drove a debug build against the agent-a11y Local stack, with the Local Pro fixture and DeepSeek V4.1 Flash, all background delivery:

Check Result
Composer value after typing Read back live from the tree
Reply with heading, list, code block and table Every block readable, including each table cell
Sidebar during and after runs Present in all 22 polled reads
Press Settle Worked; tasks.state is settled in the database
Quit prompt during a run Title, message and both buttons readable
Press Keep open 4 of 4 kept the app running; it crashed on the first press before the fix
Red close button on the prompt App keeps running
Press Quit Maple during a run Clean exit, host stopped, no panic
Login screen on a fresh profile All 5 buttons named

The debug build panics on duplicate accessibility ids. None appeared with those replies open, and the app log has no panics after the fix.

  • Passing: just ci-lint, just ci-extra, just lane repo, and cargo test --workspace --no-fail-fast apart from the failure below.
  • Failing: only reads_native_release_tar_format_and_preserves_bundle_modes, the known bsdtar failure on this Mac in the untouched maple-agent-updater crate.
  • Hook: committed with MAPLE_HOOK_SKIP=1 because of that failure.

Not covered

  • VoiceOver is untested and is the main review question. Zed freezes a focused field's value because screen readers can re-read the whole value on every keystroke. This PR keeps the value live, which is what lets Cua confirm typed text. On a long draft that could be noisy, and caret tracking still needs AccessKit text runs. Please try the composer with VoiceOver before this leaves draft.
  • The folder dialog was not exercised live. It only opens for remote computers, so it is covered by the render test alone.
  • Settings buttons stay unnamed. About 45 remain, left out to avoid colliding with agent: extend live Mexican Spanish localization across the app #1372, which rewrites those strings. Do them after it lands.
  • Off-screen messages are not in the tree, because the transcript is virtualized. aria_position_in_set still gives their position.
  • The first read of a new window is still nearly empty. GPUI builds the tree after the first client connects, so read twice.

Trade-offs

  • With a client connected, the sidebar renders on every frame instead of only when it changes. That can include apps that read accessibility without being screen readers.
  • Each prompt close logs one window not found error from gpui. It looks harmless.

🤖 Generated with Claude Code

GPUI only reports elements with an id and a role, and it builds the tree
while prepainting. That left most of the app missing from it.

Render cached views every frame while an accessibility client is
connected. A cached view that reuses its frame pushes no nodes, so any
repaint elsewhere removed the sidebar and its actions.

Give RichText an id from its ordinal and a Label role, so messages, tool
output and table cells can be read. Name pill buttons outside Settings
through a text! child, and expose TextInput values, except masked ones.

The quit prompt now empties its tree for a frame before closing. At the
pinned gpui, closing a window an accessibility client has read aborts the
process in accesskit_macos, and naming the buttons made that reachable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning marked this pull request as ready for review November 6, 2026 19:14
@AnthonyRonning
AnthonyRonning merged commit b7f432d into master Nov 6, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the claude/agent-accessibility-tree branch November 6, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant