feat: add AT-SPI accessible names for interactive widgets - #339
Conversation
|
Skipping CI for Draft Pull Request. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideExpands AT-SPI coverage by assigning object and accessible names across document-viewer navigation, menus, forms, editing, scaling, and slideshow controls, improving assistive-technology and automated-test discoverability without changing widget behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1cc4f87 to
0438a50
Compare
Complete AT-SPI naming for all interactive widgets, reaching 100% coverage. Add the missing setObjectName/setAccessibleName calls to interactive widgets that were only partially named (list views, tree view, context menus, buttons, line edits), improving AT-SPI coverage from 72.1% to 100%. 为全部交互控件补齐 AT-SPI 无障碍名称,覆盖率提升至 100%。 对仅有一半命名(缺少 setObjectName 或 setAccessibleName)的交互控件 (列表视图、目录树、右键菜单、按钮、输入框)补齐缺失的命名调用, AT-SPI 覆盖率从 72.1% 提升至 100%。 Log: 补全文档查看器 AT-SPI 无障碍名称至 100% 覆盖 Influence: 文档查看器 AT-SPI 无障碍覆盖率达到 100%,所有交互控件均可被辅助工具和自动化测试定位。
0438a50 to
d79f910
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 本次变更均为标准 Qt API 调用(setObjectName/setAccessibleName),语法正确,逻辑清晰,无编译错误和逻辑缺陷。所有 setter 调用均正确放置在控件初始化函数中,在控件创建之后调用,调用顺序正确。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 1.建议将 PImageListView_2/3/4 替换为描述性名称,如 NotesImageListView、SearchImageListView、ThumbnailImageListView,提高代码可读性和可维护性 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: setObjectName 和 setAccessibleName 均为 O(1) 操作,对性能无影响。本次变更不涉及任何计算密集型操作或资源分配。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 本次变更仅添加控件的无障碍名称和对象名称,不涉及用户输入处理、网络通信、文件操作或敏感数据操作,不存在安全风险。安全扫描工具检测到的 password 关键词为误报(DPasswordEdit 是 Qt 密码输入控件类名,setAccessibleName("Password") 是为辅助工具设置控件标签,非实际密码数据)。 💡 改进建议代码示例// 建议改进:使用描述性名称替代数字后缀
// reader/sidebar/NotesWidget.cpp
m_pImageListView->setObjectName("NotesImageListView");
// reader/sidebar/SearchResWidget.cpp
m_pImageListView->setObjectName("SearchImageListView");
// reader/sidebar/ThumbnailWidget.cpp
m_pImageListView->setObjectName("ThumbnailImageListView");
// reader/widgets/ScaleMenu.cpp - 统一大小写
m_pFitWorHAction->setObjectName("PFitWorHAction");
m_pFiteHAction->setObjectName("PFiteHAction");
m_pFiteWAction->setObjectName("PFiteWAction");本报告由 AI 代码审查工具自动生成 |
Changes
Add
setObjectName/setAccessibleNamecalls to interactive widgets missing accessibility names.Coverage
AT-SPI coverage improved from 45.5% to 72.7% (remaining gaps are false positives: parent pointers from external code, dead member variables, and already-named widgets detected at usage lines).
Files Changed
reader/MainWindow.cpp— TitleMenu accessible namereader/browser/BrowserMenu.cpp— ColorWidgetAction accessible namereader/uiframe/TitleMenu.cpp— HandleMenu, EyeProtectionAction accessible namesreader/widgets/EncryptionPage.cpp— password edit accessible namereader/widgets/RestoreTipWidget.cpp— buttons accessible namesreader/widgets/ScaleMenu.cpp— menu actions accessible namesreader/widgets/SlidePlayWidget.cpp— slideshow buttons accessible namesreader/widgets/TextEditWidget.cpp— text edit accessible nameLog: 补全文档查看器 AT-SPI 无障碍名称
Influence: 提升文档查看器 AT-SPI 无障碍覆盖率,便于辅助工具和自动化测试定位控件。
Summary by Sourcery
Improve AT-SPI accessibility coverage by naming previously unidentified document viewer widgets and actions.
New Features:
Enhancements: