Skip to content

fix: fix notification bubble animation glitch#1537

Open
mhduiy wants to merge 1 commit intolinuxdeepin:masterfrom
mhduiy:animation
Open

fix: fix notification bubble animation glitch#1537
mhduiy wants to merge 1 commit intolinuxdeepin:masterfrom
mhduiy:animation

Conversation

@mhduiy
Copy link
Copy Markdown
Contributor

@mhduiy mhduiy commented Mar 30, 2026

  1. Replaced the previous complex ScriptAction with a simpler PropertyAnimation for the add transition
  2. Added a new addDisplaced transition to handle displaced items when new notifications are added
  3. Removed the manual script that forced previous bubble animations to complete, which was causing visual glitches
  4. Now uses standard Qt Quick transitions for smoother and more reliable animation behavior

fix: 修复通知气泡动画显示问题

  1. 将之前复杂的 ScriptAction 替换为更简单的 PropertyAnimation 来处理添加 动画
  2. 新增 addDisplaced 过渡动画来处理新通知添加时其他气泡的位移
  3. 移除了强制完成前一个气泡动画的手动脚本,该脚本会导致视觉故障
  4. 现在使用标准的 Qt Quick 过渡动画来实现更平滑可靠的动画效果

PMS: BUG-355029

Summary by Sourcery

Simplify and standardize notification bubble list transitions to fix animation glitches when new notifications are added.

Bug Fixes:

  • Resolve visual glitches caused by forcibly completing previous notification bubble animations when adding new notifications.

Enhancements:

  • Replace the previous ScriptAction and XAnimator-based add transition with a single PropertyAnimation-based transition for smoother bubble entry.
  • Introduce an addDisplaced transition using PropertyAnimation to smoothly reposition existing bubbles when new notifications are inserted.

1. Replaced the previous complex ScriptAction with a simpler
PropertyAnimation for the add transition
2. Added a new addDisplaced transition to handle displaced items when
new notifications are added
3. Removed the manual script that forced previous bubble animations to
complete, which was causing visual glitches
4. Now uses standard Qt Quick transitions for smoother and more reliable
animation behavior

fix: 修复通知气泡动画显示问题

1. 将之前复杂的 ScriptAction 替换为更简单的 PropertyAnimation 来处理添加
动画
2. 新增 addDisplaced 过渡动画来处理新通知添加时其他气泡的位移
3. 移除了强制完成前一个气泡动画的手动脚本,该脚本会导致视觉故障
4. 现在使用标准的 Qt Quick 过渡动画来实现更平滑可靠的动画效果

PMS: BUG-355029
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 30, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors the notification bubble list add animation to use standard Qt Quick PropertyAnimation transitions, and adds a dedicated addDisplaced transition to smoothly reposition existing bubbles when new notifications are inserted, removing the previous manual ScriptAction hack that caused glitches.

Sequence diagram for updated notification bubble add animation

sequenceDiagram
    actor User
    participant App
    participant NotificationModel
    participant bubbleView
    participant addTrans
    participant addDisplacedTrans

    User->>App: Triggers event that creates notification
    App->>NotificationModel: appendNotification()
    NotificationModel-->>bubbleView: modelUpdated (new item)
    bubbleView->>addTrans: start add Transition
    activate addTrans
    addTrans->>addTrans: PropertyAnimation on item.x
    addTrans-->>bubbleView: item slides in from width to 0
    deactivate addTrans

    bubbleView->>addDisplacedTrans: start addDisplaced Transition
    activate addDisplacedTrans
    addDisplacedTrans->>addDisplacedTrans: PropertyAnimation on displaced items x
    addDisplacedTrans-->>bubbleView: existing bubbles reposition smoothly
    deactivate addDisplacedTrans
Loading

File-Level Changes

Change Details Files
Replace custom ScriptAction/XAnimator-based add animation with a simple PropertyAnimation on x.
  • Remove the ScriptAction that forcibly completes the previous bubble’s animation by setting its x position to 0.
  • Replace the XAnimator used in the add Transition with a PropertyAnimation targeting the added item’s x property.
  • Animate the added item from its own width to x = 0 over 600ms with an OutExpo easing curve.
panels/notification/bubble/package/main.qml
Introduce an addDisplaced Transition to smoothly animate repositioned bubbles when new notifications are added.
  • Add an addDisplaced Transition block on the ListView to handle displacement of existing items.
  • Within addDisplaced, add a PropertyAnimation targeting the displaced item’s x property, animating it to 0.
  • Use the same 600ms OutExpo easing as the add animation for consistent motion between added and displaced bubbles.
panels/notification/bubble/package/main.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 - 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
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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