()
| 1074 | } |
| 1075 | |
| 1076 | func (m harness) inputArea() string { |
| 1077 | w := m.width - 2 |
| 1078 | if w < 20 { |
| 1079 | w = 20 |
| 1080 | } |
| 1081 | if m.state == stateAwaitingApproval { |
| 1082 | prompt := lipgloss.NewStyle().Foreground(lipgloss.Color("220")).Bold(true).Render(" ? ") |
| 1083 | box := lipgloss.NewStyle(). |
| 1084 | Border(lipgloss.RoundedBorder()). |
| 1085 | BorderForeground(lipgloss.Color("220")). |
| 1086 | Padding(0, 1). |
| 1087 | Width(w). |
| 1088 | Render(prompt + m.approvalPrompt + Dimmed(" (y/n)")) |
| 1089 | hint := Dimmed(" y: yes · n / esc / enter: no") |
| 1090 | return box + "\n" + hint |
| 1091 | } |
| 1092 | |
| 1093 | inputBorder := lipgloss.Color("36") |
| 1094 | if m.debugFocus { |
| 1095 | // Dim the input border when the debug panel has focus so it's |
| 1096 | // obvious where keystrokes are going. |
| 1097 | inputBorder = lipgloss.Color("240") |
| 1098 | } |
| 1099 | box := lipgloss.NewStyle(). |
| 1100 | Border(lipgloss.RoundedBorder()). |
| 1101 | BorderForeground(inputBorder). |
| 1102 | Padding(0, 1). |
| 1103 | Width(w). |
| 1104 | Render(m.input.View()) |
| 1105 | hint := Dimmed(m.hintText()) |
| 1106 | |
| 1107 | // One line above the input box is always reserved. Priority order: |
| 1108 | // running agent → spinner + thinking message |
| 1109 | // MCP loading → spinner + "connecting MCP…" while servers connect |
| 1110 | // idle → token-usage summary, if any |
| 1111 | statusLine := "" |
| 1112 | switch { |
| 1113 | case m.state == stateRunning: |
| 1114 | statusLine = " " + m.spinner.View() + " " + Dimmed("thinking..."+activeSubagentSummary()) |
| 1115 | case m.mcpLoading: |
| 1116 | statusLine = " " + m.spinner.View() + " " + Dimmed(m.mcpStatusText()) |
| 1117 | case m.state == stateIdle: |
| 1118 | statusLine = " " + Dimmed(m.usageStatus()) |
| 1119 | } |
| 1120 | return statusLine + "\n" + box + "\n" + hint |
| 1121 | } |
| 1122 | |
| 1123 | // mcpStatusText formats the loading line shown next to the spinner while |
| 1124 | // background MCP servers are being connected. Empty when nothing's in |
no test coverage detected