Feat: Accessible-name fallback for UI buttons (screen reader support) - #31197
Feat: Accessible-name fallback for UI buttons (screen reader support)#31197hesam-oxe wants to merge 2 commits into
Conversation
|
The same problem as in #31198: wrong lib_ui commit |
c306323 to
3c27914
Compare
|
@cla-assistant check |
3c27914 to
5381c1f
Compare
|
@ilya-fedin Same fix here — the submodule no longer points into my fork and stays on the upstream commit. For transparency: parts of the tdesktop-side code (the sub-item InvokePattern support in |
|
Same question as for #31198 - should the test land upstream? |
When a screen reader is active, keyboard users can start and stop voice recording with Space or Enter on the focused record button, and cancel with Escape, since press-and-hold is not reachable from the keyboard.
…nks) Implement the remaining accessibility follow-ups from issue telegramdesktop#476: - Chat list focus traps: let Tab/Shift+Tab leave the dialog list under screen reader mode so keyboard focus is not trapped. - Inline media InvokePattern: message sub-items (media, download, played, web) now expose a press action via the new Ui::Accessible::SubItem action interface, so screen readers can invoke them. - Reply/quote link actions: the Reply sub-item is invokable and jumps to the original message. Requires the lib_ui submodule change that makes Ui::Accessible::SubItem implement QAccessibleActionInterface and adds RpWidget sub-item action virtuals. NOTE: full functional verification needs a Qt6 build environment (the desktop-app Linux build compiles patched Qt6 from source in Docker); this was not available here, so CI validation is requested.
5381c1f to
b686ddd
Compare
|
@ilya-fedin You're right, and honestly — no, it shouldn't. That snippet was a scratch verification file written during development of the lib_ui changes (it has its own For completeness on the shape of this PR: it depends on the lib_ui-side changes in desktop-app/lib_ui#356 and desktop-app/lib_ui#357; the plan was to bump the submodule here once those land upstream, which is why it's a draft. If you'd rather see it reworked differently (or not at all until lib_ui is settled), just say the word. |
Summary
Fixes the missing accessible names reported for icon-only buttons in issue #476.
Ui::AbstractButtonnow exposes an accessible name automatically:setAccessibleName()was set, it is used as before.toolTip()is used as a fallback.FlatButtonandSettingsButtonalso callsetAccessibleName()from their text, so screen readers (NVDA/JAWS/ORCA) can announce every button without per-call-site fixes.This is the foundational, low-risk part of the accessibility work: it gives every button a name. The deeper focus-navigation (chat-list tab order), context-menu focus announcements, inline-media
InvokePattern, and voice-recording keyboard alternatives discussed in #476 are planned follow-ups and are NOT part of this PR.Where the code lives
The implementation is in the
lib_uisubmodule:hesam-oxe/lib_ui@feat/accessibility-base-refactor(PR todesktop-app/lib_ui)AbstractButton::accessibilityName()inui/abstract_button.cppFlatButton::setText/SettingsButton::setTextinui/widgets/buttons.cppThis
tdesktopPR only bumps thelib_uisubmodule pointer to that commit and adds a standalone verification snippet underTelegram/SourceFiles/test/accessibility_names_snippet.cpp(not wired into the CMake build; it compiles against Qt directly).Testing
The fallback logic was verified with a standalone Qt program (offscreen platform) covering: icon-only button -> tooltip becomes the name; explicit
accessibleName()wins; empty when neither is set. Full integration build is performed by the maintainer toolchain.Related
desktop-app/lib_uiPR (same branch name) so the submodule commit resolves.