Skip to content

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

Merged
mhduiy merged 1 commit into
masterfrom
sync-pr-72-nosync
Jul 8, 2026
Merged

sync: from linuxdeepin/dde-session-shell#518
mhduiy merged 1 commit into
masterfrom
sync-pr-72-nosync

Conversation

@deepin-ci-robot

@deepin-ci-robot deepin-ci-robot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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

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

Summary by Sourcery

Enhancements:

  • Ensure password line edit is reset to password echo mode and updates the visibility toggle icon when resetting the auth password widget.

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

Source-pull-request: linuxdeepin/dde-session-shell#72
@sourcery-ai

sourcery-ai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Resets password field behavior to a secure default during auth widget reset and synchronizes icon state with the hidden password state.

Sequence diagram for AuthPassword reset behavior

sequenceDiagram
    participant User
    participant AuthPassword
    participant PasswordLineEdit
    participant PasswordShowBtn

    User->>AuthPassword: reset()
    AuthPassword->>PasswordLineEdit: setAlert(false)
    AuthPassword->>PasswordLineEdit: hideAlertMessage()
    AuthPassword->>PasswordLineEdit: setEchoMode(QLineEdit_Password)
    AuthPassword->>PasswordShowBtn: setIcon(PASSWORD_SHOWN)
    AuthPassword->>AuthPassword: hidePasswordHintWidget()
    AuthPassword->>AuthPassword: setLineEditEnabled(true)
    AuthPassword->>AuthPassword: setLineEditInfo(Password, PlaceHolderText)
Loading

File-Level Changes

Change Details Files
Ensure password field is restored to hidden/secure state on reset and its visibility toggle icon is consistent.
  • Set the password line edit echo mode back to password when reset() is called
  • Update the password visibility button icon to the hidden-password icon during reset
src/session-widgets/auth_password.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 left some high level feedback:

  • In AuthPassword::reset(), double-check that using QLineEdit::Password and the PASSWORD_SHOWN icon together reflects the intended initial state (password hidden vs shown), as the naming suggests a possible mismatch.
  • If there are multiple code paths that initialize or reset the password field’s echo mode and toggle icon, consider centralizing this logic to a single helper to keep the UI state consistent across different flows.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `AuthPassword::reset()`, double-check that using `QLineEdit::Password` and the `PASSWORD_SHOWN` icon together reflects the intended initial state (password hidden vs shown), as the naming suggests a possible mismatch.
- If there are multiple code paths that initialize or reset the password field’s echo mode and toggle icon, consider centralizing this logic to a single helper to keep the UI state consistent across different flows.

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

★ 总体评分:100分

■ 【总体评价】

代码精准修复了密码输入框重置后状态不一致的问题,逻辑清晰且无副作用
四个审查维度均表现优异,无任何扣分项,属于高质量的缺陷修复

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

AuthPassword::reset() 函数中新增的两行代码准确调用了 Qt 的 setEchoMode 接口恢复密码隐藏模式,并通过 setIcon 恢复按钮初始图标状态,完全符合修复意图且无语法错误
建议:保持当前的修复方式,无需额外调整

  • 2.代码质量(良好)✓

新增代码与上下文原有的重置逻辑(如 m_lineEdit->setAlert(false))风格高度一致,位置插入合理,精准弥补了原有逻辑遗漏的 UI 状态重置步骤
建议:保持当前代码简洁性

  • 3.代码性能(高效)✓

仅包含两次简单的属性设置函数调用,属于 O(1) 复杂度的轻量级操作,不涉及任何资源消耗或耗时计算
建议:保持现状

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改实质上消除了原有的密码明文泄露风险,未引入任何新的安全漏洞,无命令注入、内存越界或敏感信息泄露风险
建议:保持当前安全的处理方式

■ 【改进建议代码示例】

diff --git a/src/session-widgets/auth_password.cpp b/src/session-widgets/auth_password.cpp
index 1d6fbe1b..000fec54 100644
--- a/src/session-widgets/auth_password.cpp
+++ b/src/session-widgets/auth_password.cpp
@@ -323,6 +323,8 @@ void AuthPassword::reset()
     m_lineEdit->setAlert(false);
     m_lineEdit->hideAlertMessage();
     setFocusProxy(m_lineEdit);
+    m_lineEdit->setEchoMode(QLineEdit::Password);
+    m_passwordShowBtn->setIcon(QIcon(PASSWORD_SHOWN));
     hidePasswordHintWidget();
     setLineEditEnabled(true);
     setLineEditInfo(tr("Password"), PlaceHolderText);

@mhduiy mhduiy merged commit 31d157a into master Jul 8, 2026
27 of 30 checks passed
@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, mhduiy

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

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.

2 participants