Skip to content

fix(a11y): 补全磁盘管理器AT-SPI无障碍名称 - #218

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

fix(a11y): 补全磁盘管理器AT-SPI无障碍名称#218
re2zero wants to merge 1 commit into
linuxdeepin:masterfrom
re2zero:fix/at-spi-completion-20260828

Conversation

@re2zero

@re2zero re2zero commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

AT-SPI 无障碍名称补全

背景

对 deepin-diskmanager 仓库实施 AT-SPI 信息补全,为缺失无障碍名称的交互控件添加 setObjectName。

补全内容

  • 修改 18 个 C++ 源文件,为 60 个缺失 AT-SPI 名称的交互控件添加 setObjectName
  • 补全覆盖:按钮、下拉框、输入框、滑块、复选框、表格等控件类型
  • 版权年份同步至 2026 年
  • 所有新增名称全局唯一,无重复

覆盖率对比

指标 补全前 补全后
已命名交互控件 44/104 (42.3%) 104/104 (100%)
缺口数 60 0

编译验证

本地 cmake + make 编译通过,无新增警告。

约束

  • 仅修改缺失 AT-SPI 名称的控件,不涉及功能逻辑变更
  • 未修改翻译文件、构建配置等无关文件

Summary by Sourcery

Complete accessibility naming for all previously unnamed interactive controls in the disk manager.

Bug Fixes:

  • Complete AT-SPI object names for previously unnamed interactive disk-management controls to improve accessibility coverage.

Enhancements:

  • Add unique object and accessibility names across dialogs and widgets, covering controls such as buttons, combo boxes, text fields, sliders, checkboxes, scrollbars, and tables.
  • Update SPDX copyright years in the modified source files through 2026.

@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

@sourcery-ai

sourcery-ai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Reviewer's Guide

Completes AT-SPI metadata for the disk manager by assigning unique object names to all previously unnamed interactive controls across 18 widget and dialog implementations, while updating their SPDX copyright years through 2026; no functional or build configuration changes are included.

File-Level Changes

Change Details Files
Add unique Qt object names to previously unnamed interactive controls to expose stable AT-SPI identifiers.
  • Assign class-scoped object names during UI initialization across buttons, combo boxes, editors, sliders, checkboxes, file choosers, tables, and related controls.
  • Preserve existing behavior and accessibility labels while adding object-name metadata.
  • Cover the reported 60 missing interactive-control names across the affected dialogs and widgets.
application/widgets/createlvwidget.cpp
application/widgets/createpartitiontabledialog.cpp
application/widgets/createvgwidget.cpp
application/widgets/customcontrol/partitionwidget.cpp
application/widgets/customcontrol/passwordinputdialog.cpp
application/widgets/customcontrol/selecteditemwidget.cpp
application/widgets/customcontrol/selectpvitemwidget.cpp
application/widgets/cylinderinfowidget.cpp
application/widgets/decryptdialog.cpp
application/widgets/diskbadsectorsdialog.cpp
application/widgets/diskhealthdetectiondialog.cpp
application/widgets/diskinfodisplaydialog.cpp
application/widgets/formatedialog.cpp
application/widgets/mountdialog.cpp
application/widgets/partitiontableerrorsinfodialog.cpp
application/widgets/removepvwidget.cpp
application/widgets/resizedialog.cpp
application/widgets/unmountwarningdialog.cpp
Update SPDX copyright years in all modified source files.
  • Extend copyright ranges to 2026, including the file that previously ended in 2024.
application/widgets/createlvwidget.cpp
application/widgets/createpartitiontabledialog.cpp
application/widgets/createvgwidget.cpp
application/widgets/customcontrol/partitionwidget.cpp
application/widgets/customcontrol/passwordinputdialog.cpp
application/widgets/customcontrol/selecteditemwidget.cpp
application/widgets/customcontrol/selectpvitemwidget.cpp
application/widgets/cylinderinfowidget.cpp
application/widgets/decryptdialog.cpp
application/widgets/diskbadsectorsdialog.cpp
application/widgets/diskhealthdetectiondialog.cpp
application/widgets/diskinfodisplaydialog.cpp
application/widgets/formatedialog.cpp
application/widgets/mountdialog.cpp
application/widgets/partitiontableerrorsinfodialog.cpp
application/widgets/removepvwidget.cpp
application/widgets/resizedialog.cpp
application/widgets/unmountwarningdialog.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

@re2zero
re2zero force-pushed the fix/at-spi-completion-20260828 branch from e274a53 to c214922 Compare August 28, 2026 06:45
Add setObjectName/setAccessibleName for interactive widgets missing
AT-SPI accessibility names across 18 source files.

为18个源文件中缺失AT-SPI无障碍名称的交互控件添加setObjectName。

Log: 补全磁盘管理器AT-SPI无障碍名称
Influence: 补全后AT-SPI覆盖率达100%,无障碍工具和YouQu测试可定位控件。
@re2zero
re2zero force-pushed the fix/at-spi-completion-20260828 branch from c214922 to dd855ff Compare August 28, 2026 08:43
@re2zero
re2zero marked this pull request as ready for review August 28, 2026 08:55

@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 reviewed your changes and they look great!


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.

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 99 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 99 分,大于 70 分通过阈值,代码质量符合要求。本次变更目的是补全磁盘管理器 AT-SPI 无障碍名称,代码变更与提交目的完全一致,未发现安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 语法正确,逻辑清晰。所有新增代码均为有效的 Qt/DWidget API 调用(setObjectName、setAccessibleName),参数类型正确,调用位置合理。版权年份更新正确(2022 → 2022-2026,2022-2024 → 2022-2026)。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:

  1. application/widgets/createlvwidget.cpp:15 - 对象名"CreateLVWidgetCancleBtn"中的"Cancle"应为"Cancel",沿用已有变量名拼写错误
  2. application/widgets/customcontrol/partitionwidget.cpp:119 - 对象名"PartitionWidgetCancleBtn"中的"Cancle"应为"Cancel",沿用已有变量名拼写错误

建议: 代码结构清晰,命名规范统一(ClassName+WidgetName 格式)。建议后续修复时将"Cancle"更正为"Cancel",保持与正确拼写一致。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 性能良好,资源使用合理。setObjectName 和 setAccessibleName 均为轻量级 Qt 控件属性设置操作,仅在 UI 初始化时调用一次,对性能无影响。


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 安全合规。本次变更不涉及用户输入处理、网络通信、文件操作等安全敏感场景。安全扫描器报告的18个"硬编码密钥"告警经 AI 审计全部确认为误报(均为 Qt 控件标识字符串,如"CreatePartitionTableDialogComboBox",非密钥或密码)。


💡 改进建议代码示例

// 建议修正拼写错误(可选,非阻塞)
// createlvwidget.cpp - botFrameSetting()
m_cancleBtn = new DPushButton(tr("Cancel", "button"), m_botFrame);
m_cancleBtn->setObjectName("CreateLVWidgetCancelBtn");  // Cancle -> Cancel
m_cancleBtn->setAccessibleName("cancel");

// partitionwidget.cpp - botFrameSetting()
m_cancleBtn = new DPushButton(tr("Cancel", "button"), m_botFrame);
m_cancleBtn->setObjectName("PartitionWidgetCancelBtn");  // Cancle -> Cancel
m_cancleBtn->setAccessibleName("cancel");

本报告由 AI 代码审查工具自动生成

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, 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

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.

3 participants