diff options
| author | adamdotdevin <[email protected]> | 2025-07-15 08:07:20 -0500 |
|---|---|---|
| committer | adamdotdevin <[email protected]> | 2025-07-15 08:07:26 -0500 |
| commit | 533f64fe265d428aa711e1c14b909fe72376446f (patch) | |
| tree | 6c9d2e5658e25022594736970006782ef1717438 /packages/tui/internal/components/chat | |
| parent | b5c85d38066728e025f5a05abb90e39ed6836b1c (diff) | |
| download | opencode-533f64fe265d428aa711e1c14b909fe72376446f.tar.gz opencode-533f64fe265d428aa711e1c14b909fe72376446f.zip | |
fix(tui): rework lists and search dialog
Diffstat (limited to 'packages/tui/internal/components/chat')
| -rw-r--r-- | packages/tui/internal/components/chat/editor.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/tui/internal/components/chat/editor.go b/packages/tui/internal/components/chat/editor.go index d5f6facab..67f1f75ea 100644 --- a/packages/tui/internal/components/chat/editor.go +++ b/packages/tui/internal/components/chat/editor.go @@ -142,9 +142,9 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.spinner = createSpinner() return m, tea.Batch(m.spinner.Tick, m.textarea.Focus()) case dialog.CompletionSelectedMsg: - switch msg.Item.GetProviderID() { + switch msg.Item.ProviderID { case "commands": - commandName := strings.TrimPrefix(msg.Item.GetValue(), "/") + commandName := strings.TrimPrefix(msg.Item.Value, "/") updated, cmd := m.Clear() m = updated.(*editorComponent) cmds = append(cmds, cmd) @@ -154,7 +154,7 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) { atIndex := m.textarea.LastRuneIndex('@') if atIndex == -1 { // Should not happen, but as a fallback, just insert. - m.textarea.InsertString(msg.Item.GetValue() + " ") + m.textarea.InsertString(msg.Item.Value + " ") return m, nil } @@ -165,7 +165,7 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // Now, insert the attachment at the position where the '@' was. // The cursor is now at `atIndex` after the replacement. - filePath := msg.Item.GetValue() + filePath := msg.Item.Value extension := filepath.Ext(filePath) mediaType := "" switch extension { @@ -192,20 +192,20 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) { atIndex := m.textarea.LastRuneIndex('@') if atIndex == -1 { // Should not happen, but as a fallback, just insert. - m.textarea.InsertString(msg.Item.GetValue() + " ") + m.textarea.InsertString(msg.Item.Value + " ") return m, nil } cursorCol := m.textarea.CursorColumn() m.textarea.ReplaceRange(atIndex, cursorCol, "") - symbol := msg.Item.GetRaw().(opencode.Symbol) + symbol := msg.Item.RawData.(opencode.Symbol) parts := strings.Split(symbol.Name, ".") lastPart := parts[len(parts)-1] attachment := &textarea.Attachment{ ID: uuid.NewString(), Display: "@" + lastPart, - URL: msg.Item.GetValue(), + URL: msg.Item.Value, Filename: lastPart, MediaType: "text/plain", } @@ -213,7 +213,7 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.textarea.InsertString(" ") return m, nil default: - slog.Debug("Unknown provider", "provider", msg.Item.GetProviderID()) + slog.Debug("Unknown provider", "provider", msg.Item.ProviderID) return m, nil } } |
