render fs tree

This commit is contained in:
2025-12-31 03:56:32 +00:00
parent c59bdad8aa
commit bf167e1d8a
3 changed files with 41 additions and 7 deletions
+6 -4
View File
@@ -52,7 +52,7 @@ func createModel() model {
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
return model{
width: 20, // char count
width: 30, // char count
tree: nil,
spinner: s,
loading: true,
@@ -67,7 +67,7 @@ type treeLoadedMsg struct {
}
func loadTreeCmd() tea.Msg {
time.Sleep(3 * time.Second) // delay sim
time.Sleep(1 * time.Second) // delay sim
cwd, err := os.Getwd()
if err != nil {
@@ -107,14 +107,16 @@ func (m model) View() string {
left := lipgloss.NewStyle().
Width(m.width).
Render("section1")
Render(m.tree.Render())
right := lipgloss.NewStyle().
Render("section2")
leftHeight := lipgloss.Height(left)
divider := lipgloss.NewStyle().
Width(1).
Height(5).
Height(leftHeight).
Background(styles.Primary).
Render("") // everything is a string in tui