Support controlled multi-selection and visible ranges in Tree

This commit is contained in:
Codex
2026-11-14 23:05:56 +03:00
parent d8ed37e09d
commit d7885fe098
7 changed files with 36 additions and 10 deletions
@@ -0,0 +1,5 @@
/** Range follows displayed rows only; folded/filtered-out branches cannot leak in. */
export function treeSelectionRange(rows:readonly string[],anchor:string|null,target:string):string[]{
const a=rows.indexOf(anchor??target),b=rows.indexOf(target);
return a<0||b<0?[target]:rows.slice(Math.min(a,b),Math.max(a,b)+1);
}