renderQueued draws the pending-prompt box shown above the divider while a turn runs: a faint title line plus a rounded panel with the collapsed echo, so the user sees what will auto-submit when the turn ends and how to recall it. Empty when nothing is queued.
()
| 122 | // runs: a faint title line plus a rounded panel with the collapsed echo, so the |
| 123 | // user sees what will auto-submit when the turn ends and how to recall it. Empty |
| 124 | // when nothing is queued. |
| 125 | func (m Model) renderQueued() string { |
| 126 | if m.queued == nil { |
| 127 | return "" |
| 128 | } |
| 129 | // Width-3 leaves the border total at width-1, matching the divider's blank |
| 130 | // last column (the macOS last-column-wrap guard in View). lipgloss wraps the |
| 131 | // body to fit the inner width. |
| 132 | inner := max(m.width-3, 1) |
| 133 | // Wrap to the box's content width (inner minus Padding(0,1)) BEFORE capping, |
| 134 | // so the cap bounds VISUAL rows: a single long echo line would otherwise |
| 135 | // soft-wrap inside lipgloss after the cap counted it as one line, and the |
| 136 | // box could still push the status bar off-screen. |
| 137 | lines := strings.Split(ansi.Wrap(m.queued.echo, max(inner-2, 1), ""), "\n") |
| 138 | extra := 0 |
| 139 | if len(lines) > queuedBodyCap { |
| 140 | extra = len(lines) - queuedBodyCap |
| 141 | lines = lines[:queuedBodyCap] |
| 142 | } |
| 143 | body := strings.Join(lines, "\n") |
| 144 | if extra > 0 { |
| 145 | body += fmt.Sprintf("\n+%d more", extra) |
| 146 | } |
| 147 | box := styleQueued.Width(inner).Render(body) |
no outgoing calls
no test coverage detected