summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/components/chat
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-16 15:58:46 -0500
committeradamdottv <[email protected]>2025-06-16 15:58:52 -0500
commitd6d45bdc6388dcc7e5e5248c6b4645d90159bb18 (patch)
tree011b8409874bcda6d39ae10cfb3bdd2c0bbc956c /packages/tui/internal/components/chat
parent13a83721b076a1201a049ca1e4cebae8896da55b (diff)
downloadopencode-d6d45bdc6388dcc7e5e5248c6b4645d90159bb18.tar.gz
opencode-d6d45bdc6388dcc7e5e5248c6b4645d90159bb18.zip
feat: share and init commands
Diffstat (limited to 'packages/tui/internal/components/chat')
-rw-r--r--packages/tui/internal/components/chat/editor.go18
1 files changed, 12 insertions, 6 deletions
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{