on main help sign in
chore: small fixes
b437d0fKujtim Hoxha
internal/tui/components/chat/sidebar/sidebar.go+4−1
@@ -291,7 +291,10 @@ func (m *sidebarCmp) filesBlock() string {
291 }
291 }
292
292
293 extraContent := strings.Join(statusParts, " ")
293 extraContent := strings.Join(statusParts, " ")
294+ cwd := config.WorkingDirectory() + string(os.PathSeparator)
295+ filePath := file.FilePath
296+ filePath = strings.TrimPrefix(filePath, cwd)
294− filePath := fsext.DirTrim(fsext.PrettyPath(file.FilePath), 2)
297+ filePath = fsext.DirTrim(fsext.PrettyPath(filePath), 2)
295 filePath = ansi.Truncate(filePath, maxWidth-lipgloss.Width(extraContent)-2, "…")
298 filePath = ansi.Truncate(filePath, maxWidth-lipgloss.Width(extraContent)-2, "…")
296 fileList = append(fileList,
299 fileList = append(fileList,
297 core.Status(
300 core.Status(
internal/tui/tui.go+10
@@ -2,6 +2,7 @@ package tui
2
2
3import (
3import (
4 "context"
4 "context"
5+ "fmt"
5
6
6 "github.com/charmbracelet/bubbles/v2/key"
7 "github.com/charmbracelet/bubbles/v2/key"
7 tea "github.com/charmbracelet/bubbletea/v2"
8 tea "github.com/charmbracelet/bubbletea/v2"
@@ -175,6 +176,15 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
175 Model: compact.NewCompactDialogCmp(a.app.CoderAgent, msg.SessionID, true),
176 Model: compact.NewCompactDialogCmp(a.app.CoderAgent, msg.SessionID, true),
176 })
177 })
177
178
179+ // Model Switch
180+ case models.ModelSelectedMsg:
181+ model, err := a.app.CoderAgent.Update(config.AgentCoder, msg.Model.ID)
182+ if err != nil {
183+ return a, util.ReportError(err)
184+ }
185+
186+ return a, util.ReportInfo(fmt.Sprintf("Model changed to %s", model.Name))
187+
178 // File Picker
188 // File Picker
179 case chat.OpenFilePickerMsg:
189 case chat.OpenFilePickerMsg:
180 if a.dialog.ActiveDialogID() == filepicker.FilePickerID {
190 if a.dialog.ActiveDialogID() == filepicker.FilePickerID {