MCPcopy
hub / github.com/Doorman11991/smallcode / _renderChatPanel

Method _renderChatPanel

src/tui/fullscreen.js:321–340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 = '';

Callers 1

renderMethod · 0.95

Calls 2

_renderWelcomeScreenMethod · 0.95
fitAnsiFunction · 0.85

Tested by

no test coverage detected