perf: reduce high-density DOM memory (#404)

This commit is contained in:
SuLea-IT authored and GitHub committed 2026-05-22 14:02:13 +08:00
1 parent 6c83b10b42
commit 64c068bbf5
5 files changed
+408 -219

No files matched your search

@@ -0,0 +1,12 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
const dataGridSource = readFileSync("apps/desktop/src/components/grid/DataGrid.vue", "utf8");
test("data grid mounts the cell detail action only for the active cell", () => {
assert.match(dataGridSource, /cellDetailButtonVisible/);
assert.match(dataGridSource, /v-if="cellDetailButtonVisible\(index, actualColIdx\)"/);
assert.match(dataGridSource, /@mouseenter="onCellMouseenter\(index, visibleColIdx, actualColIdx\)"/);
assert.doesNotMatch(dataGridSource, /group-hover\/cell:flex/);
});
@@ -39,3 +39,12 @@ test("Redis JSON raw content uses Shiki highlighting safely", async () => {
assert.doesNotMatch(html, /<script>/);
assert.doesNotMatch(html, /<pre/);
});
test("Redis collection and stream values are virtualized", () => {
assert.match(redisViewerSource, /RecycleScroller/);
assert.match(redisViewerSource, /DynamicScroller/);
assert.match(redisViewerSource, /:items="collectionRows"/);
assert.match(redisViewerSource, /:items="streamRows"/);
assert.doesNotMatch(redisViewerSource, /v-for="\(item, idx\) in collectionItems"/);
assert.doesNotMatch(redisViewerSource, /v-for="entry in data\.value"/);
});