diff --git a/internal/ui/chat/agent.go b/internal/ui/chat/agent.go index 75c936a92ddfd1c75e9b2e49ec9ef7ee46f08ddf..baa9633623be16fab85d5e0b7b190a4173f1be15 100644 --- a/internal/ui/chat/agent.go +++ b/internal/ui/chat/agent.go @@ -120,7 +120,7 @@ func (r *AgentToolRenderContext) RenderTool(sty *styles.Styles, width int, opts taskTagWidth := lipgloss.Width(taskTag) // Calculate remaining width for prompt. - remainingWidth := min(cappedWidth-taskTagWidth-3, 120-taskTagWidth-3) // -3 for spacing + remainingWidth := min(cappedWidth-taskTagWidth-3, maxTextWidth-taskTagWidth-3) // -3 for spacing promptText := sty.Tool.AgentPrompt.Width(remainingWidth).Render(prompt) @@ -253,21 +253,13 @@ func (r *AgenticFetchToolRenderContext) RenderTool(sty *styles.Styles, width int } // Build the prompt tag. - promptTag := sty.Base.Bold(true). - Padding(0, 1). - MarginLeft(2). - Background(sty.Green). - Foreground(sty.Border). - Render("Prompt") + promptTag := sty.Tool.AgenticFetchPromptTag.Render("Prompt") promptTagWidth := lipgloss.Width(promptTag) // Calculate remaining width for prompt text. - remainingWidth := cappedWidth - promptTagWidth - 3 // -3 for spacing - if remainingWidth > 120-promptTagWidth-3 { - remainingWidth = 120 - promptTagWidth - 3 - } + remainingWidth := min(cappedWidth-promptTagWidth-3, maxTextWidth-promptTagWidth-3) // -3 for spacing - promptText := sty.Base.Width(remainingWidth).Render(prompt) + promptText := sty.Tool.AgentPrompt.Width(remainingWidth).Render(prompt) header = lipgloss.JoinVertical( lipgloss.Left, diff --git a/internal/ui/chat/tools.go b/internal/ui/chat/tools.go index d336e6405ba2129b4c173bdf5a90154ae6c9c23f..abed4d12174f8e4b5b1c98d84fa92fbd7b7230c9 100644 --- a/internal/ui/chat/tools.go +++ b/internal/ui/chat/tools.go @@ -634,7 +634,7 @@ func toolOutputDiffContent(sty *styles.Styles, file, oldContent, newContent stri Width(bodyWidth) // Use split view for wide terminals. - if width > 120 { + if width > maxTextWidth { formatter = formatter.Split() } @@ -684,7 +684,7 @@ func toolOutputMultiEditDiffContent(sty *styles.Styles, file string, meta tools. Width(bodyWidth) // Use split view for wide terminals. - if width > 120 { + if width > maxTextWidth { formatter = formatter.Split() } @@ -740,8 +740,8 @@ func toolOutputMarkdownContent(sty *styles.Styles, content string, width int, ex content = strings.TrimSpace(content) // Cap width for readability. - if width > 120 { - width = 120 + if width > maxTextWidth { + width = maxTextWidth } renderer := common.PlainMarkdownRenderer(sty, width) diff --git a/internal/ui/dialog/models_list.go b/internal/ui/dialog/models_list.go index 61541277e3b4e81aac9e839a6e3a52480347e31a..bbd4dafad3591db2e62624243fd9ae919bed5206 100644 --- a/internal/ui/dialog/models_list.go +++ b/internal/ui/dialog/models_list.go @@ -68,7 +68,7 @@ func (f *ModelsList) SetSelected(index int) { f.List.SetSelected(index) for { - selectedItem := f.List.SelectedItem() + selectedItem := f.SelectedItem() if _, ok := selectedItem.(*ModelItem); ok { return } @@ -104,7 +104,7 @@ func (f *ModelsList) SetSelectedItem(itemID string) { func (f *ModelsList) SelectNext() (v bool) { for { v = f.List.SelectNext() - selectedItem := f.List.SelectedItem() + selectedItem := f.SelectedItem() if _, ok := selectedItem.(*ModelItem); ok { return v } @@ -116,7 +116,7 @@ func (f *ModelsList) SelectNext() (v bool) { func (f *ModelsList) SelectPrev() (v bool) { for { v = f.List.SelectPrev() - selectedItem := f.List.SelectedItem() + selectedItem := f.SelectedItem() if _, ok := selectedItem.(*ModelItem); ok { return v } @@ -127,7 +127,7 @@ func (f *ModelsList) SelectPrev() (v bool) { func (f *ModelsList) SelectFirst() (v bool) { v = f.List.SelectFirst() for { - selectedItem := f.List.SelectedItem() + selectedItem := f.SelectedItem() if _, ok := selectedItem.(*ModelItem); ok { return v } @@ -139,7 +139,7 @@ func (f *ModelsList) SelectFirst() (v bool) { func (f *ModelsList) SelectLast() (v bool) { v = f.List.SelectLast() for { - selectedItem := f.List.SelectedItem() + selectedItem := f.SelectedItem() if _, ok := selectedItem.(*ModelItem); ok { return v } @@ -149,18 +149,18 @@ func (f *ModelsList) SelectLast() (v bool) { // IsSelectedFirst checks if the selected item is the first model item. func (f *ModelsList) IsSelectedFirst() bool { - originalIndex := f.List.Selected() + originalIndex := f.Selected() f.SelectFirst() - isFirst := f.List.Selected() == originalIndex + isFirst := f.Selected() == originalIndex f.List.SetSelected(originalIndex) return isFirst } // IsSelectedLast checks if the selected item is the last model item. func (f *ModelsList) IsSelectedLast() bool { - originalIndex := f.List.Selected() + originalIndex := f.Selected() f.SelectLast() - isLast := f.List.Selected() == originalIndex + isLast := f.Selected() == originalIndex f.List.SetSelected(originalIndex) return isLast } diff --git a/internal/ui/styles/styles.go b/internal/ui/styles/styles.go index d7d8d6d8a38432b77b8ce49e7d04961a6e489cc8..077de541f5a4f40615765166cd4446acc2678429 100644 --- a/internal/ui/styles/styles.go +++ b/internal/ui/styles/styles.go @@ -279,6 +279,9 @@ type Styles struct { AgentTaskTag lipgloss.Style // Agent task tag (blue background, bold) AgentPrompt lipgloss.Style // Agent prompt text + // Agentic fetch styles + AgenticFetchPromptTag lipgloss.Style // Agentic fetch prompt tag (green background, bold) + // Todo styles TodoRatio lipgloss.Style // Todo ratio (e.g., "2/5") TodoCompletedIcon lipgloss.Style // Completed todo icon @@ -1012,6 +1015,9 @@ func DefaultStyles() Styles { s.Tool.AgentTaskTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(blueLight).Foreground(white) s.Tool.AgentPrompt = s.Muted + // Agentic fetch styles + s.Tool.AgenticFetchPromptTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(green).Foreground(border) + // Todo styles s.Tool.TodoRatio = base.Foreground(blueDark) s.Tool.TodoCompletedIcon = base.Foreground(green)