Defer heavy city card rendering until users need it

City decision cards rendered Chart.js canvases and AI evidence bodies before the user could see or expand those sections. This keeps the card shell visible while delaying chart data/canvas work until the section nears the viewport and skipping the AI evidence body while its details panel is collapsed.

Constraint: Preserve existing decision-card layout and evidence copy.

Rejected: Add list virtualization in the same pass | card-level render costs should be reduced before changing list mechanics.

Confidence: high

Scope-risk: narrow

Reversibility: clean

Tested: npm run build

Not-tested: Runtime scroll benchmark on a large production city set.
This commit is contained in:
2569718930@qq.com
2026-04-28 11:10:12 +08:00
parent d2699ce17a
commit 2e5bdfd1b6
3 changed files with 126 additions and 64 deletions
@@ -3778,6 +3778,18 @@
height: 100% !important;
}
.root :global(.scan-ai-city-chart-placeholder) {
display: grid;
height: 100%;
place-items: center;
border: 1px dashed rgba(77, 163, 255, 0.22);
border-radius: 14px;
background: rgba(11, 18, 32, 0.35);
color: #7f96b6;
font-size: 12px;
font-weight: 800;
}
.root :global(.scan-ai-city-chart-legend) {
display: flex;
gap: 14px;
@@ -5818,6 +5830,12 @@
color: #64748b;
}
.root :global(.scan-terminal.light .scan-ai-city-chart-placeholder) {
border-color: #cbd5e1;
background: #f8fafc;
color: #64748b;
}
.root :global(.scan-terminal.light .scan-ai-log-panel) {
border-color: rgba(35, 72, 118, 0.12);
background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(246, 250, 255, 0.9));