-
Notifications
You must be signed in to change notification settings - Fork 55
fix: prevent duplicate taskbar entries during drag #1206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuidePrevents duplicate taskbar entries by adding a drag source check in TaskManager.qml so that dock requests are only processed for non-taskbar sources. Sequence diagram for drag-and-drop handling between taskbarssequenceDiagram
participant User as actor User
participant TaskbarA as Taskbar (Source)
participant TaskbarB as Taskbar (Target)
participant Applet
User->>TaskbarA: Start drag of app item
TaskbarA->>TaskbarB: Drag event with source info
TaskbarB->>TaskbarB: Check drag source
alt Source is not 'taskbar'
TaskbarB->>Applet: requestDockByDesktopId(desktopId)
Applet-->>TaskbarB: Returns success/failure
alt Failure
TaskbarB->>TaskbarB: resetDndState()
end
else Source is 'taskbar'
TaskbarB->>TaskbarB: Ignore dock request
end
Class diagram for TaskManager drag source checkclassDiagram
class TaskManager {
launcherDndDragSource: string
launcherDndDesktopId: string
+onDragReceived(drag)
}
class Applet {
+requestDockByDesktopId(desktopId: string): bool
}
TaskManager --> Applet: uses
TaskManager : +onDragReceived(drag)
TaskManager : checks launcherDndDragSource != "taskbar" before calling Applet.requestDockByDesktopId
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @wjyrich - I've reviewed your changes - here's some feedback:
- Consider extracting the magic string 'taskbar' into a named constant to avoid hardcoded literals and improve maintainability.
- Refactor the condition block to use an early return when launcherDndDragSource equals 'taskbar' for better readability.
- Ensure launcherDndDragSource cannot be undefined or null before comparison to avoid potential edge-case errors.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the magic string 'taskbar' into a named constant to avoid hardcoded literals and improve maintainability.
- Refactor the condition block to use an early return when launcherDndDragSource equals 'taskbar' for better readability.
- Ensure launcherDndDragSource cannot be undefined or null before comparison to avoid potential edge-case errors.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
1. Added check for drag source before processing dock request 2. Prevents duplicate entries when dragging between taskbars 3. Only processes dock request if source is not another taskbar 4. Maintains clean taskbar state during drag operations fix: 防止拖拽时任务栏出现重复条目 1. 在处理停靠请求前添加了对拖动源的检查 2. 防止在任务栏之间拖拽时出现重复条目 3. 仅当来源不是其他任务栏时才处理停靠请求 4. 在拖拽操作期间保持任务栏状态整洁
4690886 to
d871070
Compare
deepin pr auto review关键摘要:
是否建议立即修改:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, wjyrich 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 |
fix: 防止拖拽时任务栏出现重复条目
Summary by Sourcery
Bug Fixes: