on main help sign in
feat(ui): add scrollbar to sessions dialog (#3005)

๐Ÿ’˜ Generated with Crush Assisted-by: Crush:qwen3.7-max

commit092ac3e73a100d3ae7ec7fc16306de3fe5476f31 authorAndrey Nering <andreynering@users.noreply.github.com> dateMon 25 May 2026, 14:05 (5 months ago) parent229af09
1 file changed+8โˆ’1
internal/ui/dialog/sessions.go+8โˆ’1
internal/ui/dialog/sessions.go+8โˆ’1
@@ -237,7 +237,10 @@ func (s *Session) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
237237 t.Dialog.HelpView.GetVerticalFrameSize() +
238238 t.Dialog.View.GetVerticalFrameSize()
239239 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)
241244 s.help.SetWidth(innerWidth)
242245
243246 // 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 {
309312 rc.AddPart(inputView)
310313 }
311314 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)
318+ }
312319 rc.AddPart(listView)
313320 rc.Help = s.help.View(s)
314321