Skip to content

chore: add AT-SPI accessibility support for custom widgets - #494

Closed
re2zero wants to merge 1 commit into
linuxdeepin:masterfrom
re2zero:fix/at-spi-completion-20260805
Closed

chore: add AT-SPI accessibility support for custom widgets#494
re2zero wants to merge 1 commit into
linuxdeepin:masterfrom
re2zero:fix/at-spi-completion-20260805

Conversation

@re2zero

@re2zero re2zero commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Add AT-SPI factory registrations for all custom widget types in the deepin-log-viewer application, enabling accessibility tools (screen readers, AT automation tests) to identify these UI elements properly.

Changes

accessible.h

  • Registered 14 custom widget classes with SET_FORM_ACCESSIBLE or SET_BUTTON_ACCESSIBLE:
    • LogListView, LogTreeView, FilterContent, DisplayContent, LogPeriodButton,
      LogNormalButton, LogIconButton, LogCombox, LogSpinnerWidget,
      logDetailInfoWidget, logDetailEdit, ExportProgressDlg,
      LogCollectorMain, LogViewHeaderView
  • Added required includes for all custom widget headers

displaycontent.cpp

  • Added accessible name "logTreeView" to LogTreeView
  • Added accessible names to status/placeholder labels

logcollectormain.cpp

  • Added accessible names to sidebar and filter widgets in SPLITTER_TYPE code path

Documentation (tests/at/)

  • Added UI map, expected AT-SPI elements, and implementation checklist

Related

  • Issue: V-1365 (AT-deepin-log-viewer)

Summary by Sourcery

Add AT-SPI accessibility support for all custom widgets in deepin-log-viewer and document the expected accessibility tree.

New Features:

  • Register all custom widget classes with the accessibility factory so screen readers and AT tools can recognize them.
  • Expose accessible names for key UI elements such as the log tree view, sidebar, filter area, and status labels.

Enhancements:

  • Improve accessibility naming of existing sidebar and filter widgets to make them easier to target in automated accessibility tests.

Documentation:

  • Add AT-SPI UI map, implementation checklist, and expected element list documentation under tests/at/ for accessibility verification.

Add AT-SPI factory registrations for all custom widget types in
accessible.h, enabling accessibility tools to identify these UI
elements.

* Register 14 custom widget classes with SET_FORM_ACCESSIBLE or
  SET_BUTTON_ACCESSIBLE in accessible.h
* Add explicit accessible names to LogTreeView and status labels
  in displaycontent.cpp
* Add accessible names to sidebar and filter widgets in the
  SPLITTER_TYPE code path in logcollectormain.cpp
* Include UI map and expected element documentation in tests/at/

Log: 添加 AT-SPI 辅助功能支持,注册所有自定义控件的可访问接口
Influence: 影响所有自定义控件的辅助功能识别和 AT 测试定位
@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: re2zero

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 Aug 5, 2026

Copy link
Copy Markdown
  • 检测到敏感词export变动
详情
    {
    "export": {
        "application/accessible.h": {
            "b": [
                "#include \"exportprogressdlg.h\""
            ]
        }
    }
}

@sourcery-ai

sourcery-ai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds AT-SPI accessibility support for deepin-log-viewer’s custom widgets by registering them in the accessibility factory, assigning accessible names/object names to key UI elements, and documenting the expected AT-SPI tree and verification checklist for automated tests.

Sequence diagram for AT-SPI lookup using new accessibleFactory registrations

sequenceDiagram
    actor ATSPIClient
    participant QtATSPIBridge
    participant accessibleFactory
    participant LogTreeView

    ATSPIClient->>QtATSPIBridge: request
    QtATSPIBridge->>accessibleFactory: accessibleFactory
    alt classname is LogTreeView
        accessibleFactory->>LogTreeView: USE_ACCESSIBLE
    end
    accessibleFactory-->>QtATSPIBridge: QAccessibleInterface
    QtATSPIBridge-->>ATSPIClient: response
Loading

File-Level Changes

Change Details Files
Register all custom widgets in the AT-SPI accessibility factory and wire them into the existing macro-based registration system.
  • Include headers for all custom widget classes so they can be referenced by the accessibility macros and factory.
  • Add SET_FORM_ACCESSIBLE/SET_BUTTON_ACCESSIBLE entries for each custom widget type with consistent fallback accessible names.
  • Extend accessibleFactory to return QAccessibleInterface instances for each newly registered widget type using USE_ACCESSIBLE macros.
application/accessible.h
Add explicit accessible names / object names to key runtime widgets so AT-SPI clients can find them deterministically.
  • Assign an accessibleName to LogTreeView and to its various empty-state/status DLabels in DisplayContent::initUI().
  • Set objectName and accessibleName on the log sidebar (LogListView) and accessibleName on the filter widget in LogCollectorMain::initUI().
application/displaycontent.cpp
application/logcollectormain.cpp
Introduce AT-SPI documentation, UI map, and verification artifacts to guide and validate accessibility coverage.
  • Add a UI map document describing the AT-SPI component tree and key custom widgets.
  • Add an implementation checklist summarizing pre/post coverage, concrete changes, and verification assertions.
  • Add a table of expected AT-SPI elements, including names, roles, and source locations, for use in tests.
tests/at/ui-map.md
tests/at/at-spi-implementation-checklist.md
tests/at/expected-at-spi-elements.md

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

@re2zero

re2zero commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

✅ 本地验证通过

已在本地子项目 deepin-log-viewer 完成 cherry-pick + 代码 review + dpkg 编译验证:

  • Cherry-pick: 干净(6 文件,+318,无冲突)
  • 代码 Review: PASS —— 14 个 include / 14 个类名全部核实存在且为 QWidget 派生类;setAccessibleName() 用法合理;无 include 环;未误改无关文件
  • 编译: dpkg-buildpackage -us -uc -b -tc -j$(nproc) 成功(Qt6/dtk6 工具链,无编译错误,约 5 分钟)
  • 产物: deepin-log-viewer_6.5.26_amd64.debliblogviewerplugin_6.5.26_amd64.deb 等 5 个包
  • 二进制验证: strings 确认 14 个 Accessible* 工厂类及 left_side_bar/filterWidget/logTreeView 等名称已打入产物

备注(不阻塞,均为既有代码问题,非本 PR 引入):notAuditLabel 块沿用 noResultLabel->setPalette(auditPa) 的既有复制粘贴问题;SET_BUTTON_ACCESSIBLE 首次展开时触发 QMouseEvent 弃用构造告警。

@re2zero

re2zero commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

PR 验证结果:通过 ✅

验证内容

仓库: linuxdeepin/deepin-log-viewer
PR: #494
标题: chore: add AT-SPI accessibility support for custom widgets
提交: 143e6cac


1. cherry-pick ✅

  • 无冲突,成功 cherry-pick 到 master 分支

2. 代码 review ✅

审查了所有变更(6 个文件,+318 行):

  • accessible.h:为 14 个自定义控件(LogListView, LogTreeView, FilterContent, DisplayContent, LogPeriodButton 等)添加 AT-SPI 注册,更新 accessibleFactory
  • displaycontent.cpp:为 LogTreeView 和 4 个状态标签添加 accessibleName
  • logcollectormain.cpp:为左侧栏和过滤器区域添加 accessibleName
  • tests/at/:新增 AT-SPI 实现检查清单、预期元素文档和 UI 映射文档
  • 代码风格一致,无安全隐患,使用与现有代码一致的 SET_FORM_ACCESSIBLE/SET_BUTTON_ACCESSIBLE 宏

3. 编译验证 ✅

  • 配置: cmake 配置成功(Release 模式,Qt6/DTK6)
  • 编译: make -j$(nproc) 成功
  • 产物:
    • application/deepin-log-viewer (4.9 MB)
    • liblogviewerplugin/liblogviewerplugin.so.0.1.0
    • logViewerService/log-view-service
    • logViewerAuth/logViewerAuth
    • logViewerTruncate/logViewerTruncate

4. 清理 ✅

  • 已重置 cherry-pick 提交
  • 已删除临时构建目录

结论: PR 验证全部通过,可以合并。

@re2zero

re2zero commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Closing per request - will re-submit with updated workflow constraints

@re2zero re2zero closed this Aug 6, 2026
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