queueSection renders the queued messages section
(contentWidth int)
| 1170 | |
| 1171 | // queueSection renders the queued messages section |
| 1172 | func (m *model) queueSection(contentWidth int) string { |
| 1173 | if len(m.queuedMessages) == 0 { |
| 1174 | return "" |
| 1175 | } |
| 1176 | |
| 1177 | maxMsgWidth := contentWidth - treePrefixWidth |
| 1178 | var lines []string |
| 1179 | |
| 1180 | for i, msg := range m.queuedMessages { |
| 1181 | // Determine prefix based on position |
| 1182 | var prefix string |
| 1183 | if i == len(m.queuedMessages)-1 { |
| 1184 | prefix = styles.MutedStyle.Render("└ ") |
| 1185 | } else { |
| 1186 | prefix = styles.MutedStyle.Render("├ ") |
| 1187 | } |
| 1188 | |
| 1189 | // Truncate message and add prefix |
| 1190 | truncated := toolcommon.TruncateText(msg, maxMsgWidth) |
| 1191 | lines = append(lines, prefix+truncated) |
| 1192 | } |
| 1193 | |
| 1194 | // Add hint for clearing |
| 1195 | lines = append(lines, styles.MutedStyle.Render(" Ctrl+X to clear")) |
| 1196 | |
| 1197 | title := fmt.Sprintf("Queue (%d)", len(m.queuedMessages)) |
| 1198 | return m.renderTab(title, strings.Join(lines, "\n"), contentWidth) |
| 1199 | } |
| 1200 | |
| 1201 | // agentInfo renders the Agents panel: every agent as a two-line entry, with a |
| 1202 | // blank separator line between entries. Line 1 shows the agent's name (in its |