⚡ perf(vscode): 代码阅读预览屏幕外的顶层块跳过样式、排版和绘制(content-visibility),没画过的按内容估的高度占位;跳到某一行、恢复滚动位置、跳到改动和定义前先把目标那一带照常排版再量,滚过去位置不变

This commit is contained in:
cruldra committed 2026-10-13 15:11:21 +11:00
1 parent ffb0f147e1
commit 8a5d3761fd
9 files changed
+201 -9

No files matched your search

@@ -24,8 +24,9 @@ export function flash(el: HTMLElement): void {
el.setAttribute('data-flash', '')
}
/** 把 el 滚进钉住的筛选栏和卡片下面的视口。已经整个看得见就不滚。beforeScroll 在真正滚动前拿到将要落到的位置。 */
/** 把 el 滚进钉住的筛选栏和卡片下面的视口,量之前先把它那一带排版好(pageLayout.settle)。已经整个看得见就不滚。beforeScroll 在真正滚动前拿到将要落到的位置。 */
export function showInViewport(el: HTMLElement, beforeScroll?: (position: ScrollPosition) => void): void {
pageLayout.settle(el)
const rect = el.getBoundingClientRect()
const pinned = pageLayout.pinnedHeight() + stickyHeight()
const top = scrollTopToShow(