make painted dialog rows screen-reader accessible#30169
Open
rezabakhshilaktasaraei wants to merge 2 commits intotelegramdesktop:devfrom
Open
make painted dialog rows screen-reader accessible#30169rezabakhshilaktasaraei wants to merge 2 commits intotelegramdesktop:devfrom
rezabakhshilaktasaraei wants to merge 2 commits intotelegramdesktop:devfrom
Conversation
- Add InnerWidget accessibility child APIs to expose shown dialog rows as virtual accessibility children - Implement rowAtIndex() helper and return _shownList size as accessibilityChildCount() - Provide per-row accessible names (Topic/Folder/Saved Messages + chat type prefixes for channels/groups/bots) - Make Dialogs::Row implement AccessibleItemWrap (role/rect/parent/index) so painted rows can be represented via Ui::Accessible::Item - Store/update Row accessibility context (parent widget + index) for correct geometry and navigation
ca416d3 to
7f9d86d
Compare
ilya-fedin
reviewed
Jan 22, 2026
Comment on lines
+160
to
+163
| void setAccessibilityName(const QString& name) const { | ||
| _accessibilityName = name; | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes the dialogs list accessible by exposing painted dialog rows (non-QWidget items) as virtual accessibility children. The goal is for screen readers to be able to navigate the chat list as a real list with proper list items, names, and geometry—even though rows are rendered manually.
What changed
•
Expose dialog rows as accessibility children
•
Dialogs::InnerWidget now implements:
•
accessibilityChildCount() based on _shownList->size()
•
accessibilityChildInterface(index) to return a Ui::Accessible::Item for the row at that index
•
accessibilityChildName(index) to provide a meaningful, user-facing label per row
•
Added rowAtIndex() helper for safe indexed access to _shownList.
•
Make Dialogs::Row accessible
•
Dialogs::Row now implements Ui::Accessible::AccessibleItemWrap so it can be represented via Ui::Accessible::Item.
•
Provides:
•
accessibilityRole() → ListItem
•
accessibilityRect() → row rectangle inside the parent widget (based on _top/_height)
•
accessibilityParentWidget() and accessibilityIndex() for correct parent/index reporting.
•
Stores runtime accessibility context on the row:
•
parent widget pointer
•
accessibility index (fallback to _index)
•
Better row labels for screen readers
•
Topics: "Topic, <title>" (including General topic handling)
•
Folders: "Folder, "
•
Saved Messages sublists: "Saved Messages, "
•
Chat type prefixes for non-private chats:
•
Channel / Group / Bot, etc., falling back to the peer name when unknown.
Why
The dialogs list is largely custom-painted, so individual rows do not exist as Qt widgets and are invisible to assistive technologies by default. By representing rows as QAccessibleInterface items, we make the list navigable and understandable for screen readers without refactoring UI composition.
Testing
•
Manual verification with a screen reader:
•
rows appear as list items under the dialogs list
•
navigation reads correct names (topic/folder/channel/group/bot/user)
•
geometry matches row position for hit-testing and focus tracking
Notes / follow-ups