Skip to content

feat(dock): add accessibility annotations to dock QML#1669

Open
hualet wants to merge 1 commit into
masterfrom
develop/dock-a11y
Open

feat(dock): add accessibility annotations to dock QML#1669
hualet wants to merge 1 commit into
masterfrom
develop/dock-a11y

Conversation

@hualet

@hualet hualet commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Add Qt Quick Accessible attached properties to the dock panel QML so screen readers (e.g. Orca over AT-SPI) can read the taskbar:

  • AppItem: Button role, app name, and "Active"/"Demands attention" state description
  • TaskManager containment and dock left/center/right areas: Grouping role with names (plain names without a role map to AT-SPI filler and get ignored by Orca)
  • Container ListViews (OverflowContainer): List role
  • Action buttons (show desktop, multitask view, tray collapse/stash/quick-settings): Button role + name, reusing existing toolTip text
  • Embedded tray surfaces (ShellSurfaceItemProxy): expose the plugin's displayName when available

Annotations only — no focus, behavior, or layout changes (+31 lines across 10 QML files).

Test

  • qmllint: no syntax errors, no new warnings.
  • Runtime-verified on an X11 session (dock + dde-apps, QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1, at-spi2): the dock window exposes "Dock Left/Center/Right Area", "Task Manager", per-app [button] nodes with names (文件管理器 / Google Chrome / …), and the active window carries the "Active" description, by walking the AT-SPI tree via GI.

Out of scope (follow-ups)

  • Keyboard navigation for the dock (needs a focus strategy decision: Qt.WindowDoesNotAcceptFocus + layer-shell keyboard interactivity)
  • Launcher UI annotations (lives in dde-launchpad)
  • SNI tray icons' own a11y (rendered by dde-tray-loader plugin processes)

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @hualet, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hualet

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Expose the taskbar to screen readers (e.g. Orca over AT-SPI) via Qt
Quick Accessible attached properties:

- app items: button role, app name, active/attention description
- task manager and dock left/center/right areas: grouping role + name
- container list views: list role
- show desktop / multitask view / tray action buttons: role + name
- embedded tray surfaces: plugin display name when available
@hualet
hualet force-pushed the develop/dock-a11y branch from 0f5bebc to 88f8d43 Compare July 18, 2026 07:55
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码通过添加Accessible属性提升了无障碍支持,整体质量良好
逻辑正确,无安全漏洞,版权信息更新合理

■ 【详细分析】

  • 1.语法逻辑(基本正确)✓

代码在多个QML组件中正确添加了Accessible附加属性,如Accessible.role和Accessible.name,语法符合QML规范。版权年份更新格式正确。
潜在问题:无
建议:无

  • 2.代码质量(良好)✓

添加的无障碍属性命名和取值合理,提高了应用的无障碍可用性。版权信息更新及时。
潜在问题:部分组件的Accessible.name直接绑定了toolTip.text,如果toolTip未正确初始化可能导致无障碍名称缺失。
建议:确保所有绑定的toolTip.text都有初始值或提供默认的无障碍名称。

  • 3.代码性能(无性能问题)✓

添加属性绑定对性能影响微乎其微,不会引入额外的计算开销或资源占用。
潜在问题:无
建议:无

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次代码修改仅为UI层面的属性添加和版权声明更新,不涉及敏感数据处理、网络通信或系统权限操作,不存在安全风险。

  • 建议:无

■ 【改进建议代码示例】

// 以 multitaskview.qml 为例,提供默认值防止无障碍名称缺失
AppletDockItem {
    id: toggleworkspace
    dockOrder: 15

    Accessible.role: Accessible.Button
    Accessible.name: toolTip.text ? toolTip.text : qsTr("Multitasking View")

    PanelToolTip {
        id: toolTip
        text: qsTr("Multitasking View")
    }
}

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.

2 participants