on main help sign in
chore: some cleanup
614b0bcKujtim Hoxha
internal/ui/chat/agent.go+4−12
@@ -120,7 +120,7 @@ func (r *AgentToolRenderContext) RenderTool(sty *styles.Styles, width int, opts
120 taskTagWidth := lipgloss.Width(taskTag)
120 taskTagWidth := lipgloss.Width(taskTag)
121
121
122 // Calculate remaining width for prompt.
122 // Calculate remaining width for prompt.
123− remainingWidth := min(cappedWidth-taskTagWidth-3, 120-taskTagWidth-3) // -3 for spacing
123+ remainingWidth := min(cappedWidth-taskTagWidth-3, maxTextWidth-taskTagWidth-3) // -3 for spacing
124
124
125 promptText := sty.Tool.AgentPrompt.Width(remainingWidth).Render(prompt)
125 promptText := sty.Tool.AgentPrompt.Width(remainingWidth).Render(prompt)
126
126
@@ -253,21 +253,13 @@ func (r *AgenticFetchToolRenderContext) RenderTool(sty *styles.Styles, width int
253 }
253 }
254
254
255 // Build the prompt tag.
255 // Build the prompt tag.
256− promptTag := sty.Base.Bold(true).
256+ promptTag := sty.Tool.AgenticFetchPromptTag.Render("Prompt")
257− Padding(0, 1).
258− MarginLeft(2).
259− Background(sty.Green).
260− Foreground(sty.Border).
261− Render("Prompt")
262 promptTagWidth := lipgloss.Width(promptTag)
257 promptTagWidth := lipgloss.Width(promptTag)
263
258
264 // Calculate remaining width for prompt text.
259 // Calculate remaining width for prompt text.
265− remainingWidth := cappedWidth - promptTagWidth - 3 // -3 for spacing
260+ remainingWidth := min(cappedWidth-promptTagWidth-3, maxTextWidth-promptTagWidth-3) // -3 for spacing
266− if remainingWidth > 120-promptTagWidth-3 {
267− remainingWidth = 120 - promptTagWidth - 3
268− }
269
261
270− promptText := sty.Base.Width(remainingWidth).Render(prompt)
262+ promptText := sty.Tool.AgentPrompt.Width(remainingWidth).Render(prompt)
271
263
272 header = lipgloss.JoinVertical(
264 header = lipgloss.JoinVertical(
273 lipgloss.Left,
265 lipgloss.Left,
internal/ui/chat/tools.go+4−4
@@ -634,7 +634,7 @@ func toolOutputDiffContent(sty *styles.Styles, file, oldContent, newContent stri
634 Width(bodyWidth)
634 Width(bodyWidth)
635
635
636 // Use split view for wide terminals.
636 // Use split view for wide terminals.
637− if width > 120 {
637+ if width > maxTextWidth {
638 formatter = formatter.Split()
638 formatter = formatter.Split()
639 }
639 }
640
640
@@ -684,7 +684,7 @@ func toolOutputMultiEditDiffContent(sty *styles.Styles, file string, meta tools.
684 Width(bodyWidth)
684 Width(bodyWidth)
685
685
686 // Use split view for wide terminals.
686 // Use split view for wide terminals.
687− if width > 120 {
687+ if width > maxTextWidth {
688 formatter = formatter.Split()
688 formatter = formatter.Split()
689 }
689 }
690
690
@@ -740,8 +740,8 @@ func toolOutputMarkdownContent(sty *styles.Styles, content string, width int, ex
740 content = strings.TrimSpace(content)
740 content = strings.TrimSpace(content)
741
741
742 // Cap width for readability.
742 // Cap width for readability.
743− if width > 120 {
743+ if width > maxTextWidth {
744− width = 120
744+ width = maxTextWidth
745 }
745 }
746
746
747 renderer := common.PlainMarkdownRenderer(sty, width)
747 renderer := common.PlainMarkdownRenderer(sty, width)
internal/ui/dialog/models_list.go+9−9
@@ -68,7 +68,7 @@ func (f *ModelsList) SetSelected(index int) {
68
68
69 f.List.SetSelected(index)
69 f.List.SetSelected(index)
70 for {
70 for {
71− selectedItem := f.List.SelectedItem()
71+ selectedItem := f.SelectedItem()
72 if _, ok := selectedItem.(*ModelItem); ok {
72 if _, ok := selectedItem.(*ModelItem); ok {
73 return
73 return
74 }
74 }
@@ -104,7 +104,7 @@ func (f *ModelsList) SetSelectedItem(itemID string) {
104func (f *ModelsList) SelectNext() (v bool) {
104func (f *ModelsList) SelectNext() (v bool) {
105 for {
105 for {
106 v = f.List.SelectNext()
106 v = f.List.SelectNext()
107− selectedItem := f.List.SelectedItem()
107+ selectedItem := f.SelectedItem()
108 if _, ok := selectedItem.(*ModelItem); ok {
108 if _, ok := selectedItem.(*ModelItem); ok {
109 return v
109 return v
110 }
110 }
@@ -116,7 +116,7 @@ func (f *ModelsList) SelectNext() (v bool) {
116func (f *ModelsList) SelectPrev() (v bool) {
116func (f *ModelsList) SelectPrev() (v bool) {
117 for {
117 for {
118 v = f.List.SelectPrev()
118 v = f.List.SelectPrev()
119− selectedItem := f.List.SelectedItem()
119+ selectedItem := f.SelectedItem()
120 if _, ok := selectedItem.(*ModelItem); ok {
120 if _, ok := selectedItem.(*ModelItem); ok {
121 return v
121 return v
122 }
122 }
@@ -127,7 +127,7 @@ func (f *ModelsList) SelectPrev() (v bool) {
127func (f *ModelsList) SelectFirst() (v bool) {
127func (f *ModelsList) SelectFirst() (v bool) {
128 v = f.List.SelectFirst()
128 v = f.List.SelectFirst()
129 for {
129 for {
130− selectedItem := f.List.SelectedItem()
130+ selectedItem := f.SelectedItem()
131 if _, ok := selectedItem.(*ModelItem); ok {
131 if _, ok := selectedItem.(*ModelItem); ok {
132 return v
132 return v
133 }
133 }
@@ -139,7 +139,7 @@ func (f *ModelsList) SelectFirst() (v bool) {
139func (f *ModelsList) SelectLast() (v bool) {
139func (f *ModelsList) SelectLast() (v bool) {
140 v = f.List.SelectLast()
140 v = f.List.SelectLast()
141 for {
141 for {
142− selectedItem := f.List.SelectedItem()
142+ selectedItem := f.SelectedItem()
143 if _, ok := selectedItem.(*ModelItem); ok {
143 if _, ok := selectedItem.(*ModelItem); ok {
144 return v
144 return v
145 }
145 }
@@ -149,18 +149,18 @@ func (f *ModelsList) SelectLast() (v bool) {
149
149
150// IsSelectedFirst checks if the selected item is the first model item.
150// IsSelectedFirst checks if the selected item is the first model item.
151func (f *ModelsList) IsSelectedFirst() bool {
151func (f *ModelsList) IsSelectedFirst() bool {
152− originalIndex := f.List.Selected()
152+ originalIndex := f.Selected()
153 f.SelectFirst()
153 f.SelectFirst()
154− isFirst := f.List.Selected() == originalIndex
154+ isFirst := f.Selected() == originalIndex
155 f.List.SetSelected(originalIndex)
155 f.List.SetSelected(originalIndex)
156 return isFirst
156 return isFirst
157}
157}
158
158
159// IsSelectedLast checks if the selected item is the last model item.
159// IsSelectedLast checks if the selected item is the last model item.
160func (f *ModelsList) IsSelectedLast() bool {
160func (f *ModelsList) IsSelectedLast() bool {
161− originalIndex := f.List.Selected()
161+ originalIndex := f.Selected()
162 f.SelectLast()
162 f.SelectLast()
163− isLast := f.List.Selected() == originalIndex
163+ isLast := f.Selected() == originalIndex
164 f.List.SetSelected(originalIndex)
164 f.List.SetSelected(originalIndex)
165 return isLast
165 return isLast
166}
166}
internal/ui/styles/styles.go+6
@@ -279,6 +279,9 @@ type Styles struct {
279 AgentTaskTag lipgloss.Style // Agent task tag (blue background, bold)
279 AgentTaskTag lipgloss.Style // Agent task tag (blue background, bold)
280 AgentPrompt lipgloss.Style // Agent prompt text
280 AgentPrompt lipgloss.Style // Agent prompt text
281
281
282+ // Agentic fetch styles
283+ AgenticFetchPromptTag lipgloss.Style // Agentic fetch prompt tag (green background, bold)
284+
282 // Todo styles
285 // Todo styles
283 TodoRatio lipgloss.Style // Todo ratio (e.g., "2/5")
286 TodoRatio lipgloss.Style // Todo ratio (e.g., "2/5")
284 TodoCompletedIcon lipgloss.Style // Completed todo icon
287 TodoCompletedIcon lipgloss.Style // Completed todo icon
@@ -1012,6 +1015,9 @@ func DefaultStyles() Styles {
1012 s.Tool.AgentTaskTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(blueLight).Foreground(white)
1015 s.Tool.AgentTaskTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(blueLight).Foreground(white)
1013 s.Tool.AgentPrompt = s.Muted
1016 s.Tool.AgentPrompt = s.Muted
1014
1017
1018+ // Agentic fetch styles
1019+ s.Tool.AgenticFetchPromptTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(green).Foreground(border)
1020+
1015 // Todo styles
1021 // Todo styles
1016 s.Tool.TodoRatio = base.Foreground(blueDark)
1022 s.Tool.TodoRatio = base.Foreground(blueDark)
1017 s.Tool.TodoCompletedIcon = base.Foreground(green)
1023 s.Tool.TodoCompletedIcon = base.Foreground(green)