feat(a11y): 补全 dde-session-ui 交互控件 AT-SPI 无障碍名称 - #450
Conversation
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
Reviewer's GuideImproves dde-session-ui AT-SPI discoverability by adding PascalCase object and accessible names to 19 previously unnamed controls across five submodules, while preserving existing names and shared-instance behavior. A 124-file YAML baseline is added for automated coverage and regression checks, with licensing metadata and SPDX year updates included. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
cf52805 to
d2b0cfa
Compare
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="reset-password-dialog/passwordwidget.cpp" line_range="65-70" />
<code_context>
this->setAccessibleName("PasswordWidget");
+ m_newPasswordEdit->setObjectName("NewPasswordEdit");
+ m_newPasswordEdit->setAccessibleName("NewPasswordEdit");
+ m_repeatPasswordEdit->setObjectName("RepeatPasswordEdit");
+ m_repeatPasswordEdit->setAccessibleName("RepeatPasswordEdit");
+ m_passwordTipsEdit->setObjectName("PasswordTipsEdit");
+ m_passwordTipsEdit->setAccessibleName("PasswordTipsEdit");
+
QVBoxLayout *resetPasswordVLayout = new QVBoxLayout(this);
</code_context>
<issue_to_address>
**🚨 issue (security):** The new accessible names are untranslated implementation identifiers such as `NewPasswordEdit`, `QuestionEdit1`, `SendCodeBtn`, and `ButtonBox`, so screen readers announce internal PascalCase names instead of the visible, localized control meaning. This makes the reset-password fields and actions difficult to understand for users, especially when the visible labels are localized or when multiple similarly named controls are present.
**Triggers:** When a screen reader consumes any of the newly named controls.
**Suggested fix:** Use localized, user-facing accessible names derived from the visible labels (and include the question number or current question text where needed), rather than variable-derived identifiers.
```suggestion
m_newPasswordEdit->setObjectName("NewPasswordEdit");
m_newPasswordEdit->setAccessibleName(tr("New Password"));
m_repeatPasswordEdit->setObjectName("RepeatPasswordEdit");
m_repeatPasswordEdit->setAccessibleName(tr("Repeat Password"));
m_passwordTipsEdit->setObjectName("PasswordTipsEdit");
m_passwordTipsEdit->setAccessibleName(tr("Password Hint"));
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| m_newPasswordEdit->setObjectName("NewPasswordEdit"); | ||
| m_newPasswordEdit->setAccessibleName("NewPasswordEdit"); | ||
| m_repeatPasswordEdit->setObjectName("RepeatPasswordEdit"); | ||
| m_repeatPasswordEdit->setAccessibleName("RepeatPasswordEdit"); | ||
| m_passwordTipsEdit->setObjectName("PasswordTipsEdit"); | ||
| m_passwordTipsEdit->setAccessibleName("PasswordTipsEdit"); |
There was a problem hiding this comment.
🚨 issue (security): The new accessible names are untranslated implementation identifiers such as NewPasswordEdit, QuestionEdit1, SendCodeBtn, and ButtonBox, so screen readers announce internal PascalCase names instead of the visible, localized control meaning. This makes the reset-password fields and actions difficult to understand for users, especially when the visible labels are localized or when multiple similarly named controls are present.
Triggers: When a screen reader consumes any of the newly named controls.
Suggested fix: Use localized, user-facing accessible names derived from the visible labels (and include the question number or current question text where needed), rather than variable-derived identifiers.
| m_newPasswordEdit->setObjectName("NewPasswordEdit"); | |
| m_newPasswordEdit->setAccessibleName("NewPasswordEdit"); | |
| m_repeatPasswordEdit->setObjectName("RepeatPasswordEdit"); | |
| m_repeatPasswordEdit->setAccessibleName("RepeatPasswordEdit"); | |
| m_passwordTipsEdit->setObjectName("PasswordTipsEdit"); | |
| m_passwordTipsEdit->setAccessibleName("PasswordTipsEdit"); | |
| m_newPasswordEdit->setObjectName("NewPasswordEdit"); | |
| m_newPasswordEdit->setAccessibleName(tr("New Password")); | |
| m_repeatPasswordEdit->setObjectName("RepeatPasswordEdit"); | |
| m_repeatPasswordEdit->setAccessibleName(tr("Repeat Password")); | |
| m_passwordTipsEdit->setObjectName("PasswordTipsEdit"); | |
| m_passwordTipsEdit->setAccessibleName(tr("Password Hint")); |
d2b0cfa to
dbc9ccf
Compare
Add setObjectName/setAccessibleName for interactive widgets across dde-osd, dde-welcome, dde-wm-chooser, dmemory-warning-dialog, dde-hints-dialog and reset-password-dialog. Coverage raised from 64.2% to 92.5%. 为 dde-osd、dde-welcome、dde-wm-chooser、dmemory-warning-dialog、 dde-hints-dialog 与 reset-password-dialog 等模块的交互控件补全 setObjectName/setAccessibleName 调用,AT-SPI 名称覆盖率由 64.2% 提升至 92.5%。 Log: 补全 dde-session-ui 交互控件 AT-SPI 无障碍名称 Influence: 提升屏幕阅读器等辅助技术对控件的识别能力,不改变现有功能逻辑
dbc9ccf to
3389d42
Compare
概述 / Summary
为 dde-session-ui 补全交互控件的 AT-SPI 无障碍名称(
setObjectName/setAccessibleName),提升屏幕阅读器等辅助技术对控件的识别能力。Completes AT-SPI accessible names (
setObjectName/setAccessibleName) for interactive widgets in dde-session-ui, improving recognition by screen readers and other assistive technologies.覆盖率 / Coverage
质量门禁:覆盖率 92.5% ≥ 80% ✅|新增缺口 0 ✅|回归 0 ✅
改动内容 / Changes
为 19 个交互控件补全 AT-SPI 名称,涉及 8 个文件 / 5 个子模块:
m_addLayoutAction(QAction,仅setObjectName)m_enterBtnm_gorgeousBtn、m_topSpeedBtnm_cancelButton、m_continueButtonm_buttonBox、m_newPasswordEdit、m_repeatPasswordEdit、m_passwordTipsEdit、m_questionEdit1~3、m_answerEdit1~3、m_phoneEmailEdit、m_verificationCodeEdit、m_sendCodeBtn命名遵循 PascalCase 规范,由
variable → strip m_推导;QAction 仅设置setObjectName,其余控件同时设置setObjectName+setAccessibleName。仅做增量补全,未修改任何已有代码或已有命名调用。未处理项说明 / Notes
5 个
m_view(NotifyListView)跳过:dde-osd/src/notification-center下 5 个类(BubbleItem / BubbleTitleWidget / ItemDelegate / NotifyModel / OverLapWidet)的m_view均为同一运行时实例的引用——该实例m_mainList(notifywidget.cpp:38)已设置setAccessibleName("NotifyListView")。为避免在同一控件上设置冲突名称,按"增量补全、不修改已有命名"原则跳过,记为扫描器假阳性。2 个存量问题未修改(遵循"不修改已有代码"约束):
TitleLabel在 hintsdialog.cpp 与 mainwindow.cpp 重复(跨两个对话框)notification_title(bubbleitem.cpp)为 snake_case,不符合 PascalCase二者均为已有命名,本次仅做增量补全,未改动;如需统一可后续单独处理。
验证 / Verification
qdbusxml2cpp-fix、libsystemd、xcb-ewmh)未能完成链接;所增调用均为QWidget/QObject标准方法(setObjectName/setAccessibleName),语法已由 libclang 解析验证。tests/at/spi/expected_names.yaml一并提交,供后续 CI 检测命名回归。测试计划 / Test Plan
Summary by Sourcery
Complete accessible naming for interactive dde-session-ui controls to improve screen-reader support.
New Features:
Enhancements:
Tests:
Chores: