perf(grid): optimize virtual scroll to reduce white flash during fast scrolling

Add buffer, skip-hover, will-change, and CSS contain properties to all
RecycleScroller instances (DataGrid, ConnectionTree, ObjectBrowser,
RedisKeyBrowser). Disable pointer-events during scroll in DataGrid to
reduce repaint overhead.
This commit is contained in:
t8y2
2026-05-12 13:50:03 +08:00
parent 368fa5a102
commit 78184544cf
5 changed files with 78 additions and 5 deletions
+19 -1
View File
@@ -408,7 +408,14 @@ watch(
<div class="truncate">{{ t("objects.schemaColumn") }}</div>
<div v-if="hasComments" class="truncate">{{ t("objects.comment") }}</div>
</div>
<RecycleScroller class="min-h-0 flex-1" :items="filteredRows" :item-size="38" key-field="id">
<RecycleScroller
class="object-browser-scroller min-h-0 flex-1"
:items="filteredRows"
:item-size="38"
:buffer="600"
:skip-hover="true"
key-field="id"
>
<template #default="{ item }">
<div
class="grid h-[38px] cursor-pointer items-center gap-3 border-b px-3 hover:bg-accent/50"
@@ -514,3 +521,14 @@ watch(
</div>
</div>
</template>
<style scoped>
.object-browser-scroller {
will-change: scroll-position;
contain: content;
}
.object-browser-scroller :deep(.vue-recycle-scroller__item-view) {
contain: layout style paint;
}
</style>