Revert "Fix: Optimize tooltip positioning logic."#588
Revert "Fix: Optimize tooltip positioning logic."#588JWWTSL wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
This reverts commit 1d51c87.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL 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 |
|
CLA Assistant Lite bot: You can retrigger this bot by commenting recheck in this Pull Request |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR reverts the previous tooltip optimization by switching AlertToolTip back to a ToolTip-based implementation with explicit enter/exit transitions and restores the prior loader activation behavior in EditPanel, while also updating the SPDX copyright years. Class diagram for reverted AlertToolTip and EditPanel loader behaviorclassDiagram
class ToolTip
class AlertToolTip {
+Item target
+int x
+int y
+int topPadding
+int bottomPadding
+int leftPadding
+int rightPadding
+int implicitWidth
+int implicitHeight
+int margins
+int closePolicy
+Transition enter
+Transition exit
}
class EditPanel {
+bool showAlert
+string alertText
+int alertDuration
}
class Loader {
+bool active
+Component sourceComponent
}
AlertToolTip --|> ToolTip
EditPanel o-- Loader
Loader o-- AlertToolTip
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这份代码变更主要涉及两个QML文件: 1. 代码逻辑与架构重构优点:
潜在风险与改进建议:
2. 代码质量与可读性优点:
改进建议:
3. 代码性能优点:
潜在问题:
4. 代码安全
5. 具体代码细节审查
总结这次重构总体上是正向的,通过继承 主要改进建议:
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Several bindings assume
targetis always non-null (e.g.,implicitWidth: Math.min(..., target.width)and theenter/exittransitions usingcontrol.target.height); consider guarding these with a null check to avoid runtime errors whentargetis not yet set. - Changing
Loader.activeback toshowAlert && alertText.length !== 0will reintroduce the destruction/recreation behavior that the previous comment explicitly worked around; if the original issue (wrong text from the binding context) is still relevant, it might be better to preserve the always-active loader or handle the context problem another way.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Several bindings assume `target` is always non-null (e.g., `implicitWidth: Math.min(..., target.width)` and the `enter`/`exit` transitions using `control.target.height`); consider guarding these with a null check to avoid runtime errors when `target` is not yet set.
- Changing `Loader.active` back to `showAlert && alertText.length !== 0` will reintroduce the destruction/recreation behavior that the previous comment explicitly worked around; if the original issue (wrong text from the binding context) is still relevant, it might be better to preserve the always-active loader or handle the context problem another way.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Reverts #580
Summary by Sourcery
Revert recent tooltip optimization and restore the previous AlertToolTip behavior and usage.
Bug Fixes:
Enhancements: