MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / rebuildPositionCache

Method rebuildPositionCache

src/utils/VirtualScroller.ts:266–277  ·  view source on GitHub ↗

* Rebuild the position cache from measured heights

()

Source from the content-addressed store, hash-verified

264 * Rebuild the position cache from measured heights
265 */
266 private rebuildPositionCache(): void {
267 this.positionCache = [];
268 let currentPosition = 0;
269
270 for (let i = 0; i < this.items.length; i++) {
271 this.positionCache[i] = currentPosition;
272 currentPosition += this.getItemHeight(i);
273 }
274
275 this.totalHeight = currentPosition;
276 this.updateSpacerHeight();
277 }
278
279 private getItemEntries(): VirtualScrollerItemEntry<T>[] {
280 return this.items.map((item, index) => ({

Callers 7

constructorMethod · 0.95
applyItemEntriesMethod · 0.95
measureRenderedItemsMethod · 0.95
updateItemsMethod · 0.95
invalidateItemsMethod · 0.95
invalidateHeightsMethod · 0.95

Calls 2

getItemHeightMethod · 0.95
updateSpacerHeightMethod · 0.95

Tested by

no test coverage detected