@@ -3,6 +3,7 @@ package tui
33import (
44 "github.com/charmbracelet/bubbles/help"
55 "github.com/charmbracelet/bubbles/key"
6+ "github.com/charmbracelet/bubbles/textarea"
67 "github.com/charmbracelet/bubbles/textinput"
78 "github.com/charmbracelet/bubbles/viewport"
89 tea "github.com/charmbracelet/bubbletea"
@@ -16,6 +17,7 @@ const (
1617 modeNormal appMode = iota
1718 modeInput
1819 modeConfirm
20+ modeCommit
1921)
2022
2123// Model represents the state of the TUI.
@@ -37,12 +39,14 @@ type Model struct {
3739 repoName string
3840 branchName string
3941 // New fields for pop-ups
40- mode appMode
41- promptTitle string
42- confirmMessage string
43- textInput textinput.Model
44- inputCallback func (string ) tea.Cmd
45- confirmCallback func (bool ) tea.Cmd
42+ mode appMode
43+ promptTitle string
44+ confirmMessage string
45+ textInput textinput.Model
46+ descriptionInput textarea.Model
47+ inputCallback func (string ) tea.Cmd
48+ commitCallback func (title , description string ) tea.Cmd
49+ confirmCallback func (bool ) tea.Cmd
4650}
4751
4852// initialModel creates the initial state of the application.
@@ -65,7 +69,12 @@ func initialModel() Model {
6569 ti := textinput .New ()
6670 ti .Focus ()
6771 ti .CharLimit = 256
68- ti .Width = 50
72+ ti .Width = 80
73+
74+ ta := textarea .New ()
75+ ta .Placeholder = "Enter commit description"
76+ ta .SetWidth (80 )
77+ ta .SetHeight (5 )
6978
7079 return Model {
7180 theme : Themes [themeNames [0 ]],
@@ -82,6 +91,7 @@ func initialModel() Model {
8291 panels : panels ,
8392 mode : modeNormal ,
8493 textInput : ti ,
94+ descriptionInput : ta ,
8595 }
8696}
8797
0 commit comments