on main help sign in
chore: some cleanup
commit614b0bc970f6b82584d0e9159e57a522e3077d4b authorKujtim Hoxha <kujtimii.h@gmail.com> dateTue 6 Jan 2026, 15:34 (9 months ago) parentc0e3f79
4 files changed+23−25
internal/ui/chat/agent.go+4−12 internal/ui/chat/tools.go+4−4 internal/ui/dialog/models_list.go+9−9 internal/ui/styles/styles.go+6
internal/ui/chat/agent.go+4−12
@@ -120,7 +120,7 @@ func (r *AgentToolRenderContext) RenderTool(sty *styles.Styles, width int, opts
120120 taskTagWidth := lipgloss.Width(taskTag)
121121
122122 // 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
124124
125125 promptText := sty.Tool.AgentPrompt.Width(remainingWidth).Render(prompt)
126126
@@ -253,21 +253,13 @@ func (r *AgenticFetchToolRenderContext) RenderTool(sty *styles.Styles, width int
253253 }
254254
255255 // Build the prompt tag.
256− promptTag := sty.Base.Bold(true).
257− Padding(0, 1).
258− MarginLeft(2).
259− Background(sty.Green).
260− Foreground(sty.Border).
261− Render("Prompt")
256+ promptTag := sty.Tool.AgenticFetchPromptTag.Render("Prompt")
262257 promptTagWidth := lipgloss.Width(promptTag)
263258
264259 // Calculate remaining width for prompt text.
265− remainingWidth := cappedWidth - promptTagWidth - 3 // -3 for spacing
266− if remainingWidth > 120-promptTagWidth-3 {
267− remainingWidth = 120 - promptTagWidth - 3
268− }
260+ remainingWidth := min(cappedWidth-promptTagWidth-3, maxTextWidth-promptTagWidth-3) // -3 for spacing
269261
270− promptText := sty.Base.Width(remainingWidth).Render(prompt)
262+ promptText := sty.Tool.AgentPrompt.Width(remainingWidth).Render(prompt)
271263
272264 header = lipgloss.JoinVertical(
273265 lipgloss.Left,
internal/ui/chat/tools.go+4−4
@@ -634,7 +634,7 @@ func toolOutputDiffContent(sty *styles.Styles, file, oldContent, newContent stri
634634 Width(bodyWidth)
635635
636636 // Use split view for wide terminals.
637− if width > 120 {
637+ if width > maxTextWidth {
638638 formatter = formatter.Split()
639639 }
640640
@@ -684,7 +684,7 @@ func toolOutputMultiEditDiffContent(sty *styles.Styles, file string, meta tools.
684684 Width(bodyWidth)
685685
686686 // Use split view for wide terminals.
687− if width > 120 {
687+ if width > maxTextWidth {
688688 formatter = formatter.Split()
689689 }
690690
@@ -740,8 +740,8 @@ func toolOutputMarkdownContent(sty *styles.Styles, content string, width int, ex
740740 content = strings.TrimSpace(content)
741741
742742 // Cap width for readability.
743− if width > 120 {
744− width = 120
743+ if width > maxTextWidth {
744+ width = maxTextWidth
745745 }
746746
747747 renderer := common.PlainMarkdownRenderer(sty, width)
internal/ui/dialog/models_list.go+9−9
@@ -68,7 +68,7 @@ func (f *ModelsList) SetSelected(index int) {
6868
6969 f.List.SetSelected(index)
7070 for {
71− selectedItem := f.List.SelectedItem()
71+ selectedItem := f.SelectedItem()
7272 if _, ok := selectedItem.(*ModelItem); ok {
7373 return
7474 }
@@ -104,7 +104,7 @@ func (f *ModelsList) SetSelectedItem(itemID string) {
104104func (f *ModelsList) SelectNext() (v bool) {
105105 for {
106106 v = f.List.SelectNext()
107− selectedItem := f.List.SelectedItem()
107+ selectedItem := f.SelectedItem()
108108 if _, ok := selectedItem.(*ModelItem); ok {
109109 return v
110110 }
@@ -116,7 +116,7 @@ func (f *ModelsList) SelectNext() (v bool) {
116116func (f *ModelsList) SelectPrev() (v bool) {
117117 for {
118118 v = f.List.SelectPrev()
119− selectedItem := f.List.SelectedItem()
119+ selectedItem := f.SelectedItem()
120120 if _, ok := selectedItem.(*ModelItem); ok {
121121 return v
122122 }
@@ -127,7 +127,7 @@ func (f *ModelsList) SelectPrev() (v bool) {
127127func (f *ModelsList) SelectFirst() (v bool) {
128128 v = f.List.SelectFirst()
129129 for {
130− selectedItem := f.List.SelectedItem()
130+ selectedItem := f.SelectedItem()
131131 if _, ok := selectedItem.(*ModelItem); ok {
132132 return v
133133 }
@@ -139,7 +139,7 @@ func (f *ModelsList) SelectFirst() (v bool) {
139139func (f *ModelsList) SelectLast() (v bool) {
140140 v = f.List.SelectLast()
141141 for {
142− selectedItem := f.List.SelectedItem()
142+ selectedItem := f.SelectedItem()
143143 if _, ok := selectedItem.(*ModelItem); ok {
144144 return v
145145 }
@@ -149,18 +149,18 @@ func (f *ModelsList) SelectLast() (v bool) {
149149
150150// IsSelectedFirst checks if the selected item is the first model item.
151151func (f *ModelsList) IsSelectedFirst() bool {
152− originalIndex := f.List.Selected()
152+ originalIndex := f.Selected()
153153 f.SelectFirst()
154− isFirst := f.List.Selected() == originalIndex
154+ isFirst := f.Selected() == originalIndex
155155 f.List.SetSelected(originalIndex)
156156 return isFirst
157157}
158158
159159// IsSelectedLast checks if the selected item is the last model item.
160160func (f *ModelsList) IsSelectedLast() bool {
161− originalIndex := f.List.Selected()
161+ originalIndex := f.Selected()
162162 f.SelectLast()
163− isLast := f.List.Selected() == originalIndex
163+ isLast := f.Selected() == originalIndex
164164 f.List.SetSelected(originalIndex)
165165 return isLast
166166}
internal/ui/styles/styles.go+6
@@ -279,6 +279,9 @@ type Styles struct {
279279 AgentTaskTag lipgloss.Style // Agent task tag (blue background, bold)
280280 AgentPrompt lipgloss.Style // Agent prompt text
281281
282+ // Agentic fetch styles
283+ AgenticFetchPromptTag lipgloss.Style // Agentic fetch prompt tag (green background, bold)
284+
282285 // Todo styles
283286 TodoRatio lipgloss.Style // Todo ratio (e.g., "2/5")
284287 TodoCompletedIcon lipgloss.Style // Completed todo icon
@@ -1012,6 +1015,9 @@ func DefaultStyles() Styles {
10121015 s.Tool.AgentTaskTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(blueLight).Foreground(white)
10131016 s.Tool.AgentPrompt = s.Muted
10141017
1018+ // Agentic fetch styles
1019+ s.Tool.AgenticFetchPromptTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(green).Foreground(border)
1020+
10151021 // Todo styles
10161022 s.Tool.TodoRatio = base.Foreground(blueDark)
10171023 s.Tool.TodoCompletedIcon = base.Foreground(green)