Skip to content

refactor: move ShellSurfaceItemProxy to dock plugin level - #1681

Merged
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:task-392671
Jul 30, 2026
Merged

refactor: move ShellSurfaceItemProxy to dock plugin level#1681
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:task-392671

Conversation

@wjyrich

@wjyrich wjyrich commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

ShellSurfaceItemProxy has been relocated from the tray submodule to the dock plugin level to enable reuse across different dock submodules, including the cardleft plugin. The file is added to dock-plugin QML module and referenced via the org.deepin.ds.dock import.

Log: ShellSurfaceItemProxy moved to dock plugin for cross-submodule sharing

Influence:

  1. Verify tray plugin ShellSurfaceItemProxy still works correctly
  2. Test that the import path change doesn't break existing functionality
  3. Verify quickpanel components load properly with new imports
  4. Test cardleft plugin functionality after enabling it in CMakeLists
  5. Verify no QML module resolution errors occur
  6. Check SPDX license header updates are correct

refactor: 将 ShellSurfaceItemProxy 移至 dock 插件层级

将 ShellSurfaceItemProxy 从 tray 子模块迁移至 dock 插件层级,使其可被 cardleft 等多个子模块复用。文件已添加到 dock-plugin QML 模块,并通过
org.deepin.ds.dock 导入引用。

Log: ShellSurfaceItemProxy 移至 dock 插件以实现跨子模块共享

Influence:

  1. 验证 tray 插件的 ShellSurfaceItemProxy 功能正常
  2. 测试导入路径变更后现有功能未受影响
  3. 验证 quickpanel 组件加载新导入后正常
  4. 测试在 CMakeLists 中启用 cardleft 插件后的功能
  5. 确保无 QML 模块解析错误
  6. 检查 SPDX 许可头部更新是否正确

PMS: TASK-392671

Summary by Sourcery

Move the ShellSurfaceItemProxy QML component from the tray submodule into the shared dock plugin module and update tray quickpanel and delegate usages to import and reference it from org.deepin.ds.dock.

Enhancements:

  • Centralize ShellSurfaceItemProxy in the dock plugin QML module for reuse across dock submodules.
  • Simplify ShellSurfaceItemProxy usage in the tray plugin by referencing it directly instead of via the DDT namespace.
  • Extend SPDX copyright year range in quickpanel QML files.

Build:

  • Register ShellSurfaceItemProxy.qml in the dock-plugin qt_add_qml_module and remove it from the dock-tray module.
  • Keep the cardleft subplugin disabled by commenting out its add_subdirectory entry.

ShellSurfaceItemProxy has been relocated from the tray submodule to
the dock plugin level to enable reuse across different dock submodules,
including the cardleft plugin. The file is added to dock-plugin QML
module and referenced via the org.deepin.ds.dock import.

Log: ShellSurfaceItemProxy moved to dock plugin for cross-submodule
sharing

Influence:
1. Verify tray plugin ShellSurfaceItemProxy still works correctly
2. Test that the import path change doesn't break existing functionality
3. Verify quickpanel components load properly with new imports
4. Test cardleft plugin functionality after enabling it in CMakeLists
5. Verify no QML module resolution errors occur
6. Check SPDX license header updates are correct

refactor: 将 ShellSurfaceItemProxy 移至 dock 插件层级

将 ShellSurfaceItemProxy 从 tray 子模块迁移至 dock 插件层级,使其可被
cardleft 等多个子模块复用。文件已添加到 dock-plugin QML 模块,并通过
org.deepin.ds.dock 导入引用。

Log: ShellSurfaceItemProxy 移至 dock 插件以实现跨子模块共享

Influence:
1. 验证 tray 插件的 ShellSurfaceItemProxy 功能正常
2. 测试导入路径变更后现有功能未受影响
3. 验证 quickpanel 组件加载新导入后正常
4. 测试在 CMakeLists 中启用 cardleft 插件后的功能
5. 确保无 QML 模块解析错误
6. 检查 SPDX 许可头部更新是否正确

PMS: TASK-392671

@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.

Sorry @wjyrich, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

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

Reviewer's Guide

ShellSurfaceItemProxy has been moved from the tray submodule into the shared dock-plugin QML module, with imports and CMakeLists updated so tray/quickpanel and other dock submodules can use it via org.deepin.ds.dock, and SPDX headers refreshed accordingly.

File-Level Changes

Change Details Files
Relocate ShellSurfaceItemProxy into the shared dock-plugin QML module and adjust QML usage accordingly.
  • Move ShellSurfaceItemProxy.qml from the tray submodule path to the top-level dock plugin path.
  • Register ShellSurfaceItemProxy.qml in the dock-plugin qt_add_qml_module so it is exported via the org.deepin.ds.dock QML module.
  • Remove ShellSurfaceItemProxy.qml from the dock-tray qt_add_qml_module QML_FILES list to avoid duplicate registration.
  • Update ActionLegacyTrayPluginDelegate to instantiate ShellSurfaceItemProxy directly instead of via the DDT.ShellSurfaceItemProxy namespaced type.
  • Keep the ShellSurfaceItemProxy implementation logically unchanged aside from minor whitespace cleanup.
panels/dock/ShellSurfaceItemProxy.qml
panels/dock/tray/ShellSurfaceItemProxy.qml
panels/dock/CMakeLists.txt
panels/dock/tray/CMakeLists.txt
panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml
Update imports in tray quickpanel QML files to consume ShellSurfaceItemProxy from the shared dock plugin module.
  • Add import org.deepin.ds.dock 1.0 to quickpanel PluginItem.qml so dock-level items (including ShellSurfaceItemProxy) can be used.
  • Add import org.deepin.ds.dock 1.0 to quickpanel SubPluginPage.qml to access shared dock components.
  • Add import org.deepin.ds.dock 1.0 to quickpanel DragItem.qml for consistency and access to dock-level QML types.
panels/dock/tray/quickpanel/PluginItem.qml
panels/dock/tray/quickpanel/SubPluginPage.qml
panels/dock/tray/quickpanel/DragItem.qml
Adjust build configuration and licensing metadata around the dock and tray modules.
  • Comment out the add_subdirectory(cardleft) line in panels/dock/CMakeLists.txt, likely deferring enabling of the cardleft plugin while keeping the relocation change focused.
  • Extend SPDX-FileCopyrightText years from "2024" to "2024 - 2026" in quickpanel PluginItem.qml and SubPluginPage.qml to reflect ongoing maintenance.
  • Ensure no other functional changes in these files beyond imports and license header updates.
panels/dock/CMakeLists.txt
panels/dock/tray/quickpanel/PluginItem.qml
panels/dock/tray/quickpanel/SubPluginPage.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

★ 总体评分:95分

■ 【总体评价】

代码通过重构模块依赖关系解决了跨模块引用问题,逻辑清晰且符合规范。
逻辑正确且无安全漏洞,因存在遗留的注释代码扣5分。

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

将 ShellSurfaceItemProxy.qml 从 tray 子模块提升至 dock 父级模块,并同步更新 CMakeLists.txt 和相关 QML 文件的导入路径,逻辑完全正确。
潜在问题:无
建议:无

  • 2.代码质量(良好,符合规范)✓

文件移动解决了跨模块依赖,移除了不必要的 DDT. 前缀,使代码更清晰。同时更新了版权年份并清理了行尾空格。
潜在问题:panels/dock/CMakeLists.txt 中新增了 #add_subdirectory(cardleft) 注释代码,若该模块不再使用,保留注释可能造成混淆。
建议:若 cardleft 模块已废弃,建议直接删除该行而非注释保留。

  • 3.代码性能(无性能问题)✓

本次变更仅为文件路径调整和模块归属变更,不涉及运行时逻辑修改,对性能无影响。
潜在问题:无
建议:无

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次变更属于代码重构和配置调整,不涉及外部输入处理、权限校验或敏感信息操作,无安全风险。

  • 建议:无

■ 【改进建议代码示例】

diff --git a/panels/dock/CMakeLists.txt b/panels/dock/CMakeLists.txt
index 16d6aa5e0..7c084ec29 100644
--- a/panels/dock/CMakeLists.txt
+++ b/panels/dock/CMakeLists.txt
@@ -97,6 +97,5 @@ ds_install_package(PACKAGE org.deepin.ds.dock TARGET dockpanel)
 ds_handle_package_translation(PACKAGE org.deepin.ds.dock)
 
 # sub plugins
-#add_subdirectory(cardleft)
 add_subdirectory(showdesktop)
 add_subdirectory(taskmanager)

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@wjyrich
wjyrich merged commit d5d8db5 into linuxdeepin:master Jul 30, 2026
12 of 13 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