graphViewTurnLabel renders a short, role-prefixed label for a turn node.
(role, content string)
| 214 | |
| 215 | // graphViewTurnLabel renders a short, role-prefixed label for a turn node. |
| 216 | func graphViewTurnLabel(role, content string) string { |
| 217 | first := content |
| 218 | if i := strings.IndexByte(first, '\n'); i >= 0 { |
| 219 | first = first[:i] |
| 220 | } |
| 221 | first = strings.TrimSpace(first) |
| 222 | prefix := "•" |
| 223 | switch role { |
| 224 | case "user": |
| 225 | prefix = "▸" |
| 226 | case "assistant": |
| 227 | prefix = "◆" |
| 228 | } |
| 229 | if first == "" { |
| 230 | first = "(tool call)" |
| 231 | } |
| 232 | return prefix + " " + truncateForLog(first, 48) |
| 233 | } |
no test coverage detected