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

Method render

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

Source from the content-addressed store, hash-verified

286 // ─── Rendering ─────────────────────────────────────────────────────
287
288 render() {
289 if (!this.active) return;
290 this._computeLayout(); // Recalculate in case input grew/shrunk
291
292 let buf = '';
293
294 // Clear
295 buf += ANSI.clearScreen + ANSI.moveTo(1, 1);
296
297 // Chat panel
298 buf += this._renderChatPanel();
299
300 // Tool panel (if split)
301 if (this.toolWidth > 0) {
302 buf += this._renderToolPanel();
303 }
304
305 // Input area
306 buf += this._renderInput();
307
308 // Status bar
309 buf += this._renderStatus();
310
311 // Position cursor in wrapped input (visual-width-aware)
312 const inputAvail = this.width - 5;
313 const pos = visualCursorPosition(this.inputBuffer, this.inputCursor, inputAvail);
314 const inputRow = this.chatHeight + 2 + pos.line; // +1 border, +1 for 1-index
315 const inputCol = 5 + pos.col; // "│ > " prefix
316 buf += ANSI.moveTo(inputRow, inputCol) + ANSI.showCursor;
317
318 this._rawWrite(buf);
319 }
320
321 _renderChatPanel() {
322 let buf = '';

Callers 13

enterMethod · 0.95
setStatusMethod · 0.95
_onKeypressMethod · 0.95
_onResizeMethod · 0.95
addChatMethod · 0.95
addToolMethod · 0.95
addDiffMethod · 0.95
setStreamingMethod · 0.95
setModelMethod · 0.95
setTokenInfoMethod · 0.95
streamTokenMethod · 0.95
endStreamMethod · 0.95

Calls 6

_computeLayoutMethod · 0.95
_renderChatPanelMethod · 0.95
_renderToolPanelMethod · 0.95
_renderInputMethod · 0.95
_renderStatusMethod · 0.95
visualCursorPositionFunction · 0.85

Tested by

no test coverage detected