From d6d45bdc6388dcc7e5e5248c6b4645d90159bb18 Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:58:46 -0500 Subject: feat: share and init commands --- packages/tui/internal/components/chat/editor.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'packages/tui/internal/components/chat') diff --git a/packages/tui/internal/components/chat/editor.go b/packages/tui/internal/components/chat/editor.go index 3c005a32e..349087fbe 100644 --- a/packages/tui/internal/components/chat/editor.go +++ b/packages/tui/internal/components/chat/editor.go @@ -101,6 +101,8 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case dialog.ThemeChangedMsg: m.textarea = createTextArea(&m.textarea) + m.spinner = createSpinner() + return m, m.spinner.Tick case dialog.CompletionSelectedMsg: if msg.IsCommand { // Execute the command directly @@ -421,12 +423,8 @@ func createTextArea(existing *textarea.Model) textarea.Model { return ta } -func (m *editorComponent) GetValue() string { - return m.textarea.Value() -} - -func NewEditorComponent(app *app.App) layout.ModelWithView { - s := spinner.New( +func createSpinner() spinner.Model { + return spinner.New( spinner.WithSpinner(spinner.Ellipsis), spinner.WithStyle( styles. @@ -434,6 +432,14 @@ func NewEditorComponent(app *app.App) layout.ModelWithView { Background(theme.CurrentTheme().Background()). Width(3)), ) +} + +func (m *editorComponent) GetValue() string { + return m.textarea.Value() +} + +func NewEditorComponent(app *app.App) layout.ModelWithView { + s := createSpinner() ta := createTextArea(nil) return &editorComponent{ -- cgit v1.2.3