on main help sign in
fix(scrollbar): fix track position calculation
a4181d6Andrey Nering
internal/ui/common/scrollbar.go+1−1
@@ -23,7 +23,7 @@ func Scrollbar(s *styles.Styles, height, contentSize, viewportSize, offset int)
23 }
23 }
24
24
25 // Calculate where the thumb starts.
25 // Calculate where the thumb starts.
26− trackSpace := height - thumbSize + 1
26+ trackSpace := height - thumbSize
27 thumbPos := 0
27 thumbPos := 0
28 if trackSpace > 0 && maxOffset > 0 {
28 if trackSpace > 0 && maxOffset > 0 {
29 thumbPos = min(trackSpace, offset*trackSpace/maxOffset)
29 thumbPos = min(trackSpace, offset*trackSpace/maxOffset)
internal/ui/dialog/models.go+1−1
@@ -287,7 +287,7 @@ func (m *Models) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
287 rc.AddPart(inputView)
287 rc.AddPart(inputView)
288
288
289 listView := t.Dialog.List.Height(m.list.Height()).Render(m.list.Render())
289 listView := t.Dialog.List.Height(m.list.Height()).Render(m.list.Render())
290− scrollbar := common.Scrollbar(t, listHeight, listTotalHeight, listHeight, m.list.Offset())
290+ scrollbar := common.Scrollbar(t, listHeight, listTotalHeight, listHeight+1, m.list.Offset())
291 if scrollbar != "" {
291 if scrollbar != "" {
292 listView = lipgloss.JoinHorizontal(lipgloss.Top, listView, scrollbar)
292 listView = lipgloss.JoinHorizontal(lipgloss.Top, listView, scrollbar)
293 }
293 }