Skip to content

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Sep 30, 2025

  1. Added clearButton property to OverlapNotify component for reusability
  2. Implemented clear button functionality in NotifyStaging for individual notification removal
  3. The clear button triggers removal animation and calls remove callback
  4. Maintains existing clean all functionality while adding per-item clear capability

feat: 为通知项添加清除按钮

  1. 在 OverlapNotify 组件中添加 clearButton 属性以提高可重用性
  2. 在 NotifyStaging 中实现单个通知的清除按钮功能
  3. 清除按钮触发移除动画并调用移除回调函数
  4. 保留现有的全部清除功能,同时添加单个项目的清除能力

Pms: BUG-336149

Summary by Sourcery

Introduce a customizable clearButton on notification items to enable per-notification removal while preserving the existing clean-all behavior

New Features:

  • Expose a clearButton property on OverlapNotify for customizable clear actions
  • Add a per-item clear button in NotifyStaging to remove individual notifications with animation and callback

Enhancements:

  • Retain existing clean-all functionality alongside the new per-item clear capability

1. Added clearButton property to OverlapNotify component for reusability
2. Implemented clear button functionality in NotifyStaging for
individual notification removal
3. The clear button triggers removal animation and calls remove callback
4. Maintains existing clean all functionality while adding per-item
clear capability

feat: 为通知项添加清除按钮

1. 在 OverlapNotify 组件中添加 clearButton 属性以提高可重用性
2. 在 NotifyStaging 中实现单个通知的清除按钮功能
3. 清除按钮触发移除动画并调用移除回调函数
4. 保留现有的全部清除功能,同时添加单个项目的清除能力

Pms: BUG-336149
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 30, 2025

Reviewer's Guide

This PR enhances notification components by introducing a reusable clearButton property in OverlapNotify (refactoring its inline usage) and adding a per-item clear button in NotifyStaging to trigger removal animations and callbacks, while retaining the existing bulk-clear capability.

Sequence diagram for individual notification removal via clear button

sequenceDiagram
    actor User
    participant "NotifyStaging"
    participant "OverlapNotify"
    participant "SettingActionButton"
    User->>"SettingActionButton": Click clear button
    "SettingActionButton"->>"OverlapNotify": Trigger removedCallback
    "OverlapNotify"->>"OverlapNotify": Set state to "removing" (animate)
    "OverlapNotify"->>"NotifyStaging": Call remove callback
    "NotifyStaging"->>"NotifyStaging": Remove notification from model
Loading

Class diagram for OverlapNotify and NotifyStaging clearButton changes

classDiagram
    class OverlapNotify {
        +bool enableDismissed
        +var removedCallback
        +Component clearButton
        +signal expand()
    }
    class NotifyStaging {
        +clearButton: SettingActionButton
    }
    OverlapNotify <|-- NotifyStaging: uses
    OverlapNotify o-- AnimationSettingButton: clearButton (previously inline)
    NotifyStaging o-- SettingActionButton: clearButton (per-item)
    AnimationSettingButton <|-- SettingActionButton
Loading

File-Level Changes

Change Details Files
Introduce and leverage a configurable clearButton property in OverlapNotify
  • Add clearButton property with default AnimationSettingButton
  • Encapsulate click handler to set removedCallback and trigger ‘removing’ state
  • Replace inline clearButton declaration with root.clearButton reference
panels/notification/center/OverlapNotify.qml
Implement individual notification clear button in NotifyStaging
  • Add clearButton SettingActionButton with clean-alone icon
  • Wire click handler to set removal callback and animation state on overlapNotify
panels/notification/center/NotifyStaging.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.

@wjyrich wjyrich closed this Sep 30, 2025
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.

1 participant