Skip to content

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

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

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

Conversation

@deepin-ci-robot

@deepin-ci-robot deepin-ci-robot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

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

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

Summary by Sourcery

Synchronize session-shell UI updates by standardizing widget identifiers and improving blur-background request reliability.

Bug Fixes:

  • Increase the blur-background D-Bus request timeout to improve reliability when retrieving background images.

Enhancements:

  • Add stable Qt object names across greeter, authentication, login-plugin, user, and control widgets to support accessibility, styling, and UI automation.
  • Synchronize widget naming expectations with the accessibility test fixture and update affected copyright years.

Tests:

  • Add expected widget-name metadata for accessibility/UI validation across session-shell components.

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

Source-pull-request: linuxdeepin/dde-session-shell#95
@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 17, 2026

Copy link
Copy Markdown

Reviewer's Guide

Synchronizes UI-oriented changes from dde-session-shell by adding stable object names and an SPI expected-name manifest across the greeter and session widgets, while extending the blur-background DBus timeout and updating SPDX copyright years.

Sequence diagram for extended blur-background DBus timeout

sequenceDiagram
    participant Background as FullScreenBackground
    participant DBus as ImageEffectDBusService

    Background->>DBus: call Get
    Note over Background,DBus: Timeout increased to 5 seconds
    DBus-->>Background: blurPath
Loading

File-Level Changes

Change Details Files
Add stable Qt object names across login, authentication, user, control, and warning widgets for automated UI identification.
  • Assign object names to greeter controls and authentication inputs/actions.
  • Name example plugin controls, gesture controls, avatars, user lists, and error/reset widgets.
  • Name authentication-method buttons and dynamically created tray controls, including module-key-based names.
  • Add the expected widget-name inventory used by SPI tests.
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
tests/at/spi/expected_names.yaml
Increase the timeout for the system-bus blur-background request.
  • Change the synchronous DBus call timeout from 2 seconds to 5 seconds to tolerate slower image-effect responses.
src/widgets/fullscreenbackground.cpp
Refresh SPDX copyright years in synchronized source files.
  • Update copyright ranges from their previous end years 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/fullscreenbackground.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 found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/widgets/fullscreenbackground.cpp" line_range="188" />
<code_context>
                                                           DSS_DBUS::imageEffectService, "Get");
     message << "" << path;
     QDBus::CallMode callMode = isVisible() ? QDBus::BlockWithGui : QDBus::Block;
-    QDBusPendingReply<QString> reply = QDBusConnection::systemBus().call(message, callMode, 2 * 1000);
+    QDBusPendingReply<QString> reply = QDBusConnection::systemBus().call(message, callMode, 5 * 1000);
     QString blurPath;
</code_context>
<issue_to_address>
**issue (performance):** The synchronous DBus call now blocks the background-update path for up to five seconds instead of two seconds when the image-effect service is slow or unavailable, delaying background updates and making greeter transitions visibly unresponsive.

**Triggers:** When the image-effect DBus service does not answer promptly.

**Suggested fix:** Avoid increasing the synchronous GUI-thread timeout, or issue the DBus request asynchronously and update the background from its completion handler.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

DSS_DBUS::imageEffectService, "Get");
message << "" << path;
QDBus::CallMode callMode = isVisible() ? QDBus::BlockWithGui : QDBus::Block;
QDBusPendingReply<QString> reply = QDBusConnection::systemBus().call(message, callMode, 2 * 1000);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (performance): The synchronous DBus call now blocks the background-update path for up to five seconds instead of two seconds when the image-effect service is slow or unavailable, delaying background updates and making greeter transitions visibly unresponsive.

Triggers: When the image-effect DBus service does not answer promptly.

Suggested fix: Avoid increasing the synchronous GUI-thread timeout, or issue the DBus request asynchronously and update the background from its completion handler.

@deepin-ci-robot

Copy link
Copy Markdown
Contributor Author

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次变更为同步上游仓库的代码,主要为UI控件添加setObjectName()以支持AT/SPI自动化测试,更新版权年份,增加DBus调用超时时间,以及添加空指针安全检查。变更内容安全合规,无安全漏洞引入,代码质量良好。

🔍 详细分析

1. 语法逻辑 ✅

评分: 25/25 ✓ 通过

评价: 语法正确,逻辑清晰

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

分析说明:

  • 所有变更均为合法的 C++ 方法调用,语法正确
  • setObjectName() 是 Qt 标准方法,调用方式正确
  • auth_password.cpp 和 auth_single.cpp 中新增的 m_iconButton 空指针检查逻辑正确,属于良好的防御性编程
  • fullscreenbackground.cpp 中 DBus 超时时间从 2 * 1000 改为 5 * 1000,为简单的数值变更,逻辑无误

建议: 无


2. 代码质量 ✅

评分: 23/25 ✓ 通过

评价: 代码结构清晰,注释完整

潜在问题:

  1. src/session-widgets/auth_single.cpp:64 - AuthSingle::initUI 中对象名称使用数字后缀(LineEdit_2),不够语义化。建议使用更具描述性的名称如 AuthSingleLineEdit,便于维护和理解。
  2. src/session-widgets/auth_ukey.cpp:45 - AuthUKey::initUI 中对象名称使用数字后缀(LineEdit_3),不够语义化。建议使用 AuthUKeyLineEdit。
  3. src/session-widgets/user_widget.cpp:47 - UserWidget::initUI 中对象名称使用数字后缀(Avatar_2),不够语义化。建议使用 UserWidgetAvatar。
  4. src/session-widgets/userpanel.cpp:41 - UserPanel::initUI 中对象名称使用数字后缀(Avatar_3),不够语义化。建议使用 UserPanelAvatar。
  5. src/widgets/controlwidget.cpp:369 - ControlWidget::addModule 中 m_contextMenu->setObjectName("ContextMenu") 在 while 循环内部调用,属于冗余操作。setObjectName 只需设置一次,应放在循环外部。

建议:

  1. 建议使用更具描述性的对象名称替代数字后缀,如 AuthSingleLineEdit、AuthUKeyLineEdit 等,提升代码可维护性
  2. 将 ControlWidget::addModule 中的 setObjectName 调用移至 while 循环外部,避免每次迭代重复设置

分析说明:

  • setObjectName() 调用模式统一且一致,覆盖了登录界面各类控件
  • 版权年份更新准确,从 2022/2024 更新为 2026
  • 新增的 tests/at/spi/expected_names.yaml 测试数据文件结构清晰,字段完整
  • 新增的空指针检查(if (m_iconButton))是合理的防御性编程改进

3. 代码性能 ✅

评分: 20/20 ✓ 通过

评价: 性能良好,资源使用合理

潜在问题:
✅ 未发现性能问题

分析说明:

  • setObjectName() 是 Qt 的轻量级方法,仅设置字符串属性,无性能影响
  • fullscreenbackground.cpp 中 DBus 超时从 2000ms 增加到 5000ms,是合理的调整,避免在系统负载较高时因超时导致背景模糊处理失败
  • 新增的空指针检查不会带来额外性能开销

建议: 无


4. 代码安全 🔒

评分: 30/30 ✓ 通过

评价: 存在0个安全漏洞

🔐 发现 0 个安全漏洞

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个

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

分析说明:

  • 本次变更未引入任何用户输入处理逻辑,无注入风险
  • 未引入硬编码密钥或敏感信息
  • 未修改权限控制或认证逻辑
  • 新增的空指针检查实际上提升了代码的安全性(防止空指针解引用)
  • DBus 超时时间的增加不影响安全性

建议: 无


📋 变更摘要

项目 详情
PR 标题 sync: from linuxdeepin/dde-session-shell
作者 deepin-ci-robot
修改文件数 20
分析模式 全量分析(GitHub PR)

主要变更内容:

  1. 为约 60+ 个 UI 控件添加 setObjectName() 调用,支持 AT/SPI 自动化测试
  2. 更新多个文件的版权年份至 2026 年
  3. 将 fullscreenbackground.cpp 中 DBus 调用超时从 2000ms 增加到 5000ms
  4. 在 auth_password.cpp 和 auth_single.cpp 中为 m_iconButton 添加空指针检查
  5. 新增 tests/at/spi/expected_names.yaml 测试数据文件(452 行)

💡 改进建议代码示例

// 建议1: 使用更具描述性的对象名称
// 修改前 (auth_single.cpp):
m_lineEdit->setObjectName("LineEdit_2");

// 修改后:
m_lineEdit->setObjectName("AuthSingleLineEdit");

// 建议2: 将 setObjectName 移至循环外部 (controlwidget.cpp)
// 修改前:
while (...) {
    // ... 循环体内
    m_contextMenu->setObjectName("ContextMenu");  // 冗余调用
}

// 修改后:
m_contextMenu->setObjectName("ContextMenu");  // 移至循环外
while (...) {
    // ... 循环体内
}

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

@deepin-bot

deepin-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.0.68
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #548

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