OS Service Hook for a long list revealed a page at a time.
Extracted from Messages, which had the whole thing written out: a page size, a
display limit, a derived window, a hidden-count, an index offset so keyed rows kept
their identity, a re-entrancy guard, and the scroll-height arithmetic that stops the
view from jumping when older messages appear above the fold. That last part is the
reason this is worth sharing — it is the piece everyone forgets, and getting it wrong
is invisible until a thread is long enough to scroll.
olderAt is what makes it serve both shapes. A chat grows upward and must compensate;
a feed grows downward and must not. Both window the newest rows first.
OS Service Hook for a long list revealed a page at a time.
Extracted from Messages, which had the whole thing written out: a page size, a display limit, a derived window, a hidden-count, an index offset so keyed rows kept their identity, a re-entrancy guard, and the scroll-height arithmetic that stops the view from jumping when older messages appear above the fold. That last part is the reason this is worth sharing — it is the piece everyone forgets, and getting it wrong is invisible until a thread is long enough to scroll.
olderAtis what makes it serve both shapes. A chat grows upward and must compensate; a feed grows downward and must not. Both window the newest rows first.A rune module: the window is derived from state the caller owns and must re-derive when either the list or the limit changes.