package browser // HandleScroll updates the browser scroll index by the given delta (in entries). // Clamps to valid bounds and triggers prefetch/eviction as needed. func HandleScroll(s *BrowserState, delta int) { s.ScrollIndex += delta // Clamp to valid bounds clampScrollIndex(s) // Trigger eviction of distant pages s.EvictPages() }