()
| 105 | } |
| 106 | |
| 107 | func (m chatInputModel) View() string { |
| 108 | w := m.width - 2 |
| 109 | if w < 20 { |
| 110 | w = 20 |
| 111 | } |
| 112 | box := boxStyle.Width(w).Render(m.ti.View()) |
| 113 | hint := hintStyle.Render(" enter: send · ↑↓: history · ctrl-d: exit") |
| 114 | return box + "\n" + hint |
| 115 | } |
| 116 | |
| 117 | // ReadChatInput shows the bordered input box and blocks until the user |
| 118 | // submits or hits ctrl-d. Returns (text, ok). ok=false on exit. |