Skip to content

Conversation

@yixinshark
Copy link
Contributor

@yixinshark yixinshark commented Sep 19, 2025

when contextDragging is true, do not close the popup.

Log: as title
Pms: BUG-288747,BUG-288737

Summary by Sourcery

Bug Fixes:

  • Only trigger the stash popup close timer and close the popup directly when contextDragging is false to stop unwanted hiding during drags

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 19, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduced contextDragging checks to the popup close logic so that the tray popup remains open when items are being dragged.

File-Level Changes

Change Details Files
Add contextDragging guard to the popup-close timer trigger logic
  • Augmented the onActionsAlwaysVisibleChanged handler to only start closeStashPopupTimer when Panel.contextDragging is false.
panels/dock/tray/package/tray.qml
Wrap stashedPopup.close() in a contextDragging check
  • Embedded the stashedPopup.close() call inside an if-condition to skip closure during drag operations.
panels/dock/tray/package/tray.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 there - 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. 逻辑改进:
  • 原代码在 onActionsAlwaysVisibleChanged 事件处理中只检查了 val
  • 新增了对 Panel.contextDragging 的检查,防止在面板拖动时意外关闭弹出窗口
  • 同样在定时器触发时也增加了对 Panel.contextDragging 的检查
  1. 潜在问题:
  • 代码中使用了 Panel.contextDragging 变量,但没有看到这个变量的定义和更新逻辑,需要确保这个变量在面板拖动时能正确设置
  • 定时器的间隔只有10ms,可能过于频繁,如果系统性能不佳可能导致卡顿
  1. 改进建议:
  • 建议增加对 Panel.contextDragging 变量的定义和更新逻辑的注释,说明其作用和使用场景
  • 可以考虑将定时器间隔适当调大一些,比如50ms或100ms,以减少性能开销
  • 建议添加错误处理机制,比如在访问 Panel.contextDragging 时进行空值检查
  • 可以考虑将 Panel.contextDragging 的检查提取为一个单独的函数,提高代码可读性和可维护性
  1. 代码质量:
  • 当前的修改提高了代码的健壮性,避免了在面板拖动时的不必要操作
  • 逻辑更加清晰,但可以进一步优化结构
  1. 性能考虑:
  • 虽然增加了条件判断,但避免了不必要的关闭操作,实际上可能提高了性能
  • 定时器的间隔可以考虑根据实际需求调整

总体来说,这是一个合理的改进,增强了代码的健壮性,但建议补充一些文档说明和错误处理机制。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

when contextDragging is true, do not close the popup.

Log: as title
Pms: BUG-288747
@yixinshark
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Sep 22, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit dd9dfb7 into linuxdeepin:master Sep 22, 2025
6 of 8 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