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.
dbc9ccf to
3389d42
Compare
Add setObjectName() (AT-SPI locator anchor) for interactive widgets across dde-osd, dde-welcome, dde-wm-chooser, dmemory-warning-dialog, dde-hints-dialog and reset-password-dialog. Per DDE-198, setObjectName() is the sole locator anchor; setAccessibleName() is not added as a machine locator. 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() 调用(AT-SPI 定位锚点)。按 DDE-198 新口径,仅以 setObjectName() 作为测试定位锚点,不新增 setAccessibleName() 作为机器 定位标识。AT-SPI 名称覆盖率由 64.2% 提升至 92.5%。 回归基线 tests/at/spi/expected_names.yaml 字段由 accessible_name 迁移 为 accessible_id,与新技能口径一致。 Log: 补全 dde-session-ui 交互控件 AT-SPI 无障碍名称 Influence: 提升屏幕阅读器等辅助技术对控件的识别能力,不改变现有功能逻辑
3389d42 to
9b5edc3
Compare
概述 / Summary
按 DDE-198 新口径为 dde-session-ui 补全交互控件的 AT-SPI 定位锚点(C++
setObjectName()),提升辅助技术/测试框架对控件的定位能力。setAccessibleName()不作为机器定位标识,本次不新增。Completes AT-SPI locator anchors (
setObjectName()) for interactive widgets in dde-session-ui per the DDE-198 rule change.setAccessibleName()is retained only for screen-reader semantics and is not added as a machine locator.覆盖率 / Coverage
质量门禁:覆盖率 92.5% ≥ 80% ✅|新增缺口 0 ✅|回归 0 ✅
改动内容 / Changes
按 DDE-198 新口径,为交互控件补全
setObjectName()(AT-SPI 定位锚点),涉及 6 个子模块:m_menu(QMenu)、m_addLayoutAction(QAction,仅setObjectName)m_closeButtonm_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所有交互控件(含 QAction)一律只补
setObjectName(),不新增setAccessibleName()作为定位锚点。仅做增量补全,未修改任何已有代码或已有命名调用。DDE-198 迁移说明 / DDE-198 Migration
setAccessibleName()调用,C++ 补全只保留setObjectName();源码原有的setAccessibleName()未改动。tests/at/spi/expected_names.yaml字段由accessible_name迁移为accessible_id,与新技能口径一致(62 条记录值不变)。未处理项说明 / 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
setObjectName()调用均被识别。qdbusxml2cpp-fix、libsystemd、xcb-ewmh)未能完成链接;所增调用均为QObject标准方法setObjectName(),语法已由 libclang 解析验证。tests/at/spi/expected_names.yaml(accessible_id字段)一并提交,供后续 CI 检测命名回归。测试计划 / Test Plan