package editor import "time" // ProbeRecord captures per-frame context for the in-app profiler (see // internal/perf). It is filled on the logic goroutine and handed to the // PerfRecord hook once per frame emission. Debug-only: PerfRecord is nil // unless the app enables profiling (cmd/pad), so the per-frame cost is a // single nil check. type ProbeRecord struct { T time.Time DeltaMs float64 // ms since the previous frame emission Page string // "editor" | "browser" ScrollDP float32 // editor scroll offset (Dp); browser scroll when on browser MaxScrollDP float32 // editor max scroll (Dp) TotalLines int VisStart int // visible byte range start VisEnd int // visible byte range end (exclusive) } // PerfRecord is an optional per-frame probe hook, set by the app when in-app // profiling is enabled. It is called on the logic goroutine, once per frame. var PerfRecord func(ProbeRecord) func pageName(p Page) string { if p == EditorPage { return "editor" } return "browser" }