MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / hideOverlay

Method hideOverlay

packages/pi-tui/src/tui.ts:599–612  ·  view source on GitHub ↗

Hide the topmost overlay and restore previous focus.

()

Source from the content-addressed store, hash-verified

597
598 /** Hide the topmost overlay and restore previous focus. */
599 hideOverlay(): void {
600 const overlay = this.overlayStack[this.overlayStack.length - 1];
601 if (!overlay) return;
602 this.clearOverlayFocusRestoreFor(overlay);
603 this.retargetOverlayPreFocus(overlay);
604 this.overlayStack.pop();
605 if (this.focusedComponent === overlay.component) {
606 // Find topmost visible overlay, or fall back to preFocus
607 const topVisible = this.getTopmostVisibleOverlay();
608 this.setFocus(topVisible?.component ?? overlay.preFocus);
609 }
610 if (this.overlayStack.length === 0) this.terminal.hideCursor();
611 this.requestRender();
612 }
613
614 /** Check if there are any visible overlays */
615 hasOverlay(): boolean {

Calls 7

setFocusMethod · 0.95
requestRenderMethod · 0.95
popMethod · 0.80
hideCursorMethod · 0.65

Tested by

no test coverage detected