77 tea "charm.land/bubbletea/v2"
88 "charm.land/lipgloss/v2"
99
10- "github.com/usetero/cli/internal/app/chat/commandbar "
10+ "github.com/usetero/cli/internal/app/chat/inputbar "
1111 "github.com/usetero/cli/internal/app/chat/messagelist"
1212 "github.com/usetero/cli/internal/app/chat/msgs"
1313 appmsg "github.com/usetero/cli/internal/app/msgs"
2626 key .WithKeys ("up" ),
2727 key .WithHelp ("↑↓" , "scroll" ),
2828 )
29- focusCommandBar = key .NewBinding (
29+ focusInputBar = key .NewBinding (
3030 key .WithKeys ("tab" ),
31- key .WithHelp ("tab" , "focus command bar " ),
31+ key .WithHelp ("tab" , "focus input " ),
3232 )
3333 focusChat = key .NewBinding (
3434 key .WithKeys ("tab" ),
@@ -50,7 +50,7 @@ type Model struct {
5050 scope log.Scope
5151 focus focus
5252
53- commandBar * commandbar .Model
53+ inputBar * inputbar .Model
5454 messageList * messagelist.Model
5555
5656 // Conversation is created lazily on first message
@@ -84,7 +84,7 @@ func New(
8484
8585 return & Model {
8686 scope : scope ,
87- commandBar : commandbar .New (theme , scope ),
87+ inputBar : inputbar .New (theme , scope ),
8888 messageList : messagelist .New (theme , db , chatClient , toolRegistry , scope ),
8989 account : account ,
9090 workspace : workspace ,
@@ -97,7 +97,7 @@ func New(
9797
9898// Init initializes the model.
9999func (m * Model ) Init () tea.Cmd {
100- return m .commandBar .Init ()
100+ return m .inputBar .Init ()
101101}
102102
103103// Update handles messages.
@@ -136,19 +136,19 @@ func (m *Model) Update(msg tea.Msg) tea.Cmd {
136136
137137 case tea.MouseClickMsg :
138138 // Click on the message list area focuses it
139- if m .hasMessages () && msg .Y >= m .originY && msg .Y < m .originY + m .height - m .commandBar .Height () {
139+ if m .hasMessages () && msg .Y >= m .originY && msg .Y < m .originY + m .height - m .inputBar .Height () {
140140 if m .focus != focusMessages {
141141 cmds = append (cmds , m .setFocus (focusMessages ))
142142 }
143- } else if msg .Y >= m .originY + m .height - m .commandBar .Height () {
143+ } else if msg .Y >= m .originY + m .height - m .inputBar .Height () {
144144 if m .focus != focusEditor {
145145 cmds = append (cmds , m .setFocus (focusEditor ))
146146 }
147147 }
148148 }
149149
150150 // Forward to children
151- cmds = append (cmds , m .commandBar .Update (msg ))
151+ cmds = append (cmds , m .inputBar .Update (msg ))
152152 cmds = append (cmds , m .messageList .Update (msg ))
153153
154154 return tea .Batch (cmds ... )
@@ -173,9 +173,9 @@ func (m *Model) setFocus(f focus) tea.Cmd {
173173 switch f {
174174 case focusEditor :
175175 m .messageList .SetFocused (false )
176- return m .commandBar .Focus ()
176+ return m .inputBar .Focus ()
177177 case focusMessages :
178- m .commandBar .Blur ()
178+ m .inputBar .Blur ()
179179 m .messageList .SetFocused (true )
180180 return nil
181181 }
@@ -198,12 +198,12 @@ func (m *Model) SetOrigin(x, y int) {
198198
199199// updateLayout calculates sizes for children based on current dimensions.
200200func (m * Model ) updateLayout () {
201- // CommandBar is fixed height
202- m .commandBar .SetWidth (m .width )
203- commandBarHeight := m .commandBar .Height ()
201+ // Input bar is fixed height
202+ m .inputBar .SetWidth (m .width )
203+ inputBarHeight := m .inputBar .Height ()
204204
205205 // MessageList is flexible - gets remaining space
206- messageListHeight := m .height - commandBarHeight
206+ messageListHeight := m .height - inputBarHeight
207207 if messageListHeight < 0 {
208208 messageListHeight = 0
209209 }
@@ -214,12 +214,12 @@ func (m *Model) updateLayout() {
214214// ShortHelp returns the key bindings for the short help view.
215215func (m * Model ) ShortHelp () []key.Binding {
216216 if m .focus == focusMessages {
217- return []key.Binding {scrollUp , focusCommandBar }
217+ return []key.Binding {scrollUp , focusInputBar }
218218 }
219219 if m .hasMessages () {
220- return append (m .commandBar .ShortHelp (), focusChat )
220+ return append (m .inputBar .ShortHelp (), focusChat )
221221 }
222- return m .commandBar .ShortHelp ()
222+ return m .inputBar .ShortHelp ()
223223}
224224
225225// ConversationID returns the current conversation ID.
@@ -364,19 +364,19 @@ func (m *Model) View() string {
364364
365365 colors := m .theme .Colors
366366
367- // Empty state: centered prompt + command bar
367+ // Empty state: centered prompt + input bar
368368 if ! m .hasMessages () {
369- emptyHeight := m .height - m .commandBar .Height ()
369+ emptyHeight := m .height - m .inputBar .Height ()
370370 emptyView := lipgloss .NewStyle ().
371371 Foreground (colors .Page .TextMuted ).
372372 Width (m .width ).
373373 Height (emptyHeight ).
374374 Align (lipgloss .Center , lipgloss .Center ).
375375 Render ("Start a conversation..." )
376376
377- return lipgloss .JoinVertical (lipgloss .Left , emptyView , m .commandBar .View ())
377+ return lipgloss .JoinVertical (lipgloss .Left , emptyView , m .inputBar .View ())
378378 }
379379
380- // Normal state: message list + command bar
381- return lipgloss .JoinVertical (lipgloss .Left , m .messageList .View (), m .commandBar .View ())
380+ // Normal state: message list + input bar
381+ return lipgloss .JoinVertical (lipgloss .Left , m .messageList .View (), m .inputBar .View ())
382382}
0 commit comments