fix: optimize update list performance and fix detail view issues - #332
fix: optimize update list performance and fix detail view issues#332xionglinlin wants to merge 1 commit into
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
Reviewer's GuideThe update page now avoids repeated severity lookups and hot-path logging, uses strict cached-enum sorting, and lazily virtualizes expanded detail lists with content-aware sizing and a unified expand/collapse control to eliminate large-list freezes and collapsed blank space. Sequence diagram for lazy update detail renderingsequenceDiagram
participant User
participant UpdateList
participant Loader
participant ListView
participant DetailModel
User->>UpdateList: setExpanded(itemIndex, true)
UpdateList->>Loader: active = true
Loader->>ListView: create detail view
ListView->>DetailModel: read detailModel
ListView-->>UpdateList: instantiate visible delegates
User->>UpdateList: setExpanded(itemIndex, false)
UpdateList->>Loader: active = false
Loader-->>UpdateList: height = 0
Flow diagram for update detail expansion and scrollingflowchart TD
A[Update card] --> B{showDetails}
B -->|false| C[Loader inactive\nzero height]
B -->|true| D[Loader creates ListView]
D --> E[contentHeight measured]
E --> F{content overflows 500px?}
F -->|no| G[Show all content\nno scrollbar]
F -->|yes| H[Viewport capped at 500px\nvirtualized visible delegates\nscrollbar visible]
A --> I[Title-row toggle]
I --> B
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1. Cache parsed vulnerability level enum in SecurityUpdateLog at load time, sort and count by integer enum instead of looking up vulLevelMap per comparison, eliminating tens of thousands of debug log calls that caused ~6s UI freeze with 1500+ security updates 2. Fix non-strict weak ordering (>= 0) in security log sort comparators 3. Remove redundant debug logging from hot paths: vulLevelMap, addDetailInfo and setExplain 4. Replace detail list Repeater with Loader lazy creation + ListView virtualization, so collapsed cards instantiate zero delegates and expanded lists only create visible items, eliminating ~9s page freeze 5. Merge expand/collapse into a single toggle button (View More <-> Collapse) at the card title row instead of a Collapse button at the end of a long list 6. Show scrollbar only when content overflows and keep it always visible while scrollable; fix 400px blank placeholder after collapsing by zeroing Loader height and letting viewport height shrink with content Log: Update page no longer freezes for seconds with large update sets; detail list scrolls smoothly and collapses without blank space Influence: 1. Open Control Center > System Update with a large number of updates (1500+ security CVEs), verify page opens and list renders instantly 2. Expand system/security update details, verify scrolling is smooth and scrollbar appears only when content overflows 3. Click Collapse at the title row, verify details collapse and no blank placeholder remains 4. Verify small update sets (few items) show no scrollbar and no extra spacing 5. Regression: check update, download, install flows are unaffected fix: 优化更新列表性能并修复详情展示问题 1. SecurityUpdateLog 装载时预解析漏洞等级枚举,排序与统计直接用整数枚举 比较,不再每次比较查询 vulLevelMap 并输出日志,消除 1500+ 条安全更新 场景下约 6 秒的 UI 卡顿 2. 修复安全日志排序比较器中 >= 0 导致的非严格弱序问题 3. 移除热路径上的冗余调试日志:vulLevelMap、addDetailInfo、setExplain 4. 详情列表由 Repeater 一次性实例化改为 Loader 惰性创建 + ListView 虚拟化, 折叠时零 delegate,展开时仅实例化可视区项,消除页面打开约 9 秒卡顿 5. 展开/收起合并为卡片标题行同一位置的切换按钮(View More <-> Collapse), 收起按钮不再沉在长列表末尾 6. 滚动条仅内容超出一屏时显示,可滚动时常显不透明;修复折叠后残留 400px 空白占位(Loader 高度归零、视口高度随内容收缩) Log: 更新页面在大规模更新场景下不再长时间卡顿,详情列表滚动流畅、 收起后无空白占位 PMS: BUG-373703 Change-Id: Ia7df7725faea365dc6bec3dad9f369df9e49b0c6
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/dcc-update-plugin/operation/updateloghelper.cpp" line_range="211-214" />
<code_context>
- const auto &pair = vulLevelMap().value(detail.vulLevel);
- auto count = vulCount.value(pair.first, 0);
- vulCount[pair.first] = ++count;
+ const auto level = vulLevelFromString(detail.vulLevel);
+ vulCount[level]++;
item.summary = sumCveLevelUp(vulCount);
- detail.displayVulLevel = pair.second;
+ detail.displayVulLevel = vulLevelMap().value(detail.vulLevel).second;
}
std::sort(item.details.begin(), item.details.end(), [](const HistoryItemDetail& v1, const HistoryItemDetail& v2) -> bool {
</code_context>
<issue_to_address>
**issue (broader_impact):** History entries with an uppercase vulnerability level are counted under the parsed severity (for example, `HIGH` becomes `VulLevel_High`) but their display level is looked up using the original case and becomes an empty string, so the summary and visible detail disagree.
**Triggers:** When historical update logs contain vulnerability levels with casing other than lowercase.
**Suggested fix:** Normalize `detail.vulLevel` before both parsing and the `vulLevelMap()` lookup, or use one shared normalized lookup result for counting and display.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| const auto level = vulLevelFromString(detail.vulLevel); | ||
| vulCount[level]++; | ||
| item.summary = sumCveLevelUp(vulCount); | ||
| detail.displayVulLevel = pair.second; | ||
| detail.displayVulLevel = vulLevelMap().value(detail.vulLevel).second; |
There was a problem hiding this comment.
issue (broader_impact): History entries with an uppercase vulnerability level are counted under the parsed severity (for example, HIGH becomes VulLevel_High) but their display level is looked up using the original case and becomes an empty string, so the summary and visible detail disagree.
Triggers: When historical update logs contain vulnerability levels with casing other than lowercase.
Suggested fix: Normalize detail.vulLevel before both parsing and the vulLevelMap() lookup, or use one shared normalized lookup result for counting and display.
|
TAG Bot New tag: 1.0.62 |
Log: Update page no longer freezes for seconds with large update sets; detail list scrolls smoothly and collapses without blank space
Influence:
fix: 优化更新列表性能并修复详情展示问题
Log: 更新页面在大规模更新场景下不再长时间卡顿,详情列表滚动流畅、
收起后无空白占位
PMS: BUG-373703
Change-Id: Ia7df7725faea365dc6bec3dad9f369df9e49b0c6
Summary by Sourcery
Optimize update list rendering and vulnerability processing so large update sets open responsively and detail views remain smooth when expanded or collapsed.
Bug Fixes:
Enhancements: