fix(authentication): fix background persisting and buttons misalignment after cancel rename#3252
fix(authentication): fix background persisting and buttons misalignment after cancel rename#325252cyb wants to merge 1 commit into
Conversation
…nt after cancel rename Replace manual Rectangle + TextInput with D.LineEdit + D.EditPanel to properly manage alert state, ensuring background resets when rename validation is canceled and buttons stay right-aligned. 替换手动Rectangle+TextInput为D.LineEdit+D.EditPanel,正确管理alert状态,确保取消重命名验证后背景复位,编辑按钮保持右对齐。 Log: 修复取消重命名后背景仍置红及编辑按钮偏左的问题 PMS: 361553 Influence: 1.关闭授权框后背景正确恢复;2.编辑按钮保持右对齐;3.提示文案的显示效果和位置正确。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 52cyb 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 @52cyb. 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 GuideReplaces the custom Rectangle/TextInput-based name editor and tooltip alert handling in AuthenticationMain.qml with D.LineEdit and D.EditPanel, centralizing validation and alert state so that rename cancellations reset the background and keep action buttons aligned. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The alert handling logic (
nameEditPanel.showAlert/alertText) is repeated in several places; consider extracting small helper functions (e.g.clearAlert()andshowValidationError(msg)) to simplify and reduce duplication. - The
checkInputInvalid()function mixes validation and UI side effects (mutatingnameEditPanel), which makes it harder to reuse; consider returning a structured result (e.g.{valid: bool, message: string}) and letting the caller update the UI. - You are resetting
nameEditor.textviaQt.bindingin multiple branches inonEditingFinished; consider factoring this into a helper (e.g.resetToModelData()) to avoid repeating the same binding logic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The alert handling logic (`nameEditPanel.showAlert`/`alertText`) is repeated in several places; consider extracting small helper functions (e.g. `clearAlert()` and `showValidationError(msg)`) to simplify and reduce duplication.
- The `checkInputInvalid()` function mixes validation and UI side effects (mutating `nameEditPanel`), which makes it harder to reuse; consider returning a structured result (e.g. `{valid: bool, message: string}`) and letting the caller update the UI.
- You are resetting `nameEditor.text` via `Qt.binding` in multiple branches in `onEditingFinished`; consider factoring this into a helper (e.g. `resetToModelData()`) to avoid repeating the same binding logic.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TAG Bot New tag: 6.1.89 |
Replace manual Rectangle + TextInput with D.LineEdit + D.EditPanel to properly manage alert state, ensuring background resets when rename validation is canceled and buttons stay right-aligned.
替换手动Rectangle+TextInput为D.LineEdit+D.EditPanel,正确管理alert状态,确保取消重命名验证后背景复位,编辑按钮保持右对齐。
Log: 修复取消重命名后背景仍置红及编辑按钮偏左的问题
PMS: 361553
Influence: 1.关闭授权框后背景正确恢复;2.编辑按钮保持右对齐;3.提示文案的显示效果和位置正确。
Summary by Sourcery
Replace the custom text input rectangle with a D.LineEdit and D.EditPanel-based name editor to fix rename field alert handling and layout behavior in the authentication UI.
Bug Fixes:
Enhancements: