Skip to content

feat: add AT-SPI accessibility support for interactive widgets - #612

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

feat: add AT-SPI accessibility support for interactive widgets#612
MyLeeJiEun wants to merge 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fix/at-spi-completion-20260901

Conversation

@MyLeeJiEun

@MyLeeJiEun MyLeeJiEun commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

AT-SPI Accessibility Support

This PR adds AT-SPI accessibility support for interactive widgets in dde-network-core, replacing the broken PR #607.

Changes

  • C++ widgets: Added setObjectName() calls for test anchoring (AccessibleId)
  • QML components: Added Accessible.id / Accessible.role properties for AT-SPI test anchoring and screen reader semantics
  • Copyright years: Updated SPDX-FileCopyrightText years in modified files (2022 → 2026)
  • Test mapping: Added tests/at/spi/expected_names.yaml for AT-SPI UI mapping tests

Verification

  • Branch is based on upstream master (commit d1a7e758) with proper common ancestor
  • git diff --stat confirms only 46 files changed (AT-SPI related only)
  • No unrelated files modified

Related

Summary by Sourcery

Enable AT-SPI testing and assistive-technology support throughout the network configuration interface.

New Features:

  • Add AT-SPI accessibility metadata and stable identifiers across interactive C++ and QML network widgets, pages, controls, and editors.
  • Define accessibility roles for buttons, editable fields, and grouping containers to improve screen-reader semantics.

Enhancements:

  • Add a comprehensive expected accessibility-name mapping for static and dynamically generated UI elements.

Tests:

  • Add AT-SPI expected-name coverage for C++ and QML elements, including dynamically generated secret fields.

Chores:

  • Update SPDX copyright years in modified source files.

@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

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@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 Sep 1, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR establishes AT-SPI testability and screen-reader semantics across the network configuration UI by naming native and dynamic widgets, annotating QML controls and containers with stable IDs and roles, and adding a comprehensive expected accessibility mapping; modified files also receive SPDX year updates.

File-Level Changes

Change Details Files
Added stable AT-SPI anchors to native interactive controls and dynamically generated secret inputs.
  • Assigned descriptive Qt object names to buttons, edits, combo boxes, actions, switches, and network list controls.
  • Added key-based names for dynamically created secret fields and dialog inputs.
  • Added or preserved accessible IDs for native controls in the expected mapping.
common-plugin/networkdialog/item/netitem.cpp
dcc-network-plugin/window/controllitemsmodel.cpp
dcc-network-plugin/window/editpage/connectioneditpage.cpp
dcc-network-plugin/window/editpage/connectionvpneditpage.cpp
dcc-network-plugin/window/sections/ethernetsection.cpp
dcc-network-plugin/window/sections/ipvxsection.cpp
dcc-network-plugin/window/sections/multiipvxsection.cpp
dcc-network-plugin/window/sections/wirelesssection.cpp
dcc-network-plugin/window/widgets/buttoneditwidget.cpp
dcc-network-plugin/window/widgets/filechoosewidget.cpp
dcc-network-plugin/window/wirelessdevicemodel.cpp
dock-hotspot-plugin/quickpanel.cpp
dock-network-plugin/quickpanelwidget.cpp
dss_example/dsstestwidget.cpp
net-view/window/private/netdelegate.cpp
net-view/window/private/netsecretwidget.cpp
network-service-plugin/dde-network-secret-dialog/src/networksecretdialog.cpp
Annotated the QML network UI with stable accessibility IDs and AT-SPI semantic roles.
  • Tagged interactive switches, buttons, combo boxes, text inputs, menus, delegates, and dynamically rendered controls with Accessible.id.
  • Marked page and section containers as Accessible.Grouping and password/file fields as Accessible.EditableText.
  • Added explicit button roles where component types require screen-reader disambiguation.
dcc-network/qml/DeviceStatusItem.qml
dcc-network/qml/NetButton.qml
dcc-network/qml/NetFileChooseEdit.qml
dcc-network/qml/NetItemEditor.qml
dcc-network/qml/NetPasswordEdit.qml
dcc-network/qml/NetworkMain.qml
dcc-network/qml/PageAirplane.qml
dcc-network/qml/PageAppProxy.qml
dcc-network/qml/PageDSL.qml
dcc-network/qml/PageDSLSettings.qml
dcc-network/qml/PageDetails.qml
dcc-network/qml/PageHotspot.qml
dcc-network/qml/PageSettings.qml
dcc-network/qml/PageSystemProxy.qml
dcc-network/qml/PageVPN.qml
dcc-network/qml/PageVPNSettings.qml
dcc-network/qml/PageWiredDevice.qml
dcc-network/qml/PageWirelessDevice.qml
dcc-network/qml/SectionDNS.qml
dcc-network/qml/SectionDevice.qml
dcc-network/qml/SectionGeneric.qml
dcc-network/qml/SectionIPv4.qml
dcc-network/qml/SectionIPv6.qml
dcc-network/qml/SectionPPP.qml
dcc-network/qml/SectionPPPOE.qml
dcc-network/qml/SectionSecret.qml
dcc-network/qml/SectionVPN.qml
dcc-network/qml/SystemProxyConfigItem.qml
Added a declarative AT-SPI expected-name mapping for validation of native, QML, and dynamic UI elements.
  • Recorded source locations, element types, accessibility IDs, roles, and object names.
  • Enumerated expected names for dynamically generated secret fields.
  • Provided a versioned mapping covering the accessibility test surface.
tests/at/spi/expected_names.yaml
Updated SPDX copyright ranges in modified implementation files.
  • Changed applicable copyright end years to 2026.
common-plugin/networkdialog/item/netitem.cpp
dcc-network-plugin/window/controllitemsmodel.cpp
dcc-network-plugin/window/editpage/connectioneditpage.cpp
dcc-network-plugin/window/editpage/connectionvpneditpage.cpp
dcc-network-plugin/window/sections/ethernetsection.cpp
dcc-network-plugin/window/sections/ipvxsection.cpp
dcc-network-plugin/window/sections/multiipvxsection.cpp
dcc-network-plugin/window/sections/wirelesssection.cpp
dcc-network-plugin/window/widgets/buttoneditwidget.cpp
dcc-network-plugin/window/widgets/filechoosewidget.cpp
dcc-network-plugin/window/wirelessdevicemodel.cpp
dcc-network/qml/DeviceStatusItem.qml
dcc-network/qml/NetButton.qml
dcc-network/qml/NetItemEditor.qml
dcc-network/qml/NetPasswordEdit.qml
dcc-network/qml/NetworkMain.qml
dcc-network/qml/PageAppProxy.qml
dcc-network/qml/PageDSL.qml
dcc-network/qml/PageDSLSettings.qml
dcc-network/qml/PageHotspot.qml
dcc-network/qml/PageSettings.qml
dcc-network/qml/PageSystemProxy.qml
dcc-network/qml/PageVPN.qml
dcc-network/qml/PageVPNSettings.qml
dcc-network/qml/SectionPPP.qml
dcc-network/qml/SectionPPPOE.qml
dcc-network/qml/SectionSecret.qml
dcc-network/qml/SectionVPN.qml
dcc-network/qml/SystemProxyConfigItem.qml
dock-hotspot-plugin/quickpanel.cpp
dock-network-plugin/quickpanelwidget.cpp
net-view/window/private/netsecretwidget.cpp
network-service-plugin/dde-network-secret-dialog/src/networksecretdialog.cpp

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 marked this pull request as ready for review September 1, 2026 06:45

@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="dcc-network/qml/NetButton.qml" line_range="7" />
<code_context>
 import QtQuick.Controls 2.15

 Button {
+    Accessible.id: "NetButton_Button"
     implicitHeight: implicitContentHeight + 6
     implicitWidth: implicitContentWidth + 10
</code_context>
<issue_to_address>
**issue (bug_risk):** The same fixed accessibility IDs are assigned to reusable components and repeated delegates, so multiple network items or password/button instances expose duplicate AT-SPI anchors and an ID-based lookup resolves the wrong element or becomes ambiguous.

**Triggers:** When more than one network item, delegate, or reusable editor is instantiated at the same time.

**Suggested fix:** Derive the accessibility ID from the owning connection/item identity, or scope the test lookup by the containing page and delegate.
</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 dcc-network/qml/NetButton.qml Outdated
import QtQuick.Controls 2.15

Button {
Accessible.id: "NetButton_Button"

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): The same fixed accessibility IDs are assigned to reusable components and repeated delegates, so multiple network items or password/button instances expose duplicate AT-SPI anchors and an ID-based lookup resolves the wrong element or becomes ambiguous.

Triggers: When more than one network item, delegate, or reusable editor is instantiated at the same time.

Suggested fix: Derive the accessibility ID from the owning connection/item identity, or scope the test lookup by the containing page and delegate.

@MyLeeJiEun
MyLeeJiEun force-pushed the fix/at-spi-completion-20260901 branch from 135a194 to 9aea012 Compare September 1, 2026 11:17
Use objectName as test-locator anchors for interactive QML elements
in dcc-network. Add Accessible.role for screen-reader semantics on
view containers.

Delegate/Repeater/DelegateChoice objectName values made dynamic
(appending index or model.item.id) for uniqueness. Fixed
Repeater_ItemDelegate in PageWirelessDevice.qml to append index.

C++ widgets use setObjectName() as test-locator anchors.
Copyright headers updated to include 2026.

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

Log: 为 dde-network-core 补全 AT-SPI 定位锚点支持
Influence: 提升无障碍辅助工具与自动化测试对网络组件控件的定位能力
@MyLeeJiEun
MyLeeJiEun force-pushed the fix/at-spi-completion-20260901 branch from 9aea012 to fde63e3 Compare September 1, 2026 11:20
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.

2 participants