Skip to content

feat: always show all quick panel plugins#1658

Closed
18202781743 wants to merge 1 commit into
linuxdeepin:masterfrom
18202781743:master
Closed

feat: always show all quick panel plugins#1658
18202781743 wants to merge 1 commit into
linuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743

@18202781743 18202781743 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Remove filtering logic in QuickPanelProxyModel that was hiding plugins
not in the
m_quickPlugins list. This change reverts to showing all available quick
plugins
unconditionally, ensuring no plugins are inadvertently excluded from
the panel.

Influence:

  1. Verify all quick panel plugins are visible in the tray area
  2. Ensure no plugins are missing or incorrectly filtered out
  3. Test with various plugin configurations to confirm consistent display

feat: 始终显示所有快捷面板插件

移除 QuickPanelProxyModel 中的过滤逻辑,该逻辑会隐藏不在 m_quickPlugins
列表中的插件。此修改恢复无条件显示所有可用快捷插件,确保没有插件被意外排
除在面板之外。

Influence:

  1. 验证所有快捷面板插件在托盘区域均可见
  2. 确保没有插件被遗漏或错误过滤
  3. 使用不同插件配置进行测试,确认显示一致性

Summary by Sourcery

Enhancements:

  • Remove QuickPanelProxyModel filtering so that all available quick plugins are displayed unconditionally in the tray quick panel.

Remove filtering logic in QuickPanelProxyModel that was hiding plugins
not in the
m_quickPlugins list. This change reverts to showing all available quick
plugins
unconditionally, ensuring no plugins are inadvertently excluded from
the panel.

Influence:
1. Verify all quick panel plugins are visible in the tray area
2. Ensure no plugins are missing or incorrectly filtered out
3. Test with various plugin configurations to confirm consistent display

feat: 始终显示所有快捷面板插件

移除 QuickPanelProxyModel 中的过滤逻辑,该逻辑会隐藏不在 m_quickPlugins
列表中的插件。此修改恢复无条件显示所有可用快捷插件,确保没有插件被意外排
除在面板之外。

Influence:
1. 验证所有快捷面板插件在托盘区域均可见
2. 确保没有插件被遗漏或错误过滤
3. 使用不同插件配置进行测试,确认显示一致性
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

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

@sourcery-ai

sourcery-ai Bot commented Jul 2, 2026

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

Reviewer's Guide

This PR removes the quick panel plugin whitelisting filter in QuickPanelProxyModel so that all plugins from the source model are always shown in the tray quick panel, regardless of m_quickPlugins content.

Sequence diagram for updated quick panel plugin filtering

sequenceDiagram
    participant SourceModel
    participant QuickPanelProxyModel
    participant TrayQuickPanelView

    TrayQuickPanelView->>QuickPanelProxyModel: filterAcceptsRow(sourceRow, sourceParent)
    QuickPanelProxyModel->>SourceModel: index(sourceRow, 0, sourceParent)
    SourceModel-->>QuickPanelProxyModel: QModelIndex
    alt index is invalid
        QuickPanelProxyModel-->>TrayQuickPanelView: return false
    else index is valid
        QuickPanelProxyModel-->>TrayQuickPanelView: return true
    end
Loading

File-Level Changes

Change Details Files
Remove whitelist-based filtering so the proxy model now accepts all rows from the source model.
  • Simplified QuickPanelProxyModel::filterAcceptsRow to only validate the source index and always return true for valid rows
  • Removed the conditional logic that returned early when m_quickPlugins was empty
  • Removed the check that compared surfacePluginId(index) against m_quickPlugins to decide visibility
panels/dock/tray/quickpanel/quickpanelproxymodel.cpp

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

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

Hey - I've left some high level feedback:

  • With filterAcceptsRow now always returning true, consider whether this proxy model still needs to override it at all, or if the class can rely on the base implementation instead.
  • Now that filtering logic is removed, review whether m_quickPlugins and updateQuickPlugins() (and any related state) are still needed, and clean up any dead code or unused members to keep the model focused on its current behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- With `filterAcceptsRow` now always returning true, consider whether this proxy model still needs to override it at all, or if the class can rely on the base implementation instead.
- Now that filtering logic is removed, review whether `m_quickPlugins` and `updateQuickPlugins()` (and any related state) are still needed, and clean up any dead code or unused members to keep the model focused on its current behavior.

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
Copy Markdown

deepin pr auto review

★ 总体评分:65分

■ 【总体评价】

代码修改导致快速面板过滤功能完全失效,存在致命逻辑错误
逻辑正确但因核心业务判断被彻底删除扣35分

■ 【详细分析】

  • 1.语法逻辑存在致命错误✕
    在 quickpanelproxymodel.cpp 的 filterAcceptsRow 函数中,修改后的代码在 index.isValid() 校验通过后直接返回 true,彻底移除了基于 m_quickPlugins 列表和 surfacePluginId 的过滤判断逻辑,导致 QSortFilterProxyModel 失去过滤能力。
    潜在问题:所有托盘插件都会穿透过滤模型显示在快速面板中;用户自定义的快速插件配置完全失效
    建议:恢复原有的 m_quickPlugins.isEmpty() 判断及 m_quickPlugins.contains(id) 的核心过滤逻辑
  • 2.代码质量存在严重问题✕
    删除了关键的配置控制代码却未添加任何注释说明,属于典型的误删或调试代码未清理。破坏了原有代码的完整性和业务语义。
    潜在问题:代码意图不明确,容易误导后续维护人员
    建议:在提交前进行严格的代码比对和业务逻辑验证,确保无意义的代码删除不被合入
  • 3.代码性能无性能问题✓
    虽然移除了 contains 查询,表面上减少了哈希表查询开销,但由于功能完全错误,性能提升毫无意义。
    建议:在保证功能正确的前提下优化性能
  • 4.代码安全存在0个安全漏洞✓
    漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
    本次修改未引入命令注入、内存越界、权限绕过等传统安全漏洞,属于纯业务逻辑层面的功能破坏。
  • 建议:无需针对安全漏洞进行修复,重点恢复业务逻辑

■ 【改进建议代码示例】

diff --git a/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp b/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp
index 67fb874fd..4ad8ef62b 100644
--- a/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp
+++ b/panels/dock/tray/quickpanel/quickpanelproxymodel.cpp
@@ -118,7 +118,10 @@ bool QuickPanelProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &so
     const auto index = this->sourceModel()->index(sourceRow, 0, sourceParent);
     if (!index.isValid())
         return false;
-    return true;
+    if (m_quickPlugins.isEmpty())
+        return true;
+    const auto &id = surfacePluginId(index);
+    return m_quickPlugins.contains(id);
 }
 
 void QuickPanelProxyModel::updateQuickPlugins()

@deepin-ci-robot

Copy link
Copy Markdown

@18202781743: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
github-pr-review-ci e56f02a link true /test github-pr-review-ci

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@18202781743 18202781743 closed this Jul 3, 2026
@18202781743

Copy link
Copy Markdown
Contributor Author

有过滤功能,它还是个白名单

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.

2 participants