()
| 263 | // ─── Layout ────────────────────────────────────────────────────────── |
| 264 | |
| 265 | _computeLayout() { |
| 266 | this.width = process.stdout.columns || 80; |
| 267 | this.height = process.stdout.rows || 24; |
| 268 | |
| 269 | // Dynamic input height: grows with content (min 3, max 8 lines) |
| 270 | const inputAvail = this.width - 5; |
| 271 | const inputVisualLen = visualLength(this.inputBuffer); |
| 272 | const wrappedLines = inputAvail > 0 ? Math.ceil(Math.max(1, inputVisualLen) / inputAvail) : 1; |
| 273 | this.inputHeight = Math.min(8, Math.max(3, wrappedLines + 2)); // +2 for border + hint |
| 274 | |
| 275 | this.chatHeight = this.height - this.inputHeight - this.statusHeight; |
| 276 | |
| 277 | if (this.showToolPanel && this.width > 100) { |
| 278 | this.chatWidth = Math.floor(this.width * 0.65); |
| 279 | this.toolWidth = this.width - this.chatWidth - 1; |
| 280 | } else { |
| 281 | this.chatWidth = this.width; |
| 282 | this.toolWidth = 0; |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | // ─── Rendering ───────────────────────────────────────────────────── |
| 287 |
no test coverage detected