Skip to content

Conversation

@BLumia
Copy link
Member

@BLumia BLumia commented Aug 6, 2025

将 taskmanager 组件的 item delegate 调整为 Item

这里应该是引入 launcherDndDropArea 之前的逻辑,由每个 item 自己处理被拖拽到图标上后的移动行为。现在应该没有实际再被使用了(拖拽事件会被 launcherDndDropArea 接受并处理,不会到 Item 自己的 DropArea 上),所以直接将其调整回 Item。

Summary by Sourcery

Revert the TaskManager item delegate from DropArea to Item and remove its unused drag-and-drop code.

Chores:

  • Change TaskManager item delegate type from DropArea to Item.
  • Remove unused keys property and onEntered handler now handled by launcherDndDropArea.

将 taskmanager 组件的 item delegate 调整为 Item

Log:
@sourcery-ai
Copy link

sourcery-ai bot commented Aug 6, 2025

Reviewer's Guide

Revert taskmanager item delegate from DropArea to Item and remove obsolete drag-and-drop logic now handled by launcherDndDropArea.

Class diagram for removal of drag-and-drop logic from delegate

classDiagram
    class DropArea {
        onEntered(drag)
    }
    class Item {
        // No onEntered handler
    }
    DropArea : - onEntered(drag)
    Item : // onEntered removed
Loading

File-Level Changes

Change Details Files
Switched item delegate from DropArea back to Item
  • Changed delegate declaration from DropArea to Item
  • Adjusted delegateRoot reference accordingly
panels/dock/taskmanager/package/TaskManager.qml
Removed unused drag-and-drop handlers and properties
  • Deleted keys property for DnD MIME type
  • Removed onEntered handler and its TODO comment
panels/dock/taskmanager/package/TaskManager.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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @BLumia - 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

deepin pr auto review

代码审查意见:

  1. 代码注释

    • onEntered函数中,注释表明该函数实际上未被使用,并且建议将delegateRoot的类型从DropArea更改为Item。建议在代码中添加一个TODO注释,以便以后进行必要的更改。
  2. 代码重构

    • DropArea更改为Item可能会影响拖放功能。如果DropArea是必要的,应该保留它,或者提供替代的拖放处理逻辑。
    • 如果DropArea确实不需要,应该移除相关的代码,以避免混淆。
  3. 性能优化

    • relayoutWorkaroundTimer.start()onCountChanged事件中被调用,如果这个操作是昂贵的,应该考虑是否有必要每次都启动计时器,或者是否有更高效的方式来处理布局变化。
  4. 代码可读性

    • itemId !== taskmanager.Applet.desktopIdToAppId(launcherDndDropArea.launcherDndDesktopId)这行代码可能需要一些注释来解释其目的,以便其他开发者理解。
  5. 安全性

    • 没有明显的安全漏洞,但是确保所有用户输入都经过适当的验证和清理,以防止潜在的注入攻击。
  6. 逻辑一致性

    • 确保所有相关的逻辑都保持一致,特别是如果DropArea被替换为Item,需要确保拖放功能在其他地方得到正确处理。

综上所述,建议在代码中添加必要的注释,并确保所有功能都按照预期工作。如果DropArea被替换为Item,需要确保相关的功能仍然可用,并且没有引入新的问题。

@BLumia BLumia merged commit a60d9fb into linuxdeepin:master Aug 6, 2025
9 of 10 checks passed
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia

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

@BLumia BLumia deleted the tm-delegate-as-item branch August 6, 2025 05:07
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