Skip to content

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Oct 27, 2025

  1. Set modal property to true for NotifySettingMenu
  2. This prevents interaction with other UI elements while menu is open
  3. Improves user experience by focusing attention on the menu
  4. Ensures menu behavior is consistent with other modal dialogs

feat: 为通知设置菜单添加模态属性

  1. 将 NotifySettingMenu 的 modal 属性设置为 true
  2. 防止菜单打开时与其他 UI 元素交互
  3. 通过将注意力集中在菜单上来改善用户体验
  4. 确保菜单行为与其他模态对话框保持一致

PMS: BUG-299885

Summary by Sourcery

New Features:

  • Set the modal property to true on the NotifySettingMenu to block interactions with other UI elements while the menu is open and align its behavior with other modal dialogs

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 27, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR sets the NotifySettingMenu component to modal, preventing background interactions and aligning its behavior with other modal dialogs for a focused user experience.

File-Level Changes

Change Details Files
Enable modal behavior on NotifySettingMenu
  • Add ‘modal: true’ property to the Menu component
panels/notification/center/NotifySettingMenu.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

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

1. Set modal property to true for NotifySettingMenu
2. This prevents interaction with other UI elements while menu is open
3. Improves user experience by focusing attention on the menu
4. Ensures menu behavior is consistent with other modal dialogs

feat: 为通知设置菜单添加模态属性

1. 将 NotifySettingMenu 的 modal 属性设置为 true
2. 防止菜单打开时与其他 UI 元素交互
3. 通过将注意力集中在菜单上来改善用户体验
4. 确保菜单行为与其他模态对话框保持一致

PMS: BUG-299885
@deepin-ci-robot
Copy link

deepin pr auto review

我来对这段代码变更进行审查:

  1. 语法逻辑分析:
  • 在Menu组件中添加了modal: true属性
  • 语法符合QML规范,没有语法错误
  • 这个修改会使菜单变为模态对话框
  1. 代码质量:
  • 优点:
    • 修改简单直接
    • 位置合适,放在了closePolicy属性后面,保持了相关属性的邻近性
  • 改进建议:
    • 建议添加注释说明为什么需要将菜单设置为模态
    • 可以考虑将modal属性与其他属性对齐,保持代码格式统一
  1. 代码性能:
  • 添加modal属性会改变事件处理行为,但性能影响微乎其微
  • 模态对话框会阻止与其他UI元素的交互,这可能会影响用户体验
  1. 代码安全:
  • 模态对话框可以防止用户在菜单打开时与其他UI元素交互,从某种程度上提高了操作的安全性
  • 没有发现明显安全隐患

改进建议:

  1. 添加注释说明设置modal的原因
  2. 考虑添加适当的空行来提高可读性
  3. 保持代码格式统一,建议与其他属性对齐

修改后的建议代码:

Menu {
    id: root

    closePolicy: Popup.CloseOnPressOutside | Popup.CloseOnEscape
    // 设置为模态对话框,确保用户完成菜单操作前无法与其他界面交互
    modal: true

    function toggle()
    {

总体来说,这是一个简单有效的修改,但建议添加适当的注释来说明设计意图。

@wjyrich
Copy link
Contributor Author

wjyrich commented Oct 27, 2025

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Oct 27, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 00073c8 into linuxdeepin:master Oct 27, 2025
9 of 11 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