fix(sidebar): keep table search results on Enter

This commit is contained in:
jearhe authored and GitHub committed 2026-08-23 01:39:53 +08:00
1 parent acc2137cde
commit 0908a944e8
4 files changed
+77 -11

No files matched your search

@@ -98,6 +98,15 @@ export function mutateFlatTreeExpansion(nodes: readonly FlatTreeNode[], parentIn
return replaceFlatTreeChildren(nodes, parentIndex, parent);
}
/** Whether the visible row identities changed enough to refresh recycled views. */
export function flatTreeRowsChanged(nodes: readonly FlatTreeNode[], previousNodes: readonly FlatTreeNode[] | undefined): boolean {
if (!previousNodes || nodes.length !== previousNodes.length) return true;
return nodes.some((item, index) => {
const previous = previousNodes[index];
return !previous || item.renderKey !== previous.renderKey || item.poolType !== previous.poolType || item.depth !== previous.depth;
});
}
export function shouldVirtualizeFlatTree(count: number): boolean {
return count > 0;
}