Skip to content

feat(at-spi): add accessible names for QML interactive controls - #797

Open
MyLeeJiEun wants to merge 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fix/at-spi-completion-2026-08-19
Open

feat(at-spi): add accessible names for QML interactive controls#797
MyLeeJiEun wants to merge 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fix/at-spi-completion-2026-08-19

Conversation

@MyLeeJiEun

@MyLeeJiEun MyLeeJiEun commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

为 dde-launchpad 补全 AT-SPI 支持:为 QML 交互控件添加 Accessible.name/Accessible.role,并对纯装饰背景设置 Accessible.ignored,建立稳定、与语言无关的 AT-SPI 名称契约。

QML AT-SPI 名称覆盖率由 2.2% → 88.2%(67/76 交互控件已命名,≥80% 门禁阈值)。

Changes

  • 标准交互控件(Menu / MenuItem / Button / ToolButton / Switch / TextInput / ListView / GridView / ScrollBar / ItemDelegate / PageIndicator):添加英文 PascalCase Accessible.name,作为不随语言环境变化的稳定 AT 定位锚点(菜单项文本为 qsTr,默认会随 locale 变化,故需显式英文名)。
  • 自定义容器组件(GridViewContainer / SideBar / WindowedFrame / FullscreenFrame / BottomBar / FolderGridViewPopup / AlphabetCategoryPopup / AppList / AnalysisView / FrequentlyUsedView / RecentlyInstalledView / FreeSortListView / SearchResultView):添加 Accessible.name + Accessible.role(Pane / ToolBar / Dialog)。
  • 纯装饰背景(ItemBackground = D.BoxPanel、DebugBounding):设置 Accessible.ignored: true,从 AT-SPI 树中排除纯视觉元素。
  • 修正既有非合规名称 Exit fullscreenExitFullscreen(含空格会导致 AT-SPI 解析不稳定)。
  • 同步 5 个文件的版权年份至 2026;新增 tests/at/spi/expected_names.yaml 回归基线并在 REUSE.toml 声明。

Scope / Notes

  • 纯 QML 补全,C++ 侧无可补全的 QWidget UI(仅模型/集成代码),故为 QML-only 路径。
  • 增量补全:仅新增 AT-SPI 属性,未改动既有逻辑/格式/命名。
  • IconItemDelegate 的 6 个实例及其内部 Button 未新增名称:该组件根 Control 已设 Accessible.name: iconItemLabel.text(应用显示名),实例会继承该名称;对其再加静态名会覆盖正确的应用名。这是扫描器的静态误报(扫描器不追踪组件根属性继承)。
  • A-Z 分类弹窗的 ToolButton 未新增名称:其 text: modelData(字母本身,与语言无关)已作为 AT 名称由 Qt 默认导出,加静态名反而会覆盖字母名。
  • 因运行环境缺少 DTK/dde-shell 等构建依赖,无法完成全量 cmake 构建;已通过 libclang/tokenizer 重新扫描(76 元素,无解析错误)、质量门禁、括号配平校验确认 QML 结构有效。
  • expected_names.yaml 含 67 个 QML 元素,作为后续质量门禁的回归基线。

Quality Gate

  • QML 覆盖率:88.2%(阈值 80%)✅
  • 命名规范:0 问题 ✅
  • 名称唯一性:0 冲突 ✅
  • 回归(相对 expected_names.yaml,名称级):0 回归 ✅

关联 Multica 任务:DDE-139 dde-launchpad: AT-SPI 补全

Summary by Sourcery

Expand dde-launchpad’s QML accessibility contract so interactive controls expose stable AT-SPI identifiers and meaningful roles while decorative elements remain hidden.

New Features:

  • Add stable, language-independent accessibility identifiers and semantic roles for QML menus, controls, containers, dialogs, and toolbars to improve AT-SPI support.
  • Exclude purely decorative QML backgrounds from the accessibility tree.

Bug Fixes:

  • Normalize the fullscreen exit control identifier to avoid an unstable name containing whitespace.

Enhancements:

  • Increase QML interactive-control accessibility coverage and establish unique naming across the launcher UI.

Tests:

  • Add an AT-SPI expected-name regression baseline covering the named QML elements.

Chores:

  • Update copyright years in the affected QML files and register the new regression baseline with REUSE.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MyLeeJiEun

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

@deepin-ci-robot

Copy link
Copy Markdown

Hi @MyLeeJiEun. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai

sourcery-ai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

This QML-only change expands stable, language-independent AT-SPI identification to 67 of 76 interactive elements, assigns semantic roles to custom containers, removes decorative backgrounds from the accessibility tree, and adds a YAML regression baseline plus licensing metadata. Review the naming consistency, role placement, ignored-background behavior, and baseline completeness; full builds were unavailable because DTK/dde-shell dependencies were missing.

Sequence diagram for AT-SPI tree construction and validation

sequenceDiagram
    participant QML as QML controls
    participant Qt as Qt accessibility bridge
    participant AT as AT-SPI consumer
    participant Baseline as expected_names.yaml
    QML->>Qt: export Accessible.id
    QML->>Qt: export Accessible.role
    QML->>Qt: apply Accessible.ignored
    Qt->>AT: expose named controls and semantic containers
    Qt-->>AT: omit decorative backgrounds
    Baseline->>AT: compare expected_names.yaml
    AT-->>Baseline: report name and role regressions
Loading

File-Level Changes

Change Details Files
Added stable AT-SPI identifiers to QML interactive controls and menus.
  • Annotated menus, menu items, buttons, switches, text inputs, views, delegates, indicators, and scroll bars with PascalCase accessibility IDs.
  • Preserved dynamic application labels and language-independent alphabet labels where static IDs would replace meaningful names.
  • Normalized the fullscreen exit identifier to ExitFullscreenBtn.
qml/AppItemMenu.qml
qml/DebugDialog.qml
qml/DummyAppItemMenu.qml
qml/FolderGridViewPopup.qml
qml/FullscreenFrame.qml
qml/GridViewContainer.qml
qml/Main.qml
qml/windowed/AppListView.qml
qml/windowed/BottomBar.qml
qml/windowed/FreeSortListView.qml
qml/windowed/GridViewContainer.qml
qml/windowed/SearchResultView.qml
qml/windowed/SideBar.qml
shell-launcher-applet/package/launcheritem.qml
Added semantic accessibility roles to custom QML containers and excluded decorative visuals from the accessibility tree.
  • Assigned Pane, ToolBar, and Dialog roles to reusable frames, views, bars, and popups.
  • Marked ItemBackground and DebugBounding instances as ignored to remove purely visual elements from AT-SPI traversal.
qml/FolderGridViewPopup.qml
qml/FullscreenFrame.qml
qml/IconItemDelegate.qml
qml/Main.qml
qml/windowed/AnalysisView.qml
qml/windowed/AppList.qml
qml/windowed/AppListView.qml
qml/windowed/BottomBar.qml
qml/windowed/FrequentlyUsedView.qml
qml/windowed/RecentlyInstalledView.qml
qml/windowed/SearchResultView.qml
qml/windowed/SideBar.qml
qml/windowed/WindowedFrame.qml
qml/windowed/IconItemDelegate.qml
shell-launcher-applet/package/launcheritem.qml
Introduced a regression baseline and repository metadata for accessibility coverage.
  • Added expected accessibility IDs and roles for 67 QML elements.
  • Declared licensing metadata for the YAML baseline.
  • Updated copyright ranges in affected QML files.
tests/at/spi/expected_names.yaml
REUSE.toml
qml/DebugDialog.qml
qml/DummyAppItemMenu.qml
qml/Main.qml
qml/windowed/AlphabetCategoryPopup.qml
qml/windowed/BottomBar.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@MyLeeJiEun
MyLeeJiEun force-pushed the fix/at-spi-completion-2026-08-19 branch 2 times, most recently from c5d3713 to 8dd4e05 Compare August 26, 2026 06:29
@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/retest

@deepin-ci-robot

Copy link
Copy Markdown

@MyLeeJiEun: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@deepin-ci-robot

Copy link
Copy Markdown

@MyLeeJiEun: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@BLumia BLumia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

有点滥用无障碍了,如果长期而言完全不打算做无障碍支持,只打算利用 AT-SPI 做自动化测试的话倒是无所谓,但需要确认是不是这个情况。

无障碍的 Accessible.name 名称是朗读给使用屏幕阅读器的用户用的,应当是人类可读的实际控件描述。

@MyLeeJiEun
MyLeeJiEun force-pushed the fix/at-spi-completion-2026-08-19 branch 2 times, most recently from e7ebac3 to 485f502 Compare August 27, 2026 14:05
@MyLeeJiEun
MyLeeJiEun marked this pull request as ready for review September 1, 2026 06:46

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="qml/AppItemMenu.qml" line_range="32" />
<code_context>

         Menu {
             id: contextMenu
+            Accessible.id: "ContextMenu"

             topMargin: isFullscreen && DesktopIntegration.dockPosition === Qt.UpArrow ? dockSpacing : 0
</code_context>
<issue_to_address>
**issue (bug_risk):** `Accessible.id` is not a standard Qt Quick `Accessible` attached property in the Qt versions accepted by this project, so QML loading fails with an invalid attached-property assignment before the affected UI can be instantiated.

**Suggested fix:** Use a supported accessibility property or provide the required custom Qt accessibility extension, and gate the QML usage on the Qt version that implements it.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread qml/AppItemMenu.qml Outdated

Menu {
id: contextMenu
Accessible.id: "ContextMenu"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Accessible.id is not a standard Qt Quick Accessible attached property in the Qt versions accepted by this project, so QML loading fails with an invalid attached-property assignment before the affected UI can be instantiated.

Suggested fix: Use a supported accessibility property or provide the required custom Qt accessibility extension, and gate the QML usage on the Qt version that implements it.

Comment thread qml/windowed/AppListView.qml Outdated
@MyLeeJiEun
MyLeeJiEun force-pushed the fix/at-spi-completion-2026-08-19 branch from 9b8abdf to 4bf676c Compare September 1, 2026 11:17
Use objectName as test-locator anchors for interactive QML elements
(menus, menu items, buttons, switches, text input, lists, grids,
scrollbars, item delegates, page indicators, view containers, and
DTK WarningButton/SearchEdit/SwipeView controls). Add Accessible.role
(Pane/ToolBar/Dialog) for screen-reader semantics. Mark decorative
backgrounds as Accessible.ignored.

Pre-existing Accessible.name entries preserved unchanged for
screen-reader semantics. Where a converted objectName would conflict
with a pre-existing objectName (folderGridViewContainer in
FolderGridViewPopup.qml, gridViewContainer in FullscreenFrame.qml),
the pre-existing value is retained and expected_names.yaml updated
to match.

Delegate/Repeater objectName values made dynamic (appending index)
for uniqueness.

Rebuild tests/at/spi/expected_names.yaml (accessible_id field).

Log: 为 dde-launchpad 补全 AT-SPI 定位锚点支持
Influence: 提升无障碍辅助工具与自动化测试对启动器控件的定位能力
@MyLeeJiEun
MyLeeJiEun force-pushed the fix/at-spi-completion-2026-08-19 branch from 4bf676c to cfab362 Compare September 1, 2026 11:20
@MyLeeJiEun
MyLeeJiEun requested a review from BLumia September 2, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants