add scrollable functionality for fstree

This commit is contained in:
2026-01-03 21:49:14 +00:00
parent 353e7d2546
commit cee3aa323e
3 changed files with 42 additions and 3 deletions
+10 -2
View File
@@ -98,12 +98,20 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case tea.WindowSizeMsg:
m.terminalWidth = msg.Width
m.terminalHeight = msg.Height
m.viewport.Width = msg.Width - m.width - 1
m.viewport.Height = msg.Height
if m.tree != nil {
m.tree.Update(tea.WindowSizeMsg{
Height: m.terminalHeight,
Width: m.terminalWidth,
})
}
return m, nil
case treeLoadedMsg:
m.tree = msg.tree
m.loading = false
m.tree.Update(tea.WindowSizeMsg{
Height: m.terminalHeight,
Width: m.terminalWidth,
})
return m, nil
case spinner.TickMsg:
var cmd tea.Cmd