Conversation
1. Root cause: DelegateDropArea on app icons occluded folderPageDropArea drag events, preventing page-turn detection when a row was full of apps 2. Fix: DelegateDropArea maps drag position to folderPageDropArea coordinates and triggers page-turn in the edge zone (30 percent width), otherwise delegates to normal sort logic 3. Impact: page-turn drag works consistently regardless of row fullness, no change to sort behavior or page-turn zone size Log: Fix page-turn drag not working when app folder rows are full Influence: 1. Test dragging apps to page-turn zone with full rows 2. Test dragging apps to page-turn zone with partial rows 3. Test drag-to-sort and drag-out-to-close still work normally fix: 修复满排时应用文件夹弹窗翻页拖拽失效 1. 根因:应用图标 DelegateDropArea 在事件层级上遮挡了 folderPageDropArea,满排时拖拽事件无法传递到翻页检测区域 2. 方案:DelegateDropArea 将拖拽位置映射到 folderPageDropArea 坐标系,在翻页区域内触发翻页,否则正常进行重排序 3. 影响:满排与不满排时翻页行为一致,排序和翻页区域大小不变 Log: 修复应用文件夹满排时翻页拖拽失效问题 Influence: 1. 测试满排时拖拽应用到边缘翻页区域 2. 测试不满排时拖拽应用到边缘翻页区域 3. 验证拖拽排序和拖拽出文件夹关闭弹窗无回归 PMS: BUG-375231
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideFix page-turn dragging over fully populated rows by handling edge-zone detection inside each delegate drop area, mapping coordinates to the folder-level area, and keeping sorting behavior unchanged away from the edges. Sequence diagram for edge-zone page-turn drag handlingsequenceDiagram
actor User
participant DelegateDropArea
participant folderPageDropArea
participant folderDragApplyTimer
participant folderPagesView
User->>DelegateDropArea: onEntered or onPositionChanged
DelegateDropArea->>DelegateDropArea: mapToItem(folderPageDropArea, drag.x, 0)
alt mappedX is in edge zone
DelegateDropArea->>folderDragApplyTimer: stop()
DelegateDropArea->>folderPageDropArea: checkDragMove(mappedX)
folderPageDropArea->>folderPagesView: change page intent or turn page
else mappedX is outside edge zone
DelegateDropArea->>folderPageDropArea: pageIntent = 0
DelegateDropArea->>folderDragApplyTimer: restart()
end
User->>DelegateDropArea: onExited
DelegateDropArea->>folderPageDropArea: pageIntent = 0
Flow diagram for drag event routing in full folder rowsflowchart LR
Drag[Drag over app icon] --> Delegate[DelegateDropArea receives event]
Delegate --> Map[mapToItem to folderPageDropArea coordinates]
Map --> Edge{Within left or right edge zone?}
Edge -->|Yes| Page["stop folderDragApplyTimer and call checkDragMove(mappedX)"]
Edge -->|No| Sort[reset pageIntent and continue sorting timer]
Empty[Drag over empty row space] --> Folder[folderPageDropArea receives event]
Folder --> Page
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰。可考虑使用 QML 默认参数语法简化 checkDragMove 函数的可选参数处理 2. 代码质量 ✅评价: 良好 ✅ 通过 潜在问题:
建议: 将重复的翻页检测逻辑提取为独立函数 checkPageTurnZone(dragX),在 onEntered 和 onPositionChanged 中复用;为新增的关键逻辑添加注释,说明坐标映射的原因和翻页区域判定规则 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 性能良好,资源使用合理。可将翻页检测逻辑提取为公共函数减少重复调用,或缓存 mapToItem 结果 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞。本次修改为 UI 层 QML 代码,无用户输入处理、无网络操作、无文件系统访问、无硬编码凭证,无注入风险。保持现有安全编码实践 💡 改进建议代码示例// 在 DelegateDropArea 中提取翻页检测逻辑为独立函数
function checkPageTurnZone(dragX) {
// 将拖拽位置映射到 folderPageDropArea 坐标系
// 解决 DelegateDropArea 事件层级遮挡导致 folderPageDropArea
// 无法接收拖拽事件的问题
let mappedX = mapToItem(folderPageDropArea, dragX, 0).x
// 检测是否在翻页区域(左/右 30%)
if (mappedX < folderPageDropArea.horizontalPadding ||
mappedX > (folderPageDropArea.width - folderPageDropArea.horizontalPadding)) {
folderDragApplyTimer.stop()
folderPageDropArea.checkDragMove(mappedX)
return true // 在翻页区域,已处理
}
folderPageDropArea.pageIntent = 0
return false // 不在翻页区域,继续排序逻辑
}
// onEntered 中复用
onEntered: {
if (dragId !== model.desktopId) {
isDragHover = true
}
if (checkPageTurnZone(drag.x)) return
folderDragApplyTimer.dragId = dragId
folderDragApplyTimer.restart()
}
// onPositionChanged 中复用
onPositionChanged: {
if (dragId === model.desktopId) {
return
}
if (checkPageTurnZone(drag.x)) return
folderDragApplyTimer.dragId = dragId
folderDragApplyTimer.currentDropX = drag.x
if (!folderDragApplyTimer.running) {
folderDragApplyTimer.restart()
}
}本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 2.0.48 |
Root Cause Analysis
In the app folder popup of dde-launchpad, the
DelegateDropArea(on each app icon delegate) sits abovefolderPageDropAreain the QML event hierarchy. When a row is full (4 apps), dragging across that row always stays on a delegate's DropArea, sofolderPageDropAreanever receivesonPositionChanged— itscheckDragMove()is never called, and page-turn detection fails. When a row is partially filled, the empty space has no delegate, sofolderPageDropAreareceives events normally and page-turn works.Key evidence:
folderPageDropAreacovers the full content area and checks drag X against the left/right 30% zone;DelegateDropAreainstances are children ofSwipeViewplaced afterfolderPageDropArea, making them event-level occluders.Fix
Added page-turn detection to
DelegateDropArea: inonEnteredandonPositionChanged, the drag position is mapped tofolderPageDropAreacoordinates. If it falls within the page-turn zone (left/right 30%), the sort timer is stopped andcheckDragMove(mappedX)is called to trigger page-turn; otherwisepageIntentis reset and normal sort logic proceeds.checkDragMove()now accepts an optionaldragXparameter (defaults todrag.x).onExitedresetspageIntent.Change Safety Assessment
Code Safety
190355ca5and refined by subsequent commits; this change is purely additive and does not revert any historical fix.DelegateDropAreais only used withinFolderGridViewPopup.qml(no external references), so the blast radius is limited to the folder popup.Business Impact Scope
Affected module: App folder popup (both fullscreen and windowed modes share
DelegateDropArea). User scenario: dragging an app icon to the left/right edge of the folder popup to switch pages. After the fix, page-turn works consistently regardless of how many apps are in the dragged-over row. Drag-to-sort and drag-out-to-close behaviors are unchanged for non-edge positions.Verification Suggestion
根因分析
在 dde-launchpad 的应用文件夹弹窗中,
DelegateDropArea(每个应用图标 delegate 的 DropArea)在 QML 事件层级上位于folderPageDropArea之上。当某排已满(4 个应用)时,拖拽经过该排始终停留在某个 delegate 的 DropArea 上,folderPageDropArea无法收到onPositionChanged,checkDragMove()不被调用,翻页检测失效。当某排未满时,空白区域无 delegate 遮挡,folderPageDropArea正常收到事件,翻页正常工作。关键证据:
folderPageDropArea覆盖整个内容区域,检测拖拽 X 坐标是否在左/右 30% 区域内;DelegateDropArea实例是SwipeView的子节点,排在folderPageDropArea之后,构成事件层级遮挡。修复方案
为
DelegateDropArea增加翻页检测:在onEntered和onPositionChanged中,将拖拽位置映射到folderPageDropArea坐标系,若落在翻页区域(左/右 30%)则停止排序 timer 并调用checkDragMove(mappedX)触发翻页,否则重置pageIntent并正常进行排序。checkDragMove()增加可选参数dragX(默认回退到drag.x)。onExited中重置pageIntent。改动安全评估
代码安全评估
190355ca5引入,后续多次修复完善;本次改动为纯增量,不撤销任何历史修复。DelegateDropArea仅在FolderGridViewPopup.qml内部使用(无外部引用),影响范围仅限文件夹弹窗。业务影响范围
受影响模块:应用文件夹弹窗(全屏模式和窗口模式共用
DelegateDropArea)。用户场景:拖拽应用图标到文件夹弹窗左/右边缘进行翻页。修复后,无论拖拽经过的排是否已满,翻页功能均正常工作。非边缘位置的拖拽排序和拖拽出文件夹关闭弹窗行为不变。验证建议
Summary by Sourcery
Fix app folder drag handling so dragging icons to the popup edges turns pages consistently regardless of row occupancy.
Bug Fixes:
Enhancements: