Skip to content

fix: when debug, delete the warning logs.#568

Merged
BLumia merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-warn-1
May 21, 2025
Merged

fix: when debug, delete the warning logs.#568
BLumia merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-warn-1

Conversation

@wjyrich
Copy link
Copy Markdown
Contributor

@wjyrich wjyrich commented May 21, 2025

as title

Log: delete warning logs

Summary by Sourcery

Refine QML event handlers and view behaviors to improve event argument handling, conditional view resets, and drag positioning.

Bug Fixes:

  • Prevent resetViewState from running when in FreeCategory to avoid unintended resets
  • Center the drag hotspot horizontally by using width/2 for Drag.hotSpot.x

Enhancements:

  • Convert onWheel, onClicked, and Keys.onPressed handlers to explicit function syntax for proper event argument handling

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 21, 2025

Reviewer's Guide

This PR refactors event handlers to explicit function definitions for parameter access, adds a conditional guard in resetViewState to exclude a specific category, and corrects the drag hotspot x-coordinate for proper centering.

Sequence Diagram for Conditional resetViewState Logic

sequenceDiagram
    participant C as Caller
    participant AL as AppList
    participant CSPM as CategorizedSortProxyModel
    participant LI as loader.item

    C->>AL: resetViewState()
    activate AL
    AL->>CSPM: get categoryType
    activate CSPM
    CSPM-->>AL: categoryType
    deactivate CSPM
    alt categoryType is NOT FreeCategory
        AL->>LI: resetViewState()
        activate LI
        LI-->>AL: 
        deactivate LI
    end
    AL-->>C: 
    deactivate AL
Loading

File-Level Changes

Change Details Files
Refactored anonymous event handlers to explicit functions to accept event parameters
  • Converted onWheel handler to function(wheel)
  • Converted onClicked handler to function(mouse)
  • Converted Keys.onPressed handler to function(event)
qml/FullscreenFrame.qml
Conditional reset of view state based on category type
  • Wrapped loader.item.resetViewState() in an if-check to skip FreeCategory
qml/windowed/AppList.qml
Adjusted drag hotspot horizontal centering
  • Replaced Drag.hotSpot.x assignment from Drag.hotSpot.y to width/2
qml/windowed/AppListView.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 @wjyrich - I've reviewed your changes and they look great!

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.

Comment thread qml/windowed/AppList.qml Outdated
as title

Log: delete warning logs
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

代码审查意见:

  1. FullscreenFrame.qml 文件中,onWheelonClicked 事件处理函数被重写为匿名函数,这有助于提高代码的可读性和可维护性。建议保持这种做法,并在函数内部添加注释来解释事件处理逻辑。

  2. FullscreenFrame.qml 文件中,Keys.onPressed 事件处理函数被重写为匿名函数,这同样有助于提高代码的可读性和可维护性。建议保持这种做法,并在函数内部添加注释来解释事件处理逻辑。

  3. windowed/AppList.qml 文件中,resetViewState 函数增加了对 CategorizedSortProxyModel.categoryType 的检查,这是一个好的做法,可以避免在不需要的情况下调用 resetViewState 函数,从而提高性能。

  4. windowed/AppListView.qml 文件中,Drag.hotSpot.x 的值被设置为 width / 2,这是一个好的做法,可以确保拖动热点的位置在元素的中心,从而提高用户体验。

  5. windowed/AppListView.qml 文件中,Drag.hotSpot.x 的值被设置为 Drag.hotSpot.y,这可能会导致拖动热点的位置不正确,建议将其设置为 width / 2

  6. 在所有修改的文件中,建议添加适当的注释来解释代码的意图和功能,这有助于其他开发者理解代码的上下文和逻辑。

  7. 在所有修改的文件中,建议使用一致的代码风格和命名约定,以提高代码的可读性和可维护性。

  8. 在所有修改的文件中,建议进行充分的单元测试,以确保代码的正确性和稳定性。

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, 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 0747c96 into linuxdeepin:master May 21, 2025
7 of 10 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