Skip to content

Group AccessKit nodes by Ui #7386

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

Draft
wants to merge 15 commits into
base: lucas/accessibility-inspector
Choose a base branch
from

Conversation

lucasmerlin
Copy link
Collaborator

@lucasmerlin lucasmerlin commented Jul 23, 2025

This changes egui to create an AccessKit node for each Ui. I'm not sure if this alone will directly improve accessibility, but it should make it easier to create the correct parent / child relations (e.g. grouping menus as children of menu buttons).
Instead of having a global stack of parent ids, they are now passed via a parent_id field in UiBuilder.

If having all these GenericContainer nodes somehow is bad for accessibility, the PR could also be changed to only create nodes if there is actually some accessibility info with it (the relevant is currently commented-out in the PR). But I think screen readers should just ignore these nodes, so it should be fine? We could also use this as motivation to git red of some unnecessary wrapped Uis, e.g. CentralPanel creates 3 Uis when 2 should be enough (the initial Ui and a Frame, maybe we could even only show the Frame if we can give it an UiBuilder and somehow show the Frame with Ui::new).

Here is a screenshot from the accessibility inspector (#7368) with this PR:

Screenshot 2025-07-24 at 12 09 55

Without this PR:

Screen.Recording.2025-07-24.at.12.12.34.mov

@lucasmerlin lucasmerlin changed the base branch from main to lucas/accessibility-inspector July 23, 2025 09:32
@lucasmerlin lucasmerlin force-pushed the lucas/group-accesskit-nodes-by-ui branch from 0f9886d to c1d8d10 Compare July 23, 2025 09:33
…it-nodes-by-ui

# Conflicts:
#	crates/egui/src/context.rs
#	crates/egui_demo_app/src/accessibility_inspector.rs
…it-nodes-by-ui

# Conflicts:
#	crates/egui_demo_app/src/accessibility_inspector.rs
@lucasmerlin lucasmerlin added accessibility More accessible to e.g. the visually impaired egui labels Jul 24, 2025
Copy link

Preview available at https://egui-pr-preview.github.io/pr/7386-lucasgroup-accesskit-nodes-by-ui
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility More accessible to e.g. the visually impaired egui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant