Primitives / foldkit-primitives/state

windowFor

function · packages/primitives/src/state/virtual.ts:182

function windowFor(
  model: VirtualModel,
  keys: ReadonlyArray<string>,
  viewportHeight: number,
): VirtualWindow & {
  readonly totalHeight: number
}

The rows to render plus the spacer height, from the Model, the key order, and the viewport height. Layout and overscan come from the Model, so the call cannot disagree with the placement. Keys stay the application's: render each row keyed, and per-row placements keep identity.