MCPcopy
hub / github.com/docker/docker-agent / queueSection

Method queueSection

pkg/tui/components/sidebar/sidebar.go:1172–1199  ·  view source on GitHub ↗

queueSection renders the queued messages section

(contentWidth int)

Source from the content-addressed store, hash-verified

1170
1171// queueSection renders the queued messages section
1172func (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

Calls 3

renderTabMethod · 0.95
TruncateTextFunction · 0.92
RenderMethod · 0.65