fix: Abnormal behavior when dragging app icons to the tray window#1492
fix: Abnormal behavior when dragging app icons to the tray window#1492deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnsures the tray stashed popup is not closed while the user is hovering a dragged icon over it by incorporating the drop-hover state into existing close conditions. Sequence diagram for tray popup closure with dropHover checksequenceDiagram
actor User
participant Panel
participant TraySortOrderModel
participant closeStashPopupTimer
participant stashedPopup
User->>Panel: startDraggingIcon()
Panel->>stashedPopup: open()
User->>Panel: dragIconOverTray()
Panel->>stashedPopup: setDropHover(true)
TraySortOrderModel-->>Panel: onActionsAlwaysVisibleChanged(val=false)
Panel->>Panel: check !val && !Panel.contextDragging && !stashedPopup.dropHover
alt condition true
Panel->>closeStashPopupTimer: start()
else stashedPopup.dropHover is true
Panel->>closeStashPopupTimer: doNotStart()
end
User->>Panel: dropIconOnTray()
Panel->>stashedPopup: setDropHover(false)
closeStashPopupTimer-->>Panel: onTriggered()
Panel->>Panel: check !Panel.contextDragging && !stashedPopup.dropHover
alt condition true
Panel->>stashedPopup: close()
else still dragging or hover
Panel->>stashedPopup: keepOpen()
end
State diagram for stashedPopup open and close behaviorstateDiagram-v2
[*] --> Closed
Closed --> OpenIdle: open()
Closed --> OpenDropHover: openWithHover()
OpenIdle --> Closed: onActionsAlwaysVisibleChanged && !Panel.contextDragging && !stashedPopup.dropHover
OpenIdle --> Closed: closeStashPopupTimerTriggered && !Panel.contextDragging && !stashedPopup.dropHover
OpenIdle --> OpenDropHover: setDropHoverTrue
OpenDropHover --> OpenIdle: setDropHoverFalse
OpenIdle --> [*]: forceClose()
OpenDropHover --> [*]: forceClose()
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 close conditions for the stash popup are now duplicated in both the signal handler and the timer; consider extracting this into a small helper function or property (e.g.,
shouldCloseStashPopup) to keep the logic consistent and easier to maintain. - Since
dropHoveris now part of the close condition, verify that its state is reliably reset (e.g., on drag leave or drop completion) to avoid cases where the popup may never close ifdropHoverstays true accidentally.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The close conditions for the stash popup are now duplicated in both the signal handler and the timer; consider extracting this into a small helper function or property (e.g., `shouldCloseStashPopup`) to keep the logic consistent and easier to maintain.
- Since `dropHover` is now part of the close condition, verify that its state is reliably reset (e.g., on drag leave or drop completion) to avoid cases where the popup may never close if `dropHover` stays true accidentally.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
log: The `onActionsAlwaysVisibleChanged` signal handler and `closeStashPopupTimer` timer in `tray.qml` failed to check the `stashedPopup.dropHover` state when determining whether to close the panel. This caused the panel to close immediately after drag-and-drop completion. Added a !stashedPopup.dropHover check to the panel closure condition to ensure the closure logic does not trigger while the user is dragging an icon onto the panel area. pms: bug-336185
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, 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 |
deepin pr auto reviewGit Diff 代码审查整体评价这段代码修改主要是对 详细审查1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议
总结这是一个简单但有意义的修改,通过增加对 |
|
/forcemerge |
|
This pr force merged! (status: behind) |
log: The
onActionsAlwaysVisibleChangedsignal handler andcloseStashPopupTimertimer intray.qmlfailed to check thestashedPopup.dropHoverstate when determining whether to close the panel. This caused the panel to close immediately after drag-and-drop completion. Added a !stashedPopup.dropHover check to the panel closure condition to ensure the closure logic does not trigger while the user is dragging an icon onto the panel area.pms: bug-336185
Summary by Sourcery
Bug Fixes: