Skip to content

Conversation

@rezabakhshilaktasaraei
Copy link
Contributor

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

- 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
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