WWindowSpan
Product

Product features · Fixed-row viewport bounds

01

Test negative scroll, overscroll and a zero-height viewport, clipping indices to the item count and rejecting an invalid row height.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Fixed-row viewport bounds

● ● ●WindowSpan●
A concrete starting point · Fixed-row viewport bounds ×
from math import isfinite, ceil

def row_window(count, row_height, offset, viewport, overscan=1):
    if type(count) is not int or count < 0 or type(overscan) is not int or overscan < 0:
        raise ValueError("rows.count")
    if not all(type(x) in (int, float) and isfinite(x) for x in (row_height, offset, viewport)) or row_height <= 0 or viewport < 0:
        raise ValueError("rows.geometry")
    start_units = max(0, offset) / row_height
    first = count if start_units >= count else int(start_units)
    if first == count or viewport == 0:
        return first, first
    span = viewport / row_height
    end = count if span >= count - start_units else min(count, ceil(start_units + span) + overscan)
    return max(0, first - overscan), end
✳Fixed-row viewport bounds
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗