()
| 319 | } |
| 320 | |
| 321 | _renderChatPanel() { |
| 322 | let buf = ''; |
| 323 | |
| 324 | // Show welcome splash when no messages yet |
| 325 | if (this.showWelcome && this.chatLines.length === 0) { |
| 326 | return this._renderWelcomeScreen(); |
| 327 | } |
| 328 | |
| 329 | const startLine = Math.max(0, this.chatLines.length - this.chatHeight + this.chatScroll); |
| 330 | const endLine = startLine + this.chatHeight; |
| 331 | const visible = this.chatLines.slice(startLine, endLine); |
| 332 | |
| 333 | for (let i = 0; i < this.chatHeight; i++) { |
| 334 | buf += ANSI.moveTo(i + 1, 1); |
| 335 | const line = visible[i] || ''; |
| 336 | buf += fitAnsi(line, this.chatWidth); |
| 337 | } |
| 338 | |
| 339 | return buf; |
| 340 | } |
| 341 | |
| 342 | _renderWelcomeScreen() { |
| 343 | let buf = ''; |
no test coverage detected