perf(renderer): 整体优化响应速度 — rAF 合并编辑器刷新/自动保存缓存/粒子引擎空闲自停
同时: 不透明窗口 + 精简主题(8到2)、TabBar 简化、图谱宽松布局、MoreActions 层级修复
This commit is contained in:
@@ -60,18 +60,19 @@ test('思维导图+知识图谱渲染验证(含可见性)', async () => {
|
||||
const rects = svg.querySelectorAll('rect').length;
|
||||
const texts = svg.querySelectorAll('text').length;
|
||||
const lines = svg.querySelectorAll('line').length;
|
||||
const linkPaths = svg.querySelectorAll('path').length;
|
||||
// Check a node card is visible within the svg
|
||||
const visibleCard = Array.from(svg.querySelectorAll('rect')).some((r) => {
|
||||
const b = r.getBoundingClientRect();
|
||||
return b.width > 0 && b.height > 0;
|
||||
});
|
||||
return { found: true, w: rect.width, h: rect.height, rects, texts, lines, visibleCard };
|
||||
return { found: true, w: rect.width, h: rect.height, rects, texts, lines, linkPaths, visibleCard };
|
||||
});
|
||||
console.log('Knowledge graph:', JSON.stringify(graph));
|
||||
expect(graph.found).toBe(true);
|
||||
expect(graph.h).toBeGreaterThan(100);
|
||||
expect(graph.rects).toBeGreaterThanOrEqual(5);
|
||||
expect(graph.lines).toBeGreaterThanOrEqual(1);
|
||||
expect(graph.rects).toBeGreaterThanOrEqual(3); // 2 卡 rect + 1 背景 rect(demo 卡片无左侧色条)
|
||||
expect(graph.linkPaths).toBeGreaterThanOrEqual(1); // 曲线连线为 path
|
||||
expect(graph.visibleCard).toBe(true);
|
||||
|
||||
await app.close();
|
||||
|
||||
Reference in New Issue
Block a user