Skip to content

sync: from linuxdeepin/dde-session-shell - #532

Open
deepin-ci-robot wants to merge 1 commit into
masterfrom
sync-pr-80-nosync
Open

sync: from linuxdeepin/dde-session-shell#532
deepin-ci-robot wants to merge 1 commit into
masterfrom
sync-pr-80-nosync

Conversation

@deepin-ci-robot

@deepin-ci-robot deepin-ci-robot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#80

Summary by Sourcery

Synchronize session-shell UI metadata and validation expectations with the upstream implementation.

Enhancements:

  • Add stable Qt object names across greeter, authentication, login plugin, user, and control widgets to support UI identification and automation.

Tests:

  • Add an expected widget-name manifest covering the synchronized UI elements for accessibility and SPI validation.

Chores:

  • Synchronize related source changes and update SPDX copyright years through 2026.

Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#80
@deepin-ci-robot

Copy link
Copy Markdown
Contributor Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-ci-robot

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

@sourcery-ai

sourcery-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

Synchronizes upstream UI metadata changes by assigning stable object names to a broad set of Qt widgets, adds an expected-name manifest for SPI validation, and refreshes copyright years in the affected sources.

File-Level Changes

Change Details Files
Add stable Qt object names across greeter, authentication, gesture, session-control, and user-facing widgets for UI automation and accessibility-oriented inspection.
  • Assign descriptive object names to login controls, avatars, session selectors, authentication-method buttons, password/reset controls, and system action buttons.
  • Use suffixed or key-based names where similarly typed widgets occur in different contexts or are dynamically created.
  • Align the newly added names with the centralized expected widget metadata.
lighter-greeter/lightergreeter.cpp
plugins/examples/login-plugins/login-basic/login_module.cpp
plugins/examples/login-plugins/login-complex/login-widget.cpp
plugins/examples/login-plugins/login-fullManaged/full_managed_login_widget.cpp
plugins/login-gesture/resetDialog/gesturedialog.cpp
plugins/login-gesture/src/modulewidget.cpp
src/session-widgets/auth_password.cpp
src/session-widgets/auth_single.cpp
src/session-widgets/auth_ukey.cpp
src/session-widgets/auth_widget.cpp
src/session-widgets/sfa_widget.cpp
src/session-widgets/user_widget.cpp
src/session-widgets/userpanel.cpp
src/widgets/controlwidget.cpp
src/widgets/multiuserswarningview.cpp
src/widgets/passworderrortipswidget.cpp
src/widgets/userbutton.cpp
Introduce a YAML inventory defining expected widget object names and their source metadata.
  • Record widget variables, types, object names, source locations, and owning classes for SPI/UI validation.
  • Include entries for widgets synchronized from the upstream source, including dynamically named tray-module buttons.
  • Declare empty QML and transient-element sections for the current coverage.
tests/at/spi/expected_names.yaml
Update SPDX copyright year ranges in synchronized source files.
  • Extend applicable copyright notices through 2026.
plugins/examples/login-plugins/login-basic/login_module.cpp
plugins/examples/login-plugins/login-complex/login-widget.cpp
plugins/examples/login-plugins/login-fullManaged/full_managed_login_widget.cpp
plugins/examples/login-plugins/login-udcp/udcp_mfa_login_widget.cpp
plugins/login-gesture/resetDialog/gesturedialog.cpp
plugins/login-gesture/src/modulewidget.cpp
src/session-widgets/auth_widget.cpp
src/session-widgets/sfa_widget.cpp
src/session-widgets/user_widget.cpp
src/widgets/controlwidget.cpp
src/widgets/multiuserswarningview.cpp
src/widgets/passworderrortipswidget.cpp
src/widgets/userbutton.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

@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
Contributor Author

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 98 分,大于 70 分通过阈值,代码质量符合要求。本次变更主要为 Qt 组件添加 setObjectName() 调用以支持 UI 自动化识别,变更简洁、安全,无安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

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

建议: 语法正确,逻辑清晰。所有 setObjectName() 调用均使用标准 Qt API,auth_password.cpp 和 auth_single.cpp 中对 m_iconButton 添加了空指针检查后再调用 setObjectName(),防御性编程良好。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:

  1. src/session-widgets/auth_password.cpp:138 - objectName 命名约定(如 LineEdit/LineEdit_2/LineEdit_3)缺少注释说明区分规则
  2. src/session-widgets/auth_single.cpp:64 - LineEdit_2 等带数字后缀的命名约定缺少文档说明

建议: 建议在项目文档或代码注释中说明 objectName 命名约定规则,特别是带数字后缀(如 LineEdit_2、Avatar_2、Avatar_3)的命名原因和区分逻辑。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

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

建议: 性能良好,资源使用合理。setObjectName() 是轻量级 Qt 操作,对性能无影响。空指针检查的开销可忽略不计。


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: 存在0个安全漏洞。本次变更不涉及用户输入处理、网络通信或敏感数据操作,objectName 均为静态字符串字面量(除 TrayModuleBtn_ 使用内部模块 key 拼接,无注入风险),无安全隐患。


💡 改进建议代码示例

// 建议在 initUI() 方法中添加命名约定注释

// ObjectName 命名约定:
// - 同类型组件在不同类中使用数字后缀区分(如 LineEdit, LineEdit_2, LineEdit_3)
// - 后缀编号按组件出现顺序递增,确保跨文件唯一性
// - 详见 tests/at/spi/expected_names.yaml 完整清单
m_lineEdit->setObjectName("LineEdit");
m_passwordShowBtn->setObjectName("PasswordShow");
m_passwordHintBtn->setObjectName("PasswordHint");

// 对于可能为空的指针,先检查再设置
if (m_iconButton) {
    m_iconButton->setObjectName("IconButton");
}

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

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.

1 participant