Skip to content

Conversation

@BLumia
Copy link
Member

@BLumia BLumia commented Apr 15, 2025

修复用户拖拽 dock 调整高度时,dock内元素未居中的问题.

PMS: BUG-312831
Log:

Summary by Sourcery

Fix alignment and sizing issues in the dock panel when resizing

Bug Fixes:

  • Correct dock container sizing by using dock.dockSize instead of Panel.dockSize
  • Ensure tray height is consistent with the dock size when resizing

修复用户拖拽 dock 调整高度时,dock内元素未居中的问题.

PMS: BUG-312831
Log:
@deepin-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@BLumia BLumia marked this pull request as ready for review April 15, 2025 05:36
@sourcery-ai
Copy link

sourcery-ai bot commented Apr 15, 2025

Reviewer's Guide by Sourcery

This pull request fixes an issue where elements within the dock were not correctly aligned when the dock was resized by the user. The primary changes involve correcting the dock container sizing and ensuring the tray height is consistent with the dock size during resizing.

Updated class diagram for Dock and Tray components

classDiagram
  class Dock {
    -dockSize : int
    -useColumnLayout : bool
  }
  class Tray {
    -useColumnLayout : bool
    -implicitHeight : int
    -implicitWidth : int
  }
  class Panel {
    +rootObject : Dock
  }
  Dock -- DockContainer : contains
  Tray -- AppletItem : contains
  AppletItem -- Panel : uses
Loading

File-Level Changes

Change Details Files
Corrected dock container sizing to use dock.dockSize instead of Panel.dockSize.
  • Modified the width property of dockContainer to use dock.dockSize when dock.useColumnLayout is true.
  • Modified the height property of dockContainer to use dock.dockSize when dock.useColumnLayout is false.
panels/dock/package/main.qml
Ensured tray height is consistent with the dock size when resizing.
  • Set trayHeight to Panel.rootObject.dockSize.
panels/dock/tray/package/tray.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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. main.qml文件中,dockContainer的宽度和高度属性修改可能会影响布局的灵活性。建议确认这些修改是否符合预期的布局逻辑,并且不会导致布局问题。

  2. main.qml文件中,dockContainer的宽度属性现在依赖于dock.dockSize,而高度属性依赖于dock.dockSize。如果dock.dockSize的值在运行时可能会改变,这可能会导致布局问题。建议确认dock.dockSize的值在运行时是否稳定,或者是否有必要添加额外的逻辑来处理可能的值变化。

  3. tray.qml文件中,trayHeight属性现在直接从Panel.rootObject.dockSize获取值。这可能会引入对Panel.rootObject的依赖,如果Panel.rootObject的值在运行时可能会改变,这可能会导致布局问题。建议确认Panel.rootObject.dockSize的值在运行时是否稳定,或者是否有必要添加额外的逻辑来处理可能的值变化。

  4. tray.qml文件中,trayHeight属性的计算现在依赖于isHorizontal的值。如果isHorizontal的值在运行时可能会改变,这可能会导致布局问题。建议确认isHorizontal的值在运行时是否稳定,或者是否有必要添加额外的逻辑来处理可能的值变化。

  5. 代码中没有明显的语法或逻辑错误,但是建议添加注释来解释dockContainertrayHeight属性修改的原因,以便其他开发者更容易理解这些更改的目的。

  6. 代码中没有明显的性能问题,但是建议进行性能测试,以确保这些更改不会对应用程序的性能产生负面影响。

  7. 代码中没有明显的安全问题,但是建议进行安全审查,以确保没有引入任何安全漏洞。

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 @BLumia - I've reviewed your changes - here's some feedback:

Overall Comments:

  • It's good to see the bug fix, but the commit message could be improved to be more descriptive.
  • Consider adding a comment explaining why Panel.rootObject.dockSize is used instead of tray.implicitWidth.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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, yixinshark

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 7ed73e9 into linuxdeepin:master Apr 15, 2025
7 of 10 checks passed
@BLumia BLumia deleted the pms-312831 branch April 15, 2025 06:03
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