feat: optimize tab result lifecycle caching

This commit is contained in:
t8y2 committed 2026-06-06 20:30:35 +08:00
1 parent b226b445d6
commit 2b5300722f
22 files changed
+1125 -56

No files matched your search

+10 -3
View File
@@ -1766,6 +1766,8 @@ function markGridScrolling() {
function onScrollerScroll(e: Event) {
syncHeaderScroll(e);
const target = e.target;
recordScrollPosition(target instanceof HTMLElement ? { top: target.scrollTop, left: target.scrollLeft } : undefined);
markGridScrolling();
}
@@ -2125,6 +2127,7 @@ const {
exitTransaction,
startEdit,
commitEdit,
commitEditFromBlur,
applyCellValue,
cancelEdit,
onEditKeydown,
@@ -2147,6 +2150,7 @@ const {
getResetScrollAfterResult,
clearResetScrollAfterResult,
cleanupFrames,
recordScrollPosition,
} = editor;
const saveActionMode = computed(() =>
@@ -3415,6 +3419,7 @@ function onCanvasScroll(event: Event) {
const gutter = scrollbarGutterWidth(scroller);
if (gridScrollbarGutter.value !== gutter) gridScrollbarGutter.value = gutter;
if (headerRef.value && headerRef.value.scrollLeft !== scrollLeft) headerRef.value.scrollLeft = scrollLeft;
recordScrollPosition({ top: scrollTop, left: scrollLeft });
markGridScrolling();
scheduleCanvasDraw();
}
@@ -4606,6 +4611,8 @@ function updateTransposeViewport() {
function onTransposeScroll() {
updateTransposeViewport();
const el = transposeScrollElement();
recordScrollPosition(el ? { top: el.scrollTop, left: el.scrollLeft } : undefined);
markGridScrolling();
}
@@ -6312,7 +6319,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
autocorrect="off"
spellcheck="false"
class="cell-edit-input absolute inset-0 bg-background border-2 border-primary px-1.5 py-0 text-xs leading-[26px] outline-none z-10"
@blur="commitEdit"
@blur="commitEditFromBlur"
@click.stop
@keydown.stop="onEditKeydown"
@paste.stop
@@ -6948,7 +6955,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
autocorrect="off"
spellcheck="false"
class="cell-edit-input absolute inset-0 bg-background border-2 border-primary px-2.5 py-0 text-xs leading-[22px] outline-none z-10"
@blur="commitEdit"
@blur="commitEditFromBlur"
@click.stop
@keydown.stop="onEditKeydown"
@paste.stop
@@ -7123,7 +7130,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
autocorrect="off"
spellcheck="false"
class="cell-edit-input absolute inset-0 bg-background border-2 border-primary px-2.5 py-0 text-xs leading-[22px] outline-none z-10"
@blur="commitEdit"
@blur="commitEditFromBlur"
@click.stop
@keydown.stop="onEditKeydown"
@paste.stop