@@ -237,7 +237,10 @@ func (s *Session) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
237 t.Dialog.HelpView.GetVerticalFrameSize() +
237 t.Dialog.HelpView.GetVerticalFrameSize() +
238 t.Dialog.View.GetVerticalFrameSize()
238 t.Dialog.View.GetVerticalFrameSize()
239 s.input.SetWidth(max(0, innerWidth-t.Dialog.InputPrompt.GetHorizontalFrameSize()-1)) // (1) cursor padding
239 s.input.SetWidth(max(0, innerWidth-t.Dialog.InputPrompt.GetHorizontalFrameSize()-1)) // (1) cursor padding
240− s.list.SetSize(innerWidth, height-heightOffset)
240+ listHeight := height - heightOffset
241+ listTotalHeight := s.list.TotalHeight()
242+ listWidth := max(0, innerWidth-3) // Reserve space for scrollbar.
243+ s.list.SetSize(listWidth, listHeight)
241 s.help.SetWidth(innerWidth)
244 s.help.SetWidth(innerWidth)
243 // This makes it so we do not scroll the list if we don't have to
246 // This makes it so we do not scroll the list if we don't have to
@@ -309,6 +312,10 @@ func (s *Session) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
309 rc.AddPart(inputView)
312 rc.AddPart(inputView)
311 listView := t.Dialog.List.Height(s.list.Height()).Render(s.list.Render())
314 listView := t.Dialog.List.Height(s.list.Height()).Render(s.list.Render())
315+ scrollbar := common.Scrollbar(t, listHeight, listTotalHeight, listHeight, s.list.Offset())
316+ if scrollbar != "" {
317+ listView = lipgloss.JoinHorizontal(lipgloss.Top, listView, scrollbar)
312 rc.AddPart(listView)
319 rc.AddPart(listView)
313 rc.Help = s.help.View(s)
320 rc.Help = s.help.View(s)