Remove scroll debug statements. Add one extra element to browser listview

so that we have a partial item displayed at the bottom and not a blank space.
This commit is contained in:
Greg Pomerantz 2026-06-01 11:58:57 -04:00
parent 6709f52e0f
commit dc80c8a8e8
2 changed files with 2 additions and 3 deletions

View File

@ -176,7 +176,8 @@ func computeVisibleEntries(state *BrowserState) []ui.ListItem {
} }
startIndex := state.GetScrollIndex() startIndex := state.GetScrollIndex()
endIndex := startIndex + state.VisibleCount // show one past the "visible count" for a partial view of the next item
endIndex := startIndex + state.VisibleCount + 1
if endIndex > state.TotalEntries { if endIndex > state.TotalEntries {
endIndex = state.TotalEntries endIndex = state.TotalEntries
} }

View File

@ -3,7 +3,6 @@ package ui
import ( import (
"bytes" "bytes"
"embed" "embed"
"fmt"
"image" "image"
"image/color" "image/color"
_ "image/png" _ "image/png"
@ -200,7 +199,6 @@ func (r *Renderer) CheckGestures(q input.Source, m unit.Metric) []InputEvent {
delta := reg.scroll.Update(m, q, time.Now(), gesture.Vertical, delta := reg.scroll.Update(m, q, time.Now(), gesture.Vertical,
pointer.ScrollRange{}, pointer.ScrollRange{Min: -(1<<30), Max: 1<<30}) pointer.ScrollRange{}, pointer.ScrollRange{Min: -(1<<30), Max: 1<<30})
if delta != 0 { if delta != 0 {
fmt.Printf("Scroll detected: %v\n", delta)
events = append(events, InputEvent{ events = append(events, InputEvent{
Handler: reg.handler, Handler: reg.handler,
Data: delta, Data: delta,