fix: fix blank area in security update log details view#312
Conversation
There was a problem hiding this comment.
Sorry @xionglinlin, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
1. Remove the dependency on getDetailInfos Q_INVOKABLE method by exposing DetailInfos and Expanded roles directly in the model 2. Add setExpanded Q_INVOKABLE method to the model to properly manage the expanded state 3. Sync data efficiently using syncData which avoids unnecessary beginResetModel/endResetModel when the pointer list hasn't changed 4. Simplify the QML view to use model.expanded and model.detailInfos directly from the model roles 5. Move the showDetails property from local state to model-backed state to persist expansion correctly when data refreshes 6. Use the model's setExpanded method when clicking "View More" or "Collapse" buttons 7. Add setExpanded/isExpanded methods to UpdateItemInfo to persist the expanded state per item 8. Fix the issue where the "View More" button was incorrectly visible due to stale local state 9. Replace clearAllData+addUpdateData pattern with syncData to prevent unnecessary model reset when only the selected state changes Log: Fixed security update log details display with proper expansion state management Influence: 1. Verify "View More" button appears correctly for security update items with detail logs 2. Click "View More" and verify the detail information displays correctly 3. Click "Collapse" and verify the details hide properly 4. Verify the expanded state persists when other updates or UI refreshes occur 5. Verify the "View More" button shows for items without details and does not expand to avoid blank areas 6. Test that checking/unchecking update items does not cause the list to scroll or collapse details 7. Verify the detail content displays correctly for both security updates and regular updates fix: 修复安全更新日志详情页出现空白区域问题 1. 通过直接暴露 DetailInfos 和 Expanded 角色到模型中,移除对 getDetailInfos Q_INVOKABLE 方法的依赖 2. 在模型中添加 setExpanded Q_INVOKABLE 方法来正确管理展开状态 3. 使用 syncData 方法高效同步数据,避免在指针列表未变化时触发不必要的 beginResetModel/endResetModel 4. 简化 QML 视图,直接使用模型角色 model.expanded 和 model.detailInfos 5. 将 showDetails 属性从本地状态迁移到模型支持的存储,以在数据刷新时正确 保持展开状态 6. 点击"查看详情"或"收起"按钮时,使用模型的 setExpanded 方法 7. 在 UpdateItemInfo 中添加 setExpanded/isExpanded 方法,以持久化每个项 目的展开状态 8. 修复由于本地状态过期导致"查看详情"按钮显示异常的问题 9. 使用 syncData 替代 clearAllData+addUpdateData 模式,防止仅在选中状态 变化时触发不必要的模型重置 Log: 修复安全更新日志详情显示问题,改进展开状态管理 Influence: 1. 验证安全更新项目在有详情日志时正确显示"查看详情"按钮 2. 点击"查看详情"后验证详情信息正确显示 3. 点击"收起"后验证详情正确隐藏 4. 验证在其他更新或UI刷新时展开状态保持不变 5. 验证无详情项目不显示"查看详情"按钮,避免出现空白区域 6. 测试勾选/取消勾选更新项目时,不会导致列表滚动或详情折叠 7. 验证详情内容在安全更新和普通更新中都能正确显示 PMS: BUG-367683 Change-Id: I383dadacaf4217e28e25b32e7ce55aebaf32506c
deepin pr auto review★ 总体评分:75分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // updatelistmodel.cpp
void UpdateListModel::collapseAll()
{
bool hasChanged = false;
for (int i = 0; i < m_updateLists.count(); ++i) {
if (m_updateLists[i]->isExpanded()) {
m_updateLists[i]->setExpanded(false);
hasChanged = true;
}
}
// 批量通知视图刷新,避免循环内多次触发重绘
if (hasChanged && !m_updateLists.isEmpty()) {
emit dataChanged(index(0), index(m_updateLists.count() - 1), { Expanded });
}
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, xionglinlin 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 |
Log: Fixed security update log details display with proper expansion state management
Influence:
fix: 修复安全更新日志详情页出现空白区域问题
Log: 修复安全更新日志详情显示问题,改进展开状态管理
Influence:
PMS: BUG-367683
Change-Id: I383dadacaf4217e28e25b32e7ce55aebaf32506c