Pad/internal/browser/handlers.go
Greg Pomerantz 6a43e3c0db Add e2e test harness for testing editor logic without Gio display
- internal/test/e2e/: FrameCapture, Harness, ElementAssertions, helpers
- internal/editor/logic.go: Add done channel and Done() method for graceful shutdown
- internal/editor/mock_setup.go: Mock filesystem for tests
- internal/browser/: Browser layout and search logic
- internal/io/: Worker pool for async tasks
- Update architecture docs and spec
2026-05-31 08:56:30 -04:00

14 lines
344 B
Go

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()
}