Skip to content

fix: need request back when embed popup hidden#1116

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
yixinshark:fix-surfaceDestroyed
May 8, 2025
Merged

fix: need request back when embed popup hidden#1116
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
yixinshark:fix-surfaceDestroyed

Conversation

@yixinshark
Copy link
Copy Markdown
Contributor

@yixinshark yixinshark commented May 8, 2025

as title

Log: as title
Pms: BUG-285035

Summary by Sourcery

Bug Fixes:

  • Ensure proper navigation when embed popup is hidden by adding a requestBack() call on surface destruction

@deepin-ci-robot
Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@yixinshark yixinshark marked this pull request as ready for review May 8, 2025 06:33
as title

Log: as title
Pms: BUG-285035
@yixinshark yixinshark force-pushed the fix-surfaceDestroyed branch from 5f55651 to 7c94cc9 Compare May 8, 2025 06:33
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

在提供的代码更改中,主要添加了一个 onSurfaceDestroyed 信号处理程序,当 surfaceLayer 被销毁时调用 requestBack() 方法。以下是对此更改的一些审查意见:

  1. 信号处理程序的有效性

    • 确保 surfaceLayer 确实有 surfaceDestroyed 信号。如果 surfaceLayer 是一个自定义组件,需要确认该组件是否定义了 surfaceDestroyed 信号。
    • 如果 surfaceLayer 是一个标准组件,并且没有 surfaceDestroyed 信号,那么这个更改可能是无效的。
  2. requestBack() 方法的存在性

    • 确认 requestBack() 方法在 SubPluginPage 组件中是定义的。如果该方法不存在,将会导致运行时错误。
  3. 代码可读性

    • onSurfaceDestroyed 信号处理程序中直接调用 requestBack() 可能不够清晰。可以考虑添加注释说明为什么在 surfaceLayer 销毁时需要调用 requestBack()
  4. 性能考虑

    • 如果 requestBack() 方法执行的操作比较耗时,可能会影响性能。需要评估 requestBack() 的执行时间,并确保不会对用户体验产生负面影响。
  5. 错误处理

    • 如果 requestBack() 方法可能会抛出异常,应该考虑在信号处理程序中添加错误处理逻辑,以避免程序崩溃。
  6. 测试

    • 在进行此更改后,应该添加单元测试来验证 onSurfaceDestroyed 信号处理程序的行为是否符合预期。

综上所述,建议在实施此更改之前,确保 surfaceLayer 组件确实有 surfaceDestroyed 信号,并且 requestBack() 方法在 SubPluginPage 组件中是定义的。同时,添加适当的注释和错误处理逻辑,并确保进行充分的测试。

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 8, 2025

Reviewer's Guide

This pull request addresses a bug by ensuring requestBack() is called when the surfaceLayer in SubPluginPage.qml is destroyed. This is implemented by adding an onSurfaceDestroyed signal handler to the surfaceLayer component, which then executes the requestBack() function.

File-Level Changes

Change Details Files
Ensured requestBack() is called upon surface destruction.
  • Added an onSurfaceDestroyed signal handler to the surfaceLayer component.
  • Called requestBack() within the onSurfaceDestroyed handler.
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

Copy link
Copy Markdown

@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 @yixinshark - I've reviewed your changes - here's some feedback:

  • Consider if the new requestBack() on onSurfaceDestroyed might interact or overlap with existing behavior triggered by autoClose: true.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, 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

@yixinshark
Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot
Copy link
Copy Markdown

deepin-bot Bot commented May 8, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 2041ed8 into linuxdeepin:master May 8, 2025
7 of 10 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