Skip to content

fix: remove scale and opacity animations from task manager transitions#1475

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
wjyrich:fix-animation
Mar 4, 2026
Merged

fix: remove scale and opacity animations from task manager transitions#1475
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
wjyrich:fix-animation

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Mar 4, 2026

Removed scale and opacity animations from the add, addDisplaced, and removeDisplaced transitions in the task manager QML file. These animations were causing visual glitches and performance issues when tasks were added, moved, or removed from the taskbar. The position animations (x,y) with easing are preserved to maintain smooth movement transitions while eliminating the problematic scaling and fading effects that were not working correctly.

Influence:

  1. Test adding new tasks to the taskbar to ensure smooth appearance without visual glitches
  2. Test moving tasks around in the taskbar to verify smooth repositioning
  3. Test removing tasks from the taskbar to confirm clean disappearance
  4. Verify overall task manager performance during task operations
  5. Check that task icons maintain proper visual state during all transitions

fix: 移除任务管理器过渡动画中的缩放和透明度效果

从任务管理器QML文件的添加、添加时位移和移除时位移过渡动画中移除了缩放和
透明度动画。这些动画在任务被添加到任务栏、移动或移除时会导致视觉故障和性
能问题。保留了带有缓动效果的位置动画(x,y)以维持平滑的移动过渡,同时消
除了工作不正确的缩放和淡入淡出效果。

Influence:

  1. 测试向任务栏添加新任务,确保平滑显示且无视觉故障
  2. 测试在任务栏中移动任务,验证平滑重新定位
  3. 测试从任务栏移除任务,确认干净的消失效果
  4. 验证任务操作期间任务管理器的整体性能
  5. 检查任务图标在所有过渡期间是否保持正确的视觉状态

Summary by Sourcery

Remove problematic scale and opacity animations from task manager item transitions to improve visual stability and performance.

Bug Fixes:

  • Eliminate scale animations from task addition and displacement transitions that caused visual glitches.
  • Remove opacity fade animations from task addition and displacement transitions to prevent rendering issues.

Removed scale and opacity animations from the add, addDisplaced,
and removeDisplaced transitions in the task manager QML file. These
animations were causing visual glitches and performance issues when
tasks were added, moved, or removed from the taskbar. The position
animations (x,y) with easing are preserved to maintain smooth movement
transitions while eliminating the problematic scaling and fading effects
that were not working correctly.

Influence:
1. Test adding new tasks to the taskbar to ensure smooth appearance
without visual glitches
2. Test moving tasks around in the taskbar to verify smooth
repositioning
3. Test removing tasks from the taskbar to confirm clean disappearance
4. Verify overall task manager performance during task operations
5. Check that task icons maintain proper visual state during all
transitions

fix: 移除任务管理器过渡动画中的缩放和透明度效果

从任务管理器QML文件的添加、添加时位移和移除时位移过渡动画中移除了缩放和
透明度动画。这些动画在任务被添加到任务栏、移动或移除时会导致视觉故障和性
能问题。保留了带有缓动效果的位置动画(x,y)以维持平滑的移动过渡,同时消
除了工作不正确的缩放和淡入淡出效果。

Influence:
1. 测试向任务栏添加新任务,确保平滑显示且无视觉故障
2. 测试在任务栏中移动任务,验证平滑重新定位
3. 测试从任务栏移除任务,确认干净的消失效果
4. 验证任务操作期间任务管理器的整体性能
5. 检查任务图标在所有过渡期间是否保持正确的视觉状态
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 4, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR simplifies the task manager’s QML transitions by removing scale and opacity NumberAnimations from add, addDisplaced, and removeDisplaced transitions, leaving only position (x,y) animations with easing to avoid visual glitches and improve performance.

Flow diagram for updated TaskManager QML transitions without scale and opacity

flowchart TD
  A["Task_added_to_model"] --> B["add_transition_triggered"]
  B --> C["NumberAnimation_for_position_x_y_with_Easing_OutQuad"]
  C --> D["Task_icon_visible_with_default_scale_and_opacity"]

  E["Task_repositioned_in_model"] --> F["addDisplaced_or_moveDisplaced_transition_triggered"]
  F --> G["NumberAnimation_for_position_x_y_with_Easing_OutQuad"]
  G --> H["Task_icons_reordered_smoothly"]

  I["Task_removed_from_model"] --> J["removeDisplaced_transition_triggered"]
  J --> K["NumberAnimation_for_position_x_y_with_Easing_OutQuad"]
  K --> L["Task_icon_removed_without_extra_visual_effects"]

  subgraph Removed_animations_in_this_PR
    M["NumberAnimation_for_scale"]
    N["NumberAnimation_for_opacity"]
  end

  B -.no_longer_present.-> M
  B -.no_longer_present.-> N
  F -.no_longer_present.-> M
  F -.no_longer_present.-> N
  J -.no_longer_present.-> M
  J -.no_longer_present.-> N
Loading

File-Level Changes

Change Details Files
Remove scale and opacity animations from task manager item transitions while keeping position animations intact.
  • Deleted scale NumberAnimation blocks from add, addDisplaced, and removeDisplaced transitions
  • Deleted opacity NumberAnimation blocks from add, addDisplaced, and removeDisplaced transitions
  • Retained existing x,y NumberAnimation with Easing.OutQuad to preserve smooth positional movement
panels/dock/taskmanager/package/TaskManager.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 - 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

这段代码修改主要涉及 QML 中的 Transition(过渡动画)部分,具体是移除了针对 scale(缩放)和 opacity(不透明度)的动画效果。

以下是对该 diff 的详细审查和改进意见:

1. 语法逻辑审查

  • 审查结果通过
  • 分析:代码移除了 addaddDisplacedremoveDisplaced 这三个 Transition 中的 NumberAnimation 块。移除后的代码结构完整,保留了 xy 属性的 NumberAnimation,语法上没有错误,符合 QML 规范。

2. 代码质量审查

  • 审查结果良好,但有优化空间
  • 分析
    • 去重:代码成功删除了三处重复的动画定义块(scale 和 opacity),使得 Transition 逻辑更加清晰,减少了冗余代码。
    • 代码一致性:修改后,addaddDisplacedremoveDisplaced 三个 Transition 的结构保持一致,都仅包含位置变化的动画,提高了代码的可维护性。
    • 潜在问题:虽然移除了显式的动画定义,但并未看到为 delegate(委托项)设置默认的 scaleopacity 行为。如果委托项本身没有定义 Behavior,那么这些属性的突变可能会显得生硬。

3. 代码性能审查

  • 审查结果提升
  • 分析
    • 渲染开销scaleopacity 的变化通常会触发 GPU 的重绘或合成操作。移除这些动画意味着在列表项添加、移除或位置变动时,系统不再需要计算和渲染额外的缩放和淡入淡出效果,从而降低了 CPU 和 GPU 的负载。
    • 动画平滑度:在任务栏这种高频更新的场景下,减少并发动画数量有助于确保位置移动动画(x, y)的流畅度,避免因动画过多导致的掉帧。

4. 代码安全审查

  • 审查结果无影响
  • 分析:此改动仅涉及 UI 表现层,不涉及数据处理、权限控制或网络安全,因此没有引入安全风险。

综合改进建议

虽然移除动画可以提升性能,但可能会影响用户体验(UI 变得不够生动)。为了平衡性能和视觉效果,建议考虑以下改进方案:

建议 1:使用 Behavior 替代 Transition(推荐)
如果希望保留一定的视觉反馈,但不希望在每个 Transition 中重复定义,可以在 Delegate(委托项)内部使用 Behavior。这样属性变化时会自动应用动画,且代码更集中。

// 在 Delegate 组件内部
Rectangle { // 或其他委托项根元素
    id: delegateRoot
    
    // 默认状态
    scale: 1
    opacity: 1
    
    // 定义行为:当 scale 或 opacity 改变时,自动应用动画
    Behavior on scale {
        NumberAnimation { duration: 200; easing.type: Easing.OutQuad }
    }
    
    Behavior on opacity {
        NumberAnimation { duration: 200; easing.type: Easing.OutQuad }
    }
    
    // ... 其他内容
}

建议 2:确认移除的必要性
请确认移除 scaleopacity 动画是否是刻意为之。如果是为了解决特定的性能卡顿问题,那么当前修改是正确的。如果是为了简化代码而移除,建议保留 opacity(淡入淡出)动画,因为透明度变化通常比缩放变化更不消耗资源,且视觉上更柔和。

总结
这段代码修改在逻辑和语法上是正确的,能够有效减少渲染开销,提升性能。主要的风险在于 UI 交互的生硬感。如果应用对性能极其敏感(如嵌入式设备或低配 PC),当前修改是合理的优化;如果追求更好的视觉体验,建议采用 Behavior 的方式来管理属性动画。

@wjyrich
Copy link
Contributor Author

wjyrich commented Mar 4, 2026

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Mar 4, 2026

This pr force merged! (status: unknown)

@deepin-bot deepin-bot bot merged commit de66b91 into linuxdeepin:master Mar 4, 2026
11 of 12 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