scrolltest

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scrolltest provides the shared inertial-wheel stress fixture used by boundary tests across sidecar. It exists so every scrollable surface proves the same journey: a hard flick's tail is dropped before Update and View, and the first reverse event still passes immediately.

The fixture is deliberately free of sleeps and timers: it drives the pre-update boundary answer directly, so it is deterministic and cheap enough to run for every surface.

Index

Constants

View Source
const DefaultTailEvents = 300

DefaultTailEvents is the number of same-direction events a hard Magic Mouse or trackpad flick can queue.

Variables

This section is empty.

Functions

func Run

func Run(t testing.TB, tail Tail)

Run feeds the same-direction tail and then one reverse event, asserting that every tail event is dropped and the reverse event survives.

It reports the first failing event rather than every one, so a broken surface produces one readable failure instead of hundreds.

func Wheel

func Wheel(x, y int, down bool) tea.MouseWheelMsg

Wheel builds a vertical wheel event at a screen/local point.

Types

type Tail

type Tail struct {
	// Name labels the surface under test in failure messages.
	Name string

	// X, Y is the pointer position, in whatever coordinate space Dropped
	// expects (screen coordinates for app overlays, header-adjusted local
	// coordinates for plugins).
	X, Y int

	// Down is the direction of the inertial tail. The reverse event is its
	// opposite.
	Down bool

	// Events is how many tail events to feed; zero means DefaultTailEvents.
	Events int

	// Dropped reports whether the surface would discard this exact event before
	// Update and View. Pass a plugin's WheelAtBoundary, a modal's
	// WheelAtBoundary closure, or a wrapper around app.FilterInput.
	Dropped func(tea.MouseWheelMsg) bool
}

Tail describes one stress run against a surface already sitting at a boundary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL