Skip to content

fix: adjust alert tooltip target in authentication UI#2905

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
robertkill:master
Dec 25, 2025
Merged

fix: adjust alert tooltip target in authentication UI#2905
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
robertkill:master

Conversation

@robertkill

@robertkill robertkill commented Dec 25, 2025

Copy link
Copy Markdown
Contributor

Changed the target property of D.AlertToolTip from 'textInputBackground' to 'layout' in authenticationMain.qml. This ensures the alert tooltip is properly positioned relative to the layout container instead of the text input background, improving visual alignment and user experience.

Log: Fixed alert tooltip positioning in authentication interface

Influence:

  1. Verify alert tooltips appear correctly positioned near the layout container
  2. Test authentication flow to ensure tooltips display properly during validation errors
  3. Check visual alignment of tooltips with form elements
  4. Confirm tooltip timeout functionality still works correctly

fix: 调整认证界面中警告提示框的目标元素

将 authenticationMain.qml 中 D.AlertToolTip 的 target 属性从 'textInputBackground' 改为 'layout'。这确保了警告提示框相对于布局容器而 不是文本输入背景正确定位,改善了视觉对齐和用户体验。

Log: 修复认证界面中警告提示框的定位问题

Influence:

  1. 验证警告提示框是否在布局容器附近正确显示
  2. 测试认证流程,确保在验证错误时提示框正常显示
  3. 检查提示框与表单元素的视觉对齐
  4. 确认提示框超时功能仍然正常工作

PMS: BUG-345651

Summary by Sourcery

Bug Fixes:

  • Fix misaligned alert tooltip positioning in the authentication screen by targeting the layout container.

Changed the target property of D.AlertToolTip from 'textInputBackground'
to 'layout' in authenticationMain.qml. This ensures the alert tooltip is
properly positioned relative to the layout container instead of the text
input background, improving visual alignment and user experience.

Log: Fixed alert tooltip positioning in authentication interface

Influence:
1. Verify alert tooltips appear correctly positioned near the layout
container
2. Test authentication flow to ensure tooltips display properly during
validation errors
3. Check visual alignment of tooltips with form elements
4. Confirm tooltip timeout functionality still works correctly

fix: 调整认证界面中警告提示框的目标元素

将 authenticationMain.qml 中 D.AlertToolTip 的 target 属性从
'textInputBackground' 改为 'layout'。这确保了警告提示框相对于布局容器而
不是文本输入背景正确定位,改善了视觉对齐和用户体验。

Log: 修复认证界面中警告提示框的定位问题

Influence:
1. 验证警告提示框是否在布局容器附近正确显示
2. 测试认证流程,确保在验证错误时提示框正常显示
3. 检查提示框与表单元素的视觉对齐
4. 确认提示框超时功能仍然正常工作

PMS: BUG-345651
@sourcery-ai

sourcery-ai Bot commented Dec 25, 2025

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

Reviewer's Guide

Adjusts the D.AlertToolTip target in the authentication QML UI so tooltips are anchored to the layout container instead of the text input background, improving positioning and alignment during validation errors.

Sequence diagram for authentication tooltip targeting

sequenceDiagram
  actor User
  participant LoginForm
  participant TextInput
  participant LayoutContainer
  participant AlertToolTip

  User ->> LoginForm: submitCredentials()
  LoginForm ->> TextInput: validate()
  TextInput -->> LoginForm: validationError
  LoginForm ->> AlertToolTip: setMessage(error)
  LoginForm ->> AlertToolTip: setTarget(LayoutContainer)
  AlertToolTip ->> LayoutContainer: alignToTarget()
  AlertToolTip ->> User: displayTooltip()
  AlertToolTip ->> AlertToolTip: startTimeout(3000)
  AlertToolTip ->> User: hideTooltip()
Loading

File-Level Changes

Change Details Files
Retarget the authentication alert tooltip to the layout container for correct positioning.
  • Change D.AlertToolTip target binding from the text input background element to the enclosing layout item
  • Keep existing timeout and visibility properties unchanged to preserve behavior
  • Limit the modification to the authenticationMain.qml screen where validation error tooltips are shown
src/plugin-authentication/qml/authenticationMain.qml

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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来分析一下这个diff修改:

  1. 修改内容:
    将D.AlertToolTip组件的target属性从textInputBackground改为layout。

  2. 代码质量分析:

  • 这是一个合理的改动。将AlertToolTip的target设置为layout而不是textInputBackground是更好的选择,因为:
    • layout是包含输入框的整个布局区域
    • 这样可以确保提示框在整个输入区域都能正确显示
    • 提供了更大的交互区域,用户体验更好
  1. 潜在改进建议:
    虽然这个改动是合理的,但还可以考虑以下几点:

a) 可访问性改进:

D.AlertToolTip {
    id: alert
    target: layout
    timeout: 3000
    visible: false
    
    // 添加可访问性属性
    Accessible.role: Accessible.Alert
    Accessible.name: text  // 确保提示内容可以被屏幕阅读器读取
}

b) 动画效果优化:

D.AlertToolTip {
    id: alert
    target: layout
    timeout: 3000
    visible: false
    
    // 添加淡入淡出效果
    Behavior on opacity {
        NumberAnimation {
            duration: 200
            easing.type: Easing.InOutQuad
        }
    }
}

c) 位置控制:

D.AlertToolTip {
    id: alert
    target: layout
    timeout: 3000
    visible: false
    
    // 更精确的位置控制
    x: layout.width - width - 10
    y: -height - 5
}
  1. 安全性:
    这个修改主要涉及UI显示,没有直接的安全风险。

  2. 性能影响:
    这个改动对性能影响很小,只是改变了tooltip的目标对象。

总结:
这个修改是一个好的改进,提升了用户体验。建议在后续版本中可以考虑加入上述的优化建议,特别是可访问性相关的改进,以使应用对残障用户更友好。

@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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy, robertkill

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

@robertkill

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Dec 25, 2025

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 13ceb17 into linuxdeepin:master Dec 25, 2025
16 of 18 checks passed
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.

3 participants