Bound continuous calendar event loading

This commit is contained in:
2026-07-30 05:22:09 +02:00
parent 56b387a784
commit b1cf001452
3 changed files with 83 additions and 6 deletions

View File

@@ -1,5 +1,7 @@
import {
continuousEventWindow,
continuousVirtualWindow,
daysForMode,
groupEventsByDay,
layoutTimedEventsForDay,
moveEventToDay,
@@ -49,6 +51,23 @@ assert(
"virtualization should preserve offscreen geometry",
);
const continuousDays = daysForMode("continuous", focus, {
before: 50,
after: 50,
});
const eventWindow = continuousEventWindow(
continuousDays,
{ scrollTop: 40 * 92, height: 6 * 92 },
);
assert(
(eventWindow.end.getTime() - eventWindow.start.getTime()) / 86_400_000 === 10 * 7,
"continuous event loading should stay bounded to a ten-week window",
);
assert(
eventWindow.start > continuousDays[0],
"continuous event loading should follow the virtualized viewport",
);
const day = new Date(2026, 6, 7);
const parallel = [0, 1, 2, 3].map((index) =>
event(