Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Feb 12, 2026

  1. Changed visibility control from visible property to opacity
    property in AppListView.qml and FreeSortListView.qml
  2. This prevents drag interruption when items are hidden during drag
    operations
  3. The issue occurred because setting visible: false during drag would
    interrupt the drag gesture on touchscreens
  4. Using opacity instead maintains the visual hiding effect while
    keeping the item technically visible to the touch system

Log: Fixed touchscreen drag issue where dragging would abnormally
interrupt when items were hidden

Influence:

  1. Test touchscreen drag operations on both app list and free sort views
  2. Verify that dragging items no longer interrupts when items become
    hidden
  3. Check that visual appearance during drag is correct (items should be
    invisible but not disrupt drag)
  4. Test mouse drag operations to ensure they still work correctly
  5. Verify that tooltips and other interactive features still function
    properly

fix: 修复触摸屏拖拽时隐藏项导致的问题

  1. 在 AppListView.qml 和 FreeSortListView.qml 中将可见性控制从 visible
    属性改为 opacity 属性
  2. 这防止了在拖拽操作期间隐藏项目时拖拽被中断的问题
  3. 问题发生在拖拽过程中设置 visible: false 会中断触摸屏上的拖拽手势
  4. 使用透明度替代可以保持视觉隐藏效果,同时让项目在触摸系统中保持技术上
    的可见性

Log: 修复了触摸屏拖拽问题,当项目隐藏时拖拽不再异常中断

Influence:

  1. 测试应用列表和自由排序视图上的触摸屏拖拽操作
  2. 验证拖拽项目时不再因项目隐藏而中断
  3. 检查拖拽期间的视觉外观是否正确(项目应不可见但不中断拖拽)
  4. 测试鼠标拖拽操作确保仍能正常工作
  5. 验证工具提示和其他交互功能是否仍能正常使用

PMS: BUG-346077

Summary by Sourcery

Bug Fixes:

  • Ensure list items remain draggable on touchscreens even when visually hidden during drag operations in AppListView and FreeSortListView.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

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 Feb 12, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces visibility toggling with opacity changes for list item labels during drag operations in touchscreen contexts to prevent drag interruption while preserving the visual hiding behavior and existing interactions.

Sequence diagram for touchscreen drag interaction with opacity-based hiding

sequenceDiagram
    actor User
    participant Touchscreen
    participant AppListView
    participant ListItem
    participant DragHandler

    User->>Touchscreen: touchDown on list item
    Touchscreen->>AppListView: emitPressEvent
    AppListView->>ListItem: startDrag
    ListItem->>DragHandler: Drag.active = true

    Note over ListItem,DragHandler: New behavior using opacity
    DragHandler->>ListItem: updateDragState
    ListItem->>ListItem: set opacity = 0 (item visually hidden)
    Touchscreen->>DragHandler: continueDragEvents
    DragHandler->>AppListView: updateItemPosition

    User-->>Touchscreen: touchMove continues
    Touchscreen->>DragHandler: dragMove events uninterrupted

    User-->>Touchscreen: touchRelease
    Touchscreen->>DragHandler: dragEnd
    DragHandler->>ListItem: Drag.active = false
    ListItem->>ListItem: set opacity = 1 (item visible)

    Note over Touchscreen,DragHandler: Drag gesture remains active because item stays visible to input system
Loading

File-Level Changes

Change Details Files
Switch label hiding during drag from the visible property to opacity so touch drags are not interrupted while items appear hidden.
  • In the app list item delegate, replace visible: !Drag.active with opacity: !Drag.active ? 1 : 0 to keep the label logically present but visually hidden while dragging.
  • In the free-sort list item delegate, replace the combined visible condition with an equivalent opacity expression, preserving the existing conditions for when the label should appear while avoiding touch gesture cancellation.
qml/windowed/AppListView.qml
qml/windowed/FreeSortListView.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 left some high level feedback:

  • Switching from visible to opacity means these controls are still hit-testable when fully transparent; consider explicitly tying enabled/hoverEnabled (and tooltip activation if needed) to the same condition so invisible labels don’t unexpectedly receive input.
  • The previous visible: false also removed these items from layout/size calculations, while opacity: 0 does not; double-check any anchoring or implicit size dependencies and, if necessary, gate layout-affecting properties (like Layout.* or implicitHeight) on the same condition used for opacity.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Switching from `visible` to `opacity` means these controls are still hit-testable when fully transparent; consider explicitly tying `enabled`/`hoverEnabled` (and tooltip activation if needed) to the same condition so invisible labels don’t unexpectedly receive input.
- The previous `visible: false` also removed these items from layout/size calculations, while `opacity: 0` does not; double-check any anchoring or implicit size dependencies and, if necessary, gate layout-affecting properties (like `Layout.*` or `implicitHeight`) on the same condition used for opacity.

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.

1. Changed visibility control from `visible` property to `opacity`
property in AppListView.qml and FreeSortListView.qml
2. This prevents drag interruption when items are hidden during drag
operations
3. The issue occurred because setting `visible: false` during drag would
interrupt the drag gesture on touchscreens
4. Using opacity instead maintains the visual hiding effect while
keeping the item technically visible to the touch system

Log: Fixed touchscreen drag issue where dragging would abnormally
interrupt when items were hidden

Influence:
1. Test touchscreen drag operations on both app list and free sort views
2. Verify that dragging items no longer interrupts when items become
hidden
3. Check that visual appearance during drag is correct (items should be
invisible but not disrupt drag)
4. Test mouse drag operations to ensure they still work correctly
5. Verify that tooltips and other interactive features still function
properly

fix: 修复触摸屏拖拽时隐藏项导致的问题

1. 在 AppListView.qml 和 FreeSortListView.qml 中将可见性控制从 `visible`
属性改为 `opacity` 属性
2. 这防止了在拖拽操作期间隐藏项目时拖拽被中断的问题
3. 问题发生在拖拽过程中设置 `visible: false` 会中断触摸屏上的拖拽手势
4. 使用透明度替代可以保持视觉隐藏效果,同时让项目在触摸系统中保持技术上
的可见性

Log: 修复了触摸屏拖拽问题,当项目隐藏时拖拽不再异常中断

Influence:
1. 测试应用列表和自由排序视图上的触摸屏拖拽操作
2. 验证拖拽项目时不再因项目隐藏而中断
3. 检查拖拽期间的视觉外观是否正确(项目应不可见但不中断拖拽)
4. 测试鼠标拖拽操作确保仍能正常工作
5. 验证工具提示和其他交互功能是否仍能正常使用

PMS: BUG-346077
@deepin-ci-robot
Copy link

deepin pr auto review

这段代码变更主要涉及两个QML文件的修改,包括版权年份的更新和拖拽交互逻辑的调整。以下是对代码变更的详细审查意见:

1. 版权年份更新

变更内容:将两个文件的版权年份范围从单一年份扩展为年份范围(2023-2026 和 2024-2026)。
审查意见

  • 语法逻辑:符合SPDX许可证头部的标准格式,语法正确。
  • 代码质量:更新版权年份范围是良好的维护实践,表明项目将持续维护至2026年。
  • ⚠️ 建议:确保所有相关文件的版权年份同步更新,避免不一致。

2. 拖拽交互逻辑调整(AppListView.qmlFreeSortListView.qml

变更内容:将拖拽时的隐藏方式从 visible 属性改为 opacity 属性。

  • 原代码visible: !Drag.active
  • 新代码opacity: !Drag.active ? 1 : 0

审查意见

  • 语法逻辑:语法正确,三元表达式逻辑清晰。
  • 代码质量:使用 opacity 替代 visible 可以提供更平滑的视觉过渡效果(尤其是配合 Behavior on opacity 时),提升用户体验。
  • 代码性能opacity 的性能开销略高于 visible(因为 visible 会完全跳过渲染),但在现代设备上差异可忽略不计。如果列表项数量极大(如上千项),需评估性能影响。
  • ⚠️ 代码安全:需注意以下潜在问题:
    1. 交互性残留opacity: 0 的元素仍然可以接收鼠标/触摸事件。如果用户在拖拽过程中误触透明区域,可能触发意外行为。建议结合 enabled: !Drag.active 禁用交互:
      opacity: !Drag.active ? 1 : 0
      enabled: !Drag.active  // 禁用透明元素的交互
    2. 布局影响opacity: 0 的元素仍占据布局空间。如果希望拖拽时完全移除布局占位,需保留 visible 或改用 Item { visible: false } 包装。

3. 其他建议

  1. 动画过渡:如果希望拖拽时淡入淡出更平滑,可添加 Behavior
    opacity: !Drag.active ? 1 : 0
    Behavior on opacity { NumberAnimation { duration: 150 } }
  2. 代码一致性:确保项目中其他类似拖拽场景(如桌面图标、任务栏)使用相同的逻辑(opacityvisible),避免交互行为不一致。

总结

  • 优点:代码变更逻辑清晰,通过 opacity 改善了视觉效果。
  • 风险点:需注意透明元素的交互性和布局影响。
  • 改进建议:结合 enabled 属性和动画过渡,提升用户体验和健壮性。

最终代码建议(以 AppListView.qml 为例):

opacity: !Drag.active ? 1 : 0
enabled: !Drag.active  // 禁用交互
Behavior on opacity { NumberAnimation { duration: 150 } }  // 可选动画

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.

2 participants