on main help sign in
fix(ui): replace TODO placeholders with user-friendly messages

- DefaultToolRenderContext.RenderTool: show styled 'Unknown tool: <name>' instead of raw 'TODO: Implement Tool Renderer For: <name>' - runMCPPrompt: include clientID and promptID in error message instead of bare 'TODO: make this better' comment - ShortHelp: add uiLanding case with useful keybindings (tab, commands, models, newline, new session) instead of falling through to default - sessions dialog: replace context.TODO() with context.Background() (3 instances) — TODO context is for undecided contexts, Background is correct for operations not needing cancellation

commit03980179ebf5fdc4682d7487c9989766bf83e394 authoriko <mail@iko.soy> dateWed 8 Jul 2026, 20:55 (3 months ago) parent9f93030
3 files changed+14−7
internal/ui/chat/tools.go+1−1 internal/ui/dialog/sessions.go+3−3 internal/ui/model/ui.go+10−3
internal/ui/chat/tools.go+1−1
@@ -91,7 +91,7 @@ type DefaultToolRenderContext struct{}
9191
9292// RenderTool implements the [ToolRenderer] interface.
9393func (d *DefaultToolRenderContext) RenderTool(sty *styles.Styles, width int, opts *ToolRenderOpts) string {
94− return "TODO: Implement Tool Renderer For: " + opts.ToolCall.Name
94+ return sty.Messages.AssistantBlurred.Render(fmt.Sprintf("Unknown tool: %s", opts.ToolCall.Name))
9595}
9696
9797// ToolRenderOpts contains the data needed to render a tool call.
internal/ui/dialog/sessions.go+3−3
@@ -61,7 +61,7 @@ func NewSessions(com *common.Common, selectedSessionID string) (*Session, error)
6161 s := new(Session)
6262 s.sessionsMode = sessionsModeNormal
6363 s.com = com
64− sessions, err := com.Workspace.ListSessions(context.TODO())
64+ sessions, err := com.Workspace.ListSessions(context.Background())
6565 if err != nil {
6666 return nil, err
6767 }
@@ -358,7 +358,7 @@ func (s *Session) removeSession(id string) {
358358
359359func (s *Session) deleteSessionCmd(id string) tea.Cmd {
360360 return func() tea.Msg {
361− err := s.com.Workspace.DeleteSession(context.TODO(), id)
361+ err := s.com.Workspace.DeleteSession(context.Background(), id)
362362 if err != nil {
363363 return util.NewErrorMsg(err)
364364 }
@@ -394,7 +394,7 @@ func (s *Session) updateSession(session session.Session) {
394394
395395func (s *Session) updateSessionCmd(session session.Session) tea.Cmd {
396396 return func() tea.Msg {
397− _, err := s.com.Workspace.SaveSession(context.TODO(), session)
397+ _, err := s.com.Workspace.SaveSession(context.Background(), session)
398398 if err != nil {
399399 return util.NewErrorMsg(err)
400400 }
internal/ui/model/ui.go+10−3
@@ -2752,8 +2752,16 @@ func (m *UI) ShortHelp() []key.Binding {
27522752 binds = append(binds, k.Chat.PillLeft)
27532753 }
27542754 }
2755+ case uiLanding:
2756+ binds = append(
2757+ binds,
2758+ tab,
2759+ commands,
2760+ k.Models,
2761+ k.Editor.Newline,
2762+ k.Chat.NewSession,
2763+ )
27552764 default:
2756− // TODO: other states
27572765 // if m.session == nil {
27582766 // no session selected
27592767 binds = append(
@@ -4413,8 +4421,7 @@ func (m *UI) runMCPPrompt(clientID, promptID string, arguments map[string]string
44134421 load := func() tea.Msg {
44144422 prompt, err := m.com.Workspace.GetMCPPrompt(clientID, promptID, arguments)
44154423 if err != nil {
4416− // TODO: make this better
4417− return util.ReportError(err)()
4424+ return util.ReportError(fmt.Errorf("failed to load MCP prompt %q from %q: %w", promptID, clientID, err))()
44184425 }
44194426
44204427 if prompt == "" {