add scroll on noteview

This commit is contained in:
2026-01-04 04:23:24 +00:00
parent b88dc05e92
commit ba37791246
2 changed files with 17 additions and 5 deletions
+12 -5
View File
@@ -248,12 +248,19 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
}
// Forward mouse input to tree only if not dragging
var cmd tea.Cmd
if m.tree != nil && !m.isDragging {
_, cmd = m.tree.Update(msg)
// Forward mouse input to children if not dragging
var cmds []tea.Cmd
if !m.isDragging {
if m.tree != nil && msg.X < m.fsTreeWidth {
_, cmd := m.tree.Update(msg)
cmds = append(cmds, cmd)
}
return m, cmd
if msg.X > m.fsTreeWidth {
_, cmd := m.noteView.Update(msg)
cmds = append(cmds, cmd)
}
}
return m, tea.Batch(cmds...)
}
return m, nil
+5
View File
@@ -104,6 +104,11 @@ func (m *NoteView) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.viewState = StateTitleOnly
m.vp.SetContent(m.renderNote())
return m, nil
case tea.MouseMsg:
var cmd tea.Cmd
m.vp, cmd = m.vp.Update(msg)
return m, cmd
}
return m, nil
}