Skip to content

fix: delay enable taskmanager icon position animation#1526

Merged
BLumia merged 1 commit intolinuxdeepin:masterfrom
BLumia:pms-353933
Mar 24, 2026
Merged

fix: delay enable taskmanager icon position animation#1526
BLumia merged 1 commit intolinuxdeepin:masterfrom
BLumia:pms-353933

Conversation

@BLumia
Copy link
Member

@BLumia BLumia commented Mar 24, 2026

避免一开始就启用动画,导致新图标会有从初始位置(0)飞入的视觉效果

PMS: BUG-353933

Summary by Sourcery

Bug Fixes:

  • Prevent newly added task manager icons from animating in from an incorrect initial position by deferring the start of position animations until after layout completion.

避免一开始就启用动画,导致新图标会有从初始位置(0)飞入的视觉效果

PMS: BUG-353933
Log:
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 24, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Delays enabling position animations for task manager icons so that new icons don’t visually fly in from position 0, by gating x/y Behaviors behind a runtime flag that is turned on after component initialization.

Sequence diagram for delayed enabling of taskmanager icon position animation

sequenceDiagram
    participant QMLRuntime
    participant AppItemRect
    participant Qt
    participant Behaviors

    QMLRuntime->>AppItemRect: Instantiate AppItemRect
    AppItemRect->>AppItemRect: positionAnimationEnabled = false
    AppItemRect->>Behaviors: Behaviors on x,y created (enabled = false)

    QMLRuntime-->>AppItemRect: Component.onCompleted
    AppItemRect->>Qt: Qt.callLater(callback)
    Qt-->>AppItemRect: Invoke callback
    AppItemRect->>AppItemRect: positionAnimationEnabled = true
    AppItemRect->>Behaviors: enabled = true

    QMLRuntime->>AppItemRect: Later change x,y (icon moves)
    AppItemRect->>Behaviors: x,y changed with enabled = true
    Behaviors->>AppItemRect: Animate x,y with NumberAnimation
Loading

Class diagram for TaskManager appItemRect QML object

classDiagram
    class AppItemRect {
        bool positionAnimationEnabled
        onCompleted()
        onXBehavior()
        onYBehavior()
    }

    class NumberAnimationX {
        duration : int = 200
        easingType : EasingType = OutCubic
    }

    class NumberAnimationY {
        duration : int = 200
        easingType : EasingType = OutCubic
    }

    AppItemRect "1" *-- "1" NumberAnimationX : Behavior_on_x
    AppItemRect "1" *-- "1" NumberAnimationY : Behavior_on_y

    class QtHelper {
        callLater(callback)
    }

    AppItemRect ..> QtHelper : uses_callLater
    AppItemRect : positionAnimationEnabled controls Behavior.enabled
    NumberAnimationX : enabled depends_on AppItemRect.positionAnimationEnabled
    NumberAnimationY : enabled depends_on AppItemRect.positionAnimationEnabled
Loading

File-Level Changes

Change Details Files
Gate task manager icon position animations behind a delayed-enable flag to avoid initial fly-in from origin.
  • Assign an id to the transparent Rectangle that mirrors delegateRoot geometry so it can host local state.
  • Add a boolean property to track whether position animations are enabled.
  • Update x and y Behaviors to be conditionally enabled based on the new flag.
  • Use Component.onCompleted with Qt.callLater to enable the flag only after initial layout has stabilized.
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

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@BLumia BLumia merged commit 9ff9858 into linuxdeepin:master Mar 24, 2026
9 of 12 checks passed
@BLumia BLumia deleted the pms-353933 branch March 24, 2026 07:09
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.

4 participants